summaryrefslogtreecommitdiff
path: root/kernels/runtime_fill_gl_image.cl
diff options
context:
space:
mode:
Diffstat (limited to 'kernels/runtime_fill_gl_image.cl')
-rw-r--r--kernels/runtime_fill_gl_image.cl15
1 files changed, 15 insertions, 0 deletions
diff --git a/kernels/runtime_fill_gl_image.cl b/kernels/runtime_fill_gl_image.cl
new file mode 100644
index 00000000..79d40543
--- /dev/null
+++ b/kernels/runtime_fill_gl_image.cl
@@ -0,0 +1,15 @@
+__kernel void
+runtime_fill_gl_image(image2d_t img, int color)
+{
+ int2 coord;
+ float4 color_v4;
+ int lgid_x = get_group_id(0);
+ int lgid_y = get_group_id(1);
+ int num_groups_x = get_num_groups(0);
+ int num_groups_y = get_num_groups(1);
+
+ coord.x = get_global_id(0);
+ coord.y = get_global_id(1);
+ color_v4 = (float4)( lgid_x/(float)num_groups_x, lgid_y/(float)num_groups_y, 1.0, 1.0);
+ write_imagef(img, coord, color_v4);
+}