OpenCL C 1.0 didn't support 3-component vectors.

This commit is contained in:
Ioannis Tsakpinis 2010-10-01 03:48:41 +00:00
parent fb6c46c189
commit c2ba79169b
2 changed files with 10 additions and 7 deletions

View File

@ -346,10 +346,12 @@ public class DemoFractal {
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)");

View File

@ -63,12 +63,13 @@ kernel void mandelbrot(
// 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