__global__
HelloPTContext context,
{
const uint2 pixel = make_uint2(
threadIdx.x + blockIdx.x*blockDim.x,
threadIdx.y + blockIdx.y*blockDim.y );
if (pixel.x >= renderer.res_x || pixel.y >= renderer.res_y)
return;
const int idx = pixel.x + pixel.y*renderer.res_x;
context.in_queue.rays[idx] = ray;
context.in_queue.pixels[idx] = make_uint4( idx, uint32(-1), uint32(-1), uint32(-1) );
if (pixel.x == 0 && pixel.y)
*context.in_queue.size = renderer.res_x * renderer.res_y;
}
HelloPTContext context,
{
dim3 blockSize(32, 16);
generate_primary_rays_kernel << < gridSize, blockSize >> > (context, renderer);
}