summaryrefslogtreecommitdiff
path: root/tools/gfx/vulkan/render-vk.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-06-23 11:33:30 -0700
committerGitHub <noreply@github.com>2021-06-23 11:33:30 -0700
commit0f2d11dc994c6323b4bfb955b522f3123e731fe0 (patch)
treebc1316bba9217b22f3708dcb03727d70d2d8351a /tools/gfx/vulkan/render-vk.cpp
parent0afa24a3fe7d0e1787cc909f9c7641f477c30e5c (diff)
[gfx] Add `IBufferResource::getDeviceAddress()`. (#1892)
Diffstat (limited to 'tools/gfx/vulkan/render-vk.cpp')
-rw-r--r--tools/gfx/vulkan/render-vk.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp
index 78054b4d5..97a527ca6 100644
--- a/tools/gfx/vulkan/render-vk.cpp
+++ b/tools/gfx/vulkan/render-vk.cpp
@@ -179,6 +179,17 @@ public:
RefPtr<VKDevice> m_renderer;
Buffer m_buffer;
Buffer m_uploadBuffer;
+
+ virtual SLANG_NO_THROW DeviceAddress SLANG_MCALL getDeviceAddress() override
+ {
+ if (!m_buffer.m_api->vkGetBufferDeviceAddress)
+ return 0;
+ VkBufferDeviceAddressInfo info = {};
+ info.sType = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO;
+ info.buffer = m_buffer.m_buffer;
+ return (DeviceAddress)m_buffer.m_api->vkGetBufferDeviceAddress(
+ m_buffer.m_api->m_device, &info);
+ }
};
class TextureResourceImpl : public TextureResource