Fix T88096: Baking with OptiX and displacement fails

Using displacement runs the shader eval kernel, but since OptiX modules are not loaded when
baking is active, those were not available and therefore failed to launch. This fixes that by falling
back to the CUDA kernels.
This commit is contained in:
Patrick Mours 2021-05-25 16:56:16 +02:00
parent 8cd506639a
commit b046bc536b
Notes: blender-bot 2023-02-13 18:45:46 +01:00
Referenced by issue #88096, Cannot bake to an image with optix and displacement
1 changed files with 5 additions and 1 deletions

View File

@ -726,7 +726,11 @@ class OptiXDevice : public CUDADevice {
}
}
else if (task.type == DeviceTask::SHADER) {
launch_shader_eval(task, thread_index);
// CUDA kernels are used when doing baking
if (optix_module == NULL)
CUDADevice::shader(task);
else
launch_shader_eval(task, thread_index);
}
else if (task.type == DeviceTask::DENOISE_BUFFER) {
// Set up a single tile that covers the whole task and denoise it