Skip to content

Instantly share code, notes, and snippets.

@Balletie
Created July 19, 2014 18:20
Show Gist options
  • Save Balletie/70349e75995c1a420b1d to your computer and use it in GitHub Desktop.
Save Balletie/70349e75995c1a420b1d to your computer and use it in GitHub Desktop.
Voorbeeld render calls
void RenderSession::render() {
unsigned int size = _scene->_cam->size();
device_mem ray_dirs = _device->malloc(size * sizeof(cl_float4), READ_WRITE);
// Arguments: float4* output, cl_camera cam
void* argvalues[2] = { ray_dirs.ptr(), _scene->_cam.gpu_type() };
size_t* arg_sizes;
// Blocking call!
_device->enqueue_kernel_range(KERNEL_PRODUCE_RAY, 2, arg_values, arg_sizes, 1, size);
// etc...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment