Fix T84016: Cycles baking crash with OptiX after recent changes

This worked for CPU + GPU, but not GPU only.
This commit is contained in:
Brecht Van Lommel 2020-12-24 12:55:34 +01:00
parent 2221389d6e
commit c4f8aedbc2
Notes: blender-bot 2023-02-14 05:43:04 +01:00
Referenced by issue #84016, Crash when baking with OptiX enabled 2.92
1 changed files with 6 additions and 0 deletions

View File

@ -1248,6 +1248,12 @@ class OptiXDevice : public CUDADevice {
void build_bvh(BVH *bvh, Progress &progress, bool refit) override
{
if (bvh->params.bvh_layout == BVH_LAYOUT_BVH2) {
/* For baking CUDA is used, build appropriate BVH for that. */
Device::build_bvh(bvh, progress, refit);
return;
}
BVHOptiX *const bvh_optix = static_cast<BVHOptiX *>(bvh);
progress.set_substatus("Building OptiX acceleration structure");