COSC-3P93-Project/Step 3/resources/opencl/image.cl

12 lines
313 B
Common Lisp
Raw Normal View History

2022-11-23 11:55:40 -05:00
__kernel void drawImage(__write_only image2d_t output) {
// Get the index of the current element to be processed
int i = get_global_id(0);
int j = get_global_id(1);
float color = sin(i / 10.0) * sin (j / 10.0);
write_imagef(output, (int2)(i, j), (float4)(color, color, color, 1.0));
}