From 12d2f8a9d4442132fb2fcf00e190a901dab7d1a3 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 22 Aug 2022 21:02:29 +0200 Subject: [PATCH] [dxvk] Expose sparse binding operations as part of the command list --- src/dxvk/dxvk_cmdlist.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/dxvk/dxvk_cmdlist.h b/src/dxvk/dxvk_cmdlist.h index 6188b5c48..fc096b016 100644 --- a/src/dxvk/dxvk_cmdlist.h +++ b/src/dxvk/dxvk_cmdlist.h @@ -958,6 +958,27 @@ namespace dxvk { } + void bindBufferMemory( + const DxvkSparseBufferBindKey& key, + const DxvkSparsePageHandle& memory) { + getSparseBindSubmission().bindBufferMemory(key, memory); + } + + + void bindImageMemory( + const DxvkSparseImageBindKey& key, + const DxvkSparsePageHandle& memory) { + getSparseBindSubmission().bindImageMemory(key, memory); + } + + + void bindImageOpaqueMemory( + const DxvkSparseImageOpaqueBindKey& key, + const DxvkSparsePageHandle& memory) { + getSparseBindSubmission().bindImageOpaqueMemory(key, memory); + } + + void trackDescriptorPool( const Rc& pool, const Rc& manager) { @@ -1008,6 +1029,16 @@ namespace dxvk { return VK_NULL_HANDLE; } + DxvkSparseBindSubmission& getSparseBindSubmission() { + if (likely(m_cmd.sparseBind)) + return m_cmdSparseBinds[m_cmd.sparseCmd]; + + m_cmd.sparseBind = VK_TRUE; + m_cmd.sparseCmd = uint32_t(m_cmdSparseBinds.size()); + + return m_cmdSparseBinds.emplace_back(); + } + void endCommandBuffer(VkCommandBuffer cmdBuffer); };