From 4ce200bcae3bdb285cbbea80eb13f3dabd38f2d3 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 1 Oct 2024 14:43:06 +0200 Subject: [PATCH] [dxvk] Add command list parameter to cmdBindDescriptorSet(s) --- src/dxvk/dxvk_cmdlist.h | 6 ++- src/dxvk/dxvk_context.cpp | 59 ++++++++++++++--------------- src/dxvk/dxvk_swapchain_blitter.cpp | 7 +++- 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/src/dxvk/dxvk_cmdlist.h b/src/dxvk/dxvk_cmdlist.h index 2a3c9be1..77592d73 100644 --- a/src/dxvk/dxvk_cmdlist.h +++ b/src/dxvk/dxvk_cmdlist.h @@ -442,18 +442,20 @@ namespace dxvk { void cmdBindDescriptorSet( + DxvkCmdBuffer cmdBuffer, VkPipelineBindPoint pipeline, VkPipelineLayout pipelineLayout, VkDescriptorSet descriptorSet, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) { - m_vkd->vkCmdBindDescriptorSets(m_cmd.execBuffer, + m_vkd->vkCmdBindDescriptorSets(getCmdBuffer(cmdBuffer), pipeline, pipelineLayout, 0, 1, &descriptorSet, dynamicOffsetCount, pDynamicOffsets); } void cmdBindDescriptorSets( + DxvkCmdBuffer cmdBuffer, VkPipelineBindPoint pipeline, VkPipelineLayout pipelineLayout, uint32_t firstSet, @@ -461,7 +463,7 @@ namespace dxvk { const VkDescriptorSet* descriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) { - m_vkd->vkCmdBindDescriptorSets(m_cmd.execBuffer, + m_vkd->vkCmdBindDescriptorSets(getCmdBuffer(cmdBuffer), pipeline, pipelineLayout, firstSet, descriptorSetCount, descriptorSets, dynamicOffsetCount, pDynamicOffsets); } diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 9b12b1d4..40da1793 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -310,10 +310,9 @@ namespace dxvk { m_cmd->cmdBindPipeline( VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeline); - m_cmd->cmdBindDescriptorSet( - VK_PIPELINE_BIND_POINT_COMPUTE, - pipeInfo.pipeLayout, descriptorSet, - 0, nullptr); + m_cmd->cmdBindDescriptorSet(DxvkCmdBuffer::ExecBuffer, + VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeLayout, + descriptorSet, 0, nullptr); m_cmd->cmdPushConstants(DxvkCmdBuffer::ExecBuffer, pipeInfo.pipeLayout, VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(pushArgs), &pushArgs); @@ -816,10 +815,9 @@ namespace dxvk { VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeHandle); - m_cmd->cmdBindDescriptorSet( - VK_PIPELINE_BIND_POINT_COMPUTE, - pipeInfo.pipeLayout, dset, - 0, nullptr); + m_cmd->cmdBindDescriptorSet(DxvkCmdBuffer::ExecBuffer, + VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeLayout, + dset, 0, nullptr); m_cmd->cmdPushConstants(DxvkCmdBuffer::ExecBuffer, pipeInfo.pipeLayout, VK_SHADER_STAGE_COMPUTE_BIT, @@ -983,10 +981,9 @@ namespace dxvk { VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeHandle); - m_cmd->cmdBindDescriptorSet( - VK_PIPELINE_BIND_POINT_COMPUTE, - pipeInfo.pipeLayout, descriptorSet, - 0, nullptr); + m_cmd->cmdBindDescriptorSet(DxvkCmdBuffer::ExecBuffer, + VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeLayout, + descriptorSet, 0, nullptr); m_cmd->cmdPushConstants(DxvkCmdBuffer::ExecBuffer, pipeInfo.pipeLayout, VK_SHADER_STAGE_COMPUTE_BIT, @@ -1124,10 +1121,9 @@ namespace dxvk { VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeHandle); - m_cmd->cmdBindDescriptorSet( - VK_PIPELINE_BIND_POINT_COMPUTE, - pipeInfo.pipeLayout, dset, - 0, nullptr); + m_cmd->cmdBindDescriptorSet(DxvkCmdBuffer::ExecBuffer, + VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeLayout, + dset, 0, nullptr); m_cmd->cmdPushConstants(DxvkCmdBuffer::ExecBuffer, pipeInfo.pipeLayout, VK_SHADER_STAGE_COMPUTE_BIT, @@ -1808,8 +1804,9 @@ namespace dxvk { m_cmd->cmdBeginRendering(&renderingInfo); m_cmd->cmdBindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeInfo.pipeHandle); - m_cmd->cmdBindDescriptorSet(VK_PIPELINE_BIND_POINT_GRAPHICS, - pipeInfo.pipeLayout, descriptorWrite.dstSet, 0, nullptr); + m_cmd->cmdBindDescriptorSet(DxvkCmdBuffer::ExecBuffer, + VK_PIPELINE_BIND_POINT_GRAPHICS, pipeInfo.pipeLayout, + descriptorWrite.dstSet, 0, nullptr); m_cmd->cmdSetViewport(1, &viewport); m_cmd->cmdSetScissor(1, &scissor); @@ -3216,8 +3213,9 @@ namespace dxvk { descriptorWrite.pImageInfo = &descriptorImage; m_cmd->updateDescriptorSets(1, &descriptorWrite); - m_cmd->cmdBindDescriptorSet(VK_PIPELINE_BIND_POINT_GRAPHICS, - pipeInfo.pipeLayout, descriptorWrite.dstSet, 0, nullptr); + m_cmd->cmdBindDescriptorSet(DxvkCmdBuffer::ExecBuffer, + VK_PIPELINE_BIND_POINT_GRAPHICS, pipeInfo.pipeLayout, + descriptorWrite.dstSet, 0, nullptr); // Compute shader parameters for the operation VkExtent3D srcExtent = srcView->mipLevelExtent(0); @@ -3665,10 +3663,9 @@ namespace dxvk { m_cmd->cmdBindPipeline( VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeline); - m_cmd->cmdBindDescriptorSet( - VK_PIPELINE_BIND_POINT_COMPUTE, - pipeInfo.pipeLayout, descriptorSet, - 0, nullptr); + m_cmd->cmdBindDescriptorSet(DxvkCmdBuffer::ExecBuffer, + VK_PIPELINE_BIND_POINT_COMPUTE, pipeInfo.pipeLayout, + descriptorSet, 0, nullptr); m_cmd->cmdPushConstants(DxvkCmdBuffer::ExecBuffer, pipeInfo.pipeLayout, VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(pushArgs), &pushArgs); @@ -3970,8 +3967,9 @@ namespace dxvk { // Perform the actual copy operation m_cmd->cmdBeginRendering(&renderingInfo); m_cmd->cmdBindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeInfo.pipeHandle); - m_cmd->cmdBindDescriptorSet(VK_PIPELINE_BIND_POINT_GRAPHICS, - pipeInfo.pipeLayout, descriptorSet, 0, nullptr); + m_cmd->cmdBindDescriptorSet(DxvkCmdBuffer::ExecBuffer, + VK_PIPELINE_BIND_POINT_GRAPHICS, pipeInfo.pipeLayout, + descriptorSet, 0, nullptr); m_cmd->cmdSetViewport(1, &viewport); m_cmd->cmdSetScissor(1, &scissor); @@ -4636,8 +4634,9 @@ namespace dxvk { m_cmd->cmdBeginRendering(&renderingInfo); m_cmd->cmdBindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeInfo.pipeHandle); - m_cmd->cmdBindDescriptorSet(VK_PIPELINE_BIND_POINT_GRAPHICS, - pipeInfo.pipeLayout, descriptorSet, 0, nullptr); + m_cmd->cmdBindDescriptorSet(DxvkCmdBuffer::ExecBuffer, + VK_PIPELINE_BIND_POINT_GRAPHICS, pipeInfo.pipeLayout, + descriptorSet, 0, nullptr); m_cmd->cmdSetViewport(1, &viewport); m_cmd->cmdSetScissor(1, &scissor); m_cmd->cmdPushConstants(DxvkCmdBuffer::ExecBuffer, @@ -5540,8 +5539,8 @@ namespace dxvk { uint32_t firstSet = bit::tzcnt(dirtySetMask); dirtySetMask &= (~1u) << setIndex; - m_cmd->cmdBindDescriptorSets(BindPoint, - layout->getPipelineLayout(independentSets), + m_cmd->cmdBindDescriptorSets(DxvkCmdBuffer::ExecBuffer, + BindPoint, layout->getPipelineLayout(independentSets), firstSet, setIndex - firstSet + 1, &sets[firstSet], 0, nullptr); } diff --git a/src/dxvk/dxvk_swapchain_blitter.cpp b/src/dxvk/dxvk_swapchain_blitter.cpp index a2be7002..ab90764f 100644 --- a/src/dxvk/dxvk_swapchain_blitter.cpp +++ b/src/dxvk/dxvk_swapchain_blitter.cpp @@ -145,8 +145,11 @@ namespace dxvk { set, 1, 0, 1, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, &gammaDescriptor }, }}; - ctx.cmd->updateDescriptorSets(descriptorWrites.size(), descriptorWrites.data()); - ctx.cmd->cmdBindDescriptorSet(VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipelineLayout, set, 0, nullptr); + ctx.cmd->updateDescriptorSets( + descriptorWrites.size(), descriptorWrites.data()); + ctx.cmd->cmdBindDescriptorSet(DxvkCmdBuffer::ExecBuffer, + VK_PIPELINE_BIND_POINT_GRAPHICS, m_pipelineLayout, + set, 0, nullptr); PushConstants args = { }; args.srcOffset = srcRect.offset;