Can't for the life of me get this to work. It's real darn good at crashing my computer though. Probably all those waits...
parent
d93a57cbdf
commit
699150de2d
@ -1,21 +1,25 @@
|
|||||||
__kernel void conway_compute(__global unsigned char* front_grid, __global int* num_workers, __global int* grid_width, __global int* grid_height)
|
__kernel void conway_compute(__write_only image2d_t front_grid, __global int* num_workers, __global int* grid_width, __global int *grid_height)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//int width = *grid_width;
|
||||||
|
//int height = grid_height;
|
||||||
|
|
||||||
|
int2 pixelcoord = (int2) (get_global_id(0), get_global_id(1));
|
||||||
|
//if (pixelcoord.x < width && pixelcoord.y < height)
|
||||||
|
//{
|
||||||
|
//float4 pixel = read_imagef(image1, sampler, (int2)(pixelcoord.x, pixelcoord.y));
|
||||||
|
float4 black = (float4)(0,0,0,0);
|
||||||
|
|
||||||
|
|
||||||
|
// write_imagef(front_grid, pixelcoord, black);
|
||||||
|
|
||||||
|
|
||||||
int num = *grid_width * *grid_height * 4;
|
int num = *grid_width * *grid_height * 4;
|
||||||
|
|
||||||
for (int i = 0; i < num ; i += 4){
|
for (int i = 0; i < num ; i += 4){
|
||||||
|
|
||||||
front_grid[i] = 0;
|
write_imagef(front_grid, pixelcoord, black);
|
||||||
front_grid[i + 1] = 0;
|
//
|
||||||
front_grid[i + 2] = 0;
|
|
||||||
front_grid[i + 3] = 0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//}
|
||||||
front_grid[90000] = 0;
|
|
||||||
front_grid[90001] = 0;
|
|
||||||
front_grid[90002] = 0;
|
|
||||||
front_grid[90003] = 0;
|
|
||||||
front_grid[90004] = 0;
|
|
||||||
front_grid[90005] = 0;
|
|
||||||
front_grid[90006] = 0;
|
|
||||||
}
|
}
|
Loading…
Reference in new issue