From: <sp...@us...> - 2010-10-01 03:48:49
|
Revision: 3424 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3424&view=rev Author: spasi Date: 2010-10-01 03:48:41 +0000 (Fri, 01 Oct 2010) Log Message: ----------- OpenCL C 1.0 didn't support 3-component vectors. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl 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 00:18:45 UTC (rev 3423) +++ trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java 2010-10-01 03:48:41 UTC (rev 3424) @@ -346,10 +346,12 @@ else if ( device_type == CL_DEVICE_TYPE_CPU && !caps.OpenGL21 ) throw new RuntimeException("OpenGL 2.1 is required to run this demo."); - if ( caps.GL_ARB_debug_output ) - glDebugMessageCallbackARB(new ARBDebugOutputCallback()); - else if ( caps.GL_AMD_debug_output ) - glDebugMessageCallbackAMD(new AMDDebugOutputCallback()); + if ( params.contains("debugGL") ) { + if ( caps.GL_ARB_debug_output ) + glDebugMessageCallbackARB(new ARBDebugOutputCallback()); + else if ( caps.GL_AMD_debug_output ) + glDebugMessageCallbackAMD(new AMDDebugOutputCallback()); + } if ( device_type == CL_DEVICE_TYPE_GPU ) System.out.println("OpenCL Device Type: GPU (Use -forceCPU to use CPU)"); 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 00:18:45 UTC (rev 3423) +++ trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl 2010-10-01 03:48:41 UTC (rev 3424) @@ -63,12 +63,13 @@ // We could also use an R32UI texture and do the unpacking in GLSL, // but then we'd require OpenGL 3.0 (GLSL 1.30). uint c = colorMap[colorIndex]; - float3 oc = (float3)( + float4 oc = (float4)( (c & 0xFF) >> 0, (c & 0xFF00) >> 8, - (c & 0xFF0000) >> 16 + (c & 0xFF0000) >> 16, + 255.0 ); - write_imagef(output, (int2)(ix, iy), (float4)(oc / 255.0, 1.0)); + write_imagef(output, (int2)(ix, iy), oc / 255.0); #else output[iy * width + ix] = colorMap[colorIndex]; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2011-04-02 11:33:08
|
Revision: 3512 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3512&view=rev Author: spasi Date: 2011-04-02 11:33:02 +0000 (Sat, 02 Apr 2011) Log Message: ----------- Attempt to fix NV compilation issue. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl Modified: trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java 2011-03-30 09:35:14 UTC (rev 3511) +++ trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/DemoFractal.java 2011-04-02 11:33:02 UTC (rev 3512) @@ -518,12 +518,9 @@ glDeleteBuffers(glIDs); } - if ( useTextures ) + if ( useTextures ) { glGenTextures(glIDs); - else - glGenBuffers(glIDs); - if ( useTextures ) { // Init textures for ( int i = 0; i < slices; i++ ) { glBindTexture(GL_TEXTURE_2D, glIDs.get(i)); @@ -535,6 +532,8 @@ } 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)); Modified: trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl 2011-03-30 09:35:14 UTC (rev 3511) +++ trunk/LWJGL/src/java/org/lwjgl/test/opencl/gl/Mandelbrot.cl 2011-04-02 11:33:02 UTC (rev 3512) @@ -57,7 +57,7 @@ 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 @@ (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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |