Fix OptiX acceleration structure failing to build in viewport

The `optixAccelBuild` API throws an error when the property to get compacted size is passed in
without the `OPTIX_BUILD_FLAG_ALLOW_COMPACTION` flag set. This is not currently hit
because `background` is always true (set in `mem_alloc`), but would become an issue once that
is sorted out, so fixing it now to be safe.
This commit is contained in:
Patrick Mours 2020-01-10 16:03:11 +01:00
parent 6915555906
commit 89578a8f6e
1 changed files with 2 additions and 2 deletions

View File

@ -1188,8 +1188,8 @@ class OptiXDevice : public Device {
out_data,
sizes.outputSizeInBytes,
&out_handle,
&compacted_size_prop,
1));
background ? &compacted_size_prop : NULL,
background ? 1 : 0));
// Wait for all operations to finish
check_result_cuda_ret(cuStreamSynchronize(NULL));