diff options
| author | Yong He <yonghe@outlook.com> | 2022-02-10 13:59:53 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-10 13:59:53 -0800 |
| commit | 1c030cdb964979bb0837a297749236a541cc80fa (patch) | |
| tree | cea2c36aecf2805e139e07fc14b9c945de6772d1 /tools/gfx/vulkan/render-vk.cpp | |
| parent | 120f97fb8d4e22b057cea43b503611f8292ade37 (diff) | |
gfx: Add `resolveQuery` command. (#2125)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/vulkan/render-vk.cpp')
| -rw-r--r-- | tools/gfx/vulkan/render-vk.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp index 80084ae7b..d3f0329d8 100644 --- a/tools/gfx/vulkan/render-vk.cpp +++ b/tools/gfx/vulkan/render-vk.cpp @@ -4876,6 +4876,27 @@ public: } } + virtual SLANG_NO_THROW void SLANG_MCALL resolveQuery( + IQueryPool* queryPool, + uint32_t index, + uint32_t count, + IBufferResource* buffer, + uint64_t offset) override + { + auto& vkApi = m_commandBuffer->m_renderer->m_api; + auto poolImpl = static_cast<QueryPoolImpl*>(queryPool); + auto bufferImpl = static_cast<BufferResourceImpl*>(buffer); + vkApi.vkCmdCopyQueryPoolResults( + m_commandBuffer->m_commandBuffer, + poolImpl->m_pool, + index, + count, + bufferImpl->m_buffer.m_buffer, + offset, + sizeof(uint64_t), + VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT); + } + virtual SLANG_NO_THROW void SLANG_MCALL copyTextureToBuffer( IBufferResource* dst, size_t dstOffset, |
