Fixed Mandelbrot.cl to not crash on Cuda.
This commit is contained in:
parent
c2ba79169b
commit
3470552355
|
@ -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
|
||||
|
||||
/**
|
||||
|
@ -67,9 +69,9 @@ kernel void mandelbrot(
|
|||
(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
|
||||
|
|
|
@ -122,17 +122,15 @@ public interface ARB_viewport_array {
|
|||
@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);
|
||||
|
|
Loading…
Reference in New Issue