11 # define __KERNEL_OPTIX__
18 OptiXDeviceQueue::OptiXDeviceQueue(OptiXDevice *device) : CUDADeviceQueue(device)
41 if (!is_optix_specific_kernel(
kernel)) {
45 if (cuda_device_->have_error()) {
51 const CUDAContextScope scope(cuda_device_);
53 OptiXDevice *
const optix_device =
static_cast<OptiXDevice *
>(cuda_device_);
55 const device_ptr sbt_data_ptr = optix_device->sbt_data.device_pointer;
56 const device_ptr launch_params_ptr = optix_device->launch_params.device_pointer;
76 cuda_device_assert(cuda_device_, cuStreamSynchronize(cuda_stream_));
78 OptixPipeline pipeline =
nullptr;
79 OptixShaderBindingTable sbt_params = {};
83 pipeline = optix_device->pipelines[PIP_SHADE_RAYTRACE];
84 sbt_params.raygenRecord = sbt_data_ptr + PG_RGEN_SHADE_SURFACE_RAYTRACE *
sizeof(SbtRecord);
87 pipeline = optix_device->pipelines[PIP_SHADE_MNEE];
88 sbt_params.raygenRecord = sbt_data_ptr + PG_RGEN_SHADE_SURFACE_MNEE *
sizeof(SbtRecord);
91 pipeline = optix_device->pipelines[PIP_INTERSECT];
92 sbt_params.raygenRecord = sbt_data_ptr + PG_RGEN_INTERSECT_CLOSEST *
sizeof(SbtRecord);
95 pipeline = optix_device->pipelines[PIP_INTERSECT];
96 sbt_params.raygenRecord = sbt_data_ptr + PG_RGEN_INTERSECT_SHADOW *
sizeof(SbtRecord);
99 pipeline = optix_device->pipelines[PIP_INTERSECT];
100 sbt_params.raygenRecord = sbt_data_ptr + PG_RGEN_INTERSECT_SUBSURFACE *
sizeof(SbtRecord);
103 pipeline = optix_device->pipelines[PIP_INTERSECT];
104 sbt_params.raygenRecord = sbt_data_ptr + PG_RGEN_INTERSECT_VOLUME_STACK *
sizeof(SbtRecord);
109 <<
" is attempted to be enqueued.";
113 sbt_params.missRecordBase = sbt_data_ptr + MISS_PROGRAM_GROUP_OFFSET *
sizeof(SbtRecord);
114 sbt_params.missRecordStrideInBytes =
sizeof(SbtRecord);
115 sbt_params.missRecordCount = NUM_MIS_PROGRAM_GROUPS;
116 sbt_params.hitgroupRecordBase = sbt_data_ptr + HIT_PROGAM_GROUP_OFFSET *
sizeof(SbtRecord);
117 sbt_params.hitgroupRecordStrideInBytes =
sizeof(SbtRecord);
118 sbt_params.hitgroupRecordCount = NUM_HIT_PROGRAM_GROUPS;
119 sbt_params.callablesRecordBase = sbt_data_ptr + CALLABLE_PROGRAM_GROUPS_BASE *
sizeof(SbtRecord);
120 sbt_params.callablesRecordCount = NUM_CALLABLE_PROGRAM_GROUPS;
121 sbt_params.callablesRecordStrideInBytes =
sizeof(SbtRecord);
124 optix_device_assert(optix_device,
125 optixLaunch(pipeline,
128 optix_device->launch_params.data_elements,
134 return !(optix_device->have_error());
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN const char * device_kernel_as_string(DeviceKernel kernel)
SyclQueue void void size_t num_bytes SyclQueue void const char void *memory_device_pointer KernelContext int kernel
static struct ImBuf * init_execution(const SeqRenderData *context, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *ibuf3)
ccl_gpu_kernel_postfix ccl_global const int ccl_global float const int work_size
ccl_gpu_kernel_postfix ccl_global const int * path_index_array
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int ccl_global float * render_buffer
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_SUBSURFACE
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_VOLUME_STACK
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_MNEE
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST