From eb3a31bcc981746574fc790a7d151fa90b616d30 Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Sat, 2 Apr 2011 11:33:02 +0000 Subject: [PATCH] Attempt to fix NV compilation issue. --- src/java/org/lwjgl/test/opencl/gl/DemoFractal.java | 9 ++++----- src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java b/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java index dc180f45..b486a82c 100644 --- a/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java +++ b/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java @@ -518,12 +518,9 @@ public class DemoFractal { glDeleteBuffers(glIDs); } - if ( useTextures ) - glGenTextures(glIDs); - else - glGenBuffers(glIDs); - if ( useTextures ) { + glGenTextures(glIDs); + // Init textures for ( int i = 0; i < slices; i++ ) { glBindTexture(GL_TEXTURE_2D, glIDs.get(i)); @@ -535,6 +532,8 @@ public class DemoFractal { } glBindTexture(GL_TEXTURE_2D, 0); } else { + glGenBuffers(glIDs); + // setup one empty PBO per slice for ( int i = 0; i < slices; i++ ) { glBindBuffer(GL_PIXEL_UNPACK_BUFFER, glIDs.get(i)); diff --git a/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl b/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl index a1e97289..7f6fb058 100644 --- a/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl +++ b/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl @@ -57,7 +57,7 @@ kernel void mandelbrot( output[iy * width + ix] = 0; #endif } else { - varfloat alpha = (varfloat)iteration / maxIterations; + float alpha = (float)iteration / maxIterations; int colorIndex = (int)(alpha * colorMapSize); #ifdef USE_TEXTURE // We could have changed colorMap to a texture + sampler, but the @@ -69,9 +69,9 @@ kernel void mandelbrot( (c & 0xFF) >> 0, (c & 0xFF00) >> 8, (c & 0xFF0000) >> 16, - _255 + 255.0f ); - write_imagef(output, (int2)(ix, iy), oc / _255); + write_imagef(output, (int2)(ix, iy), oc / 255.0f); #else output[iy * width + ix] = colorMap[colorIndex]; #endif