You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the DeviceMangers for DX11 and DX12, the member m_NvrhiDevice is of type nvrhi::DeviceHandle whereas in Vulkan's DeviceManager it is nvrhi::vulkan::DeviceHandle.
I notice if I don't use nvrhi::vulkan::DeviceHandle I cannot invoke functions like queueWaitForSemaphore. And on the other hand since createValidationLayer returns nvrhi::DeviceHandle, I cannot use it for those function calls that rely on the Vulkan handle. What is the intended usage of these handles and why does Vulkan seemingly have different treatment?
The text was updated successfully, but these errors were encountered:
nvrhi::vulkan::DeviceHandle is just a ref-count handle for nvrhi::vulkan::IDevice, which is derived from nvrhi::IDevice. There are similar derived types for other APIs, like nvrhi::d3d12::IDevice that provide additional functionality compared to regular nvrhi::IDevice. The Vulkan DeviceManager needs some of those additional functions of nvrhi::vulkan::IDevice so it uses that type of handle.
You can trivially upcast a nvrhi::vulkan::DeviceHandle into nvrhi::DeviceHandle, and to downcast, use getNativeObject like so:
This call will unwrap the validation layer, if it is present, and return a valid pointer only if the underlying implementation is actually a Vulkan device. Similar calls can be used for other backends (DX11, DX12).
In the DeviceMangers for DX11 and DX12, the member
m_NvrhiDevice
is of typenvrhi::DeviceHandle
whereas in Vulkan's DeviceManager it isnvrhi::vulkan::DeviceHandle
.However the tutorial when invoking createDevice in the Vulkan section uses
nvrhi::DeviceHandle
: https://github.com/NVIDIAGameWorks/nvrhi/blob/main/doc/Tutorial.mdI notice if I don't use
nvrhi::vulkan::DeviceHandle
I cannot invoke functions likequeueWaitForSemaphore
. And on the other hand sincecreateValidationLayer
returnsnvrhi::DeviceHandle
, I cannot use it for those function calls that rely on the Vulkan handle. What is the intended usage of these handles and why does Vulkan seemingly have different treatment?The text was updated successfully, but these errors were encountered: