10 FPS average increase from changing global work size to 2D

This commit is contained in:
MitchellHansen
2017-03-19 00:42:54 -07:00
parent ec65ef7741
commit 7e5d4ef947
4 changed files with 17 additions and 8 deletions

View File

@@ -149,6 +149,9 @@ __kernel void raycaster(
){
int global_id = get_global_id(0);
int x = get_global_id(0);
int y = get_global_id(1);
// Get and set the random seed from seed memory
int seed = seed_memory[global_id];
@@ -156,7 +159,9 @@ __kernel void raycaster(
seed_memory[global_id] = seed;
// Get the pixel on the viewport, and find the view matrix ray that matches it
int2 pixel = { global_id % (*resolution).x, global_id / (*resolution).x};
//int2 pixel = { global_id % (*resolution).x, global_id / (*resolution).x };
int2 pixel = (int2)(x, y);
float3 ray_dir = projection_matrix[pixel.x + (*resolution).x * pixel.y];
//if (pixel.x == 960 && pixel.y == 540) {