NVIDIAGameWorks / nvrhi

MIT License
798 stars 93 forks source link

When building with RTXMU Acceleration Structure doesn't destroy vulkan objects after use #27

Closed Sirtsu55 closed 1 year ago

Sirtsu55 commented 1 year ago

When building with RTXMU and compacting an AccelStruct everyting is fine, but when the application closes and the device is destroyed, a bunch of Vulkan and DX12 messages warn, that the resources haven't been destroyed. After digging in the code I suspect the destructor for AccelStruct doesn't implement this functionality.

The error message: Validation Error: [ VUID-vkDestroyDevice-device-00378 ] Object 0: handle = 0x55a8fb9483c0, type = VK_OBJECT_TYPE_DEVICE; Object 1: handle = 0x603cd90000000044, type = VK_OBJECT_TYPE_BUFFER;

This comes up for also VK_OBJECT_TYPE_DEVICE_MEMORY, VK_OBJECT_TYPE_QUERY_POOL and VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR

Thanks :)

Sirtsu55 commented 1 year ago

I found a solution to this problem, and will submit a pull request to partially fix it, but for this problem to be completely fixed I would also have to submit a PR to RTXMU repository and this repo will have to use the latest version of RTXMU repo? Is this doable?

apanteleev commented 1 year ago

Thanks!

I merged your PRs here, and once the RTXMU issues are taken care of also, I can update the submodule pointer in NVRHI.

apanteleev commented 1 year ago

RTXMU updated in https://github.com/NVIDIAGameWorks/nvrhi/commit/6fe0a00d6f67d4776cbb913907d67c65a2fed37a

Closing.