Refactored the cl init stuff, added the rest of the image handling in.

The test kernel now draws a few pixels to the screen. Pretty much set up nowto start writing the raycaster
This commit is contained in:
2016-09-01 21:35:08 -07:00
parent a7234675cb
commit c565d0facc
2 changed files with 151 additions and 161 deletions

View File

@@ -1,19 +1,29 @@
__kernel void min_kern(
global char* in,
global char* map,
global int3* map_dim,
global int2* resolution,
global float3* projection_matrix,
global float3* cam_dir,
global float3* cam_pos
global float3* cam_pos,
__write_only image2d_t image
){
size_t id = get_global_id(0);
//printf("%i %c -- ", id, map[id]);
float4 black = (float4)(.49, .68, .81, 1);
int2 pixelcoord = (int2) (id, id);
write_imagef(image, pixelcoord, black);
//printf("%i %i -- ", id, map[id]);
//printf("%i, %i, %i\n", map_dim->x, map_dim->y, map_dim->z);
//printf("\n%i\nX: %f\nY: %f\nZ: %f\n", id, projection_matrix[id].x, projection_matrix[id].y, projection_matrix[id].z);
//printf("%f, %f, %f\n", cam_dir->x, cam_dir->y, cam_dir->z);
//printf("%f, %f, %f\n", cam_pos->x, cam_pos->y, cam_pos->z);
}