From: <sp...@us...> - 2010-10-01 17:00:24
|
Revision: 3425 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3425&view=rev Author: spasi Date: 2010-10-01 17:00:17 +0000 (Fri, 01 Oct 2010) Log Message: ----------- Fixed Mandelbrot.cl to not crash on Cuda. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_viewport_array.java Modified: trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java 2010-10-01 03:48:41 UTC (rev 3424) +++ trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java 2010-10-01 17:00:17 UTC (rev 3425) @@ -476,7 +476,7 @@ for ( int i = 0; i < programs.length; i++ ) { final CLDevice device = queues[i].getCLDevice(); - final StringBuilder options = new StringBuilder(useTextures ? " -D USE_TEXTURE" : ""); + final StringBuilder options = new StringBuilder(useTextures ? "-D USE_TEXTURE" : ""); final CLDeviceCapabilities caps = CLCapabilities.getDeviceCapabilities(device); if ( doublePrecision && isDoubleFPAvailable(device) ) { //cl_khr_fp64 Modified: trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl 2010-10-01 03:48:41 UTC (rev 3424) +++ trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl 2010-10-01 17:00:17 UTC (rev 3425) @@ -4,15 +4,17 @@ #else #pragma OPENCL EXTENSION cl_khr_fp64 : enable #endif - typedef double varfloat; + #define varfloat double + #define _255 255.0 #else - typedef float varfloat; + #define varfloat float + #define _255 255.0f #endif #ifdef USE_TEXTURE - typedef __write_only image2d_t OUTPUT_TYPE; + #define OUTPUT_TYPE __write_only image2d_t #else - typedef global uint * OUTPUT_TYPE; + #define OUTPUT_TYPE global uint * #endif /** @@ -54,7 +56,7 @@ #else output[iy * width + ix] = 0; #endif - } else { + } else { varfloat alpha = (varfloat)iteration / maxIterations; int colorIndex = (int)(alpha * colorMapSize); #ifdef USE_TEXTURE @@ -67,9 +69,9 @@ (c & 0xFF) >> 0, (c & 0xFF00) >> 8, (c & 0xFF0000) >> 16, - 255.0 + _255 ); - write_imagef(output, (int2)(ix, iy), oc / 255.0); + write_imagef(output, (int2)(ix, iy), oc / _255); #else output[iy * width + ix] = colorMap[colorIndex]; #endif Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_viewport_array.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_viewport_array.java 2010-10-01 03:48:41 UTC (rev 3424) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_viewport_array.java 2010-10-01 17:00:17 UTC (rev 3425) @@ -122,17 +122,15 @@ @StripPostfix("data") void glGetDoublei_v2(@GLenum int target, @GLuint int index, @OutParameter DoubleBuffer data); - // TODO: It's glGetIntegerIndexedvEXT in EXT_draw_buffers2, spec typo? - //@Reuse(extension = "EXT_draw_buffers2", className = "EXTDrawBuffers2") + @Reuse("EXTDrawBuffers2") @StripPostfix(value = "v", extension = "EXT") - void glGetIntegerIndexedivEXT(@GLenum int target, @GLuint int index, @Check @OutParameter IntBuffer v); + void glGetIntegerIndexedvEXT(@GLenum int target, @GLuint int index, @Check @OutParameter IntBuffer v); - // TODO: It's glGetIntegerIndexedvEXT in EXT_draw_buffers2, spec typo? - //@Reuse(extension = "EXT_draw_buffers2", className = "EXTDrawBuffers2") + @Reuse("EXTDrawBuffers2") @Alternate("glGetIntegerIndexedivEXT") @GLreturn("v") @StripPostfix(value = "v", extension = "EXT") - void glGetIntegerIndexedivEXT2(@GLenum int target, @GLuint int index, @OutParameter IntBuffer v); + void glGetIntegerIndexedvEXT2(@GLenum int target, @GLuint int index, @OutParameter IntBuffer v); @Reuse("EXTDrawBuffers2") void glEnableIndexedEXT(@GLenum int target, @GLuint int index); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |