[RTX] Building TLAS with zero instances doesn't update result memory


the command “vkCmdBuildAccelerationStructureNV” does not seem to write to the result memory of a top-level acceleration structure if it has no instances. This is not noticable when you allocate new memory for the TLAS (as you usually do), since no intersections are reported as expected. However, if you first create and build a TLAS with some instances, then destroy it and reuse the result memory to create and build an empty TLAS, the old scene will be traced.

I’ve modified the example from https://developer.nvidia.com/rtx/raytracing/vkray to showcase this. The code can be found at https://www.dropbox.com/s/8dh9ec0dvcd7jgk/vkexamples_final.zip?dl=0.

In line 803 of the hello_vulkan.cpp file you can toggle the “freshMemory” flag to compare the results when allocating new memory vs when using the old memory for the empty TLAS.

Tested with an RTX 2080 Ti with drivers 436.48 and 441.12

Hi, there is not too many people on this forum, But I might be able to help you with this specific issue if it’s not solved yet.

I am in the process of learning the Ray Tracing extension at a very fast pace, and maybe you would be interested in collaborating, we could help each other.

There are not too many experts in Vulkan let alone the_RayTracing extension…
I think the best thing to do is to become experts ourselves, and having live discussions about it can really help with that.

What do you say ?