1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-11 10:24:10 +01:00

[dxvk] Use new barrier helpers in clearImageViewCs

And ensure we're in GENERAL layout. We generally (pun intended) should
be, but there may be a universe where that is not the case.
This commit is contained in:
Philip Rebohle 2024-10-12 09:44:22 +02:00 committed by Philip Rebohle
parent 793f9b3d38
commit 2864a5e474

View File

@ -3415,17 +3415,17 @@ namespace dxvk {
VkClearValue value) { VkClearValue value) {
this->spillRenderPass(false); this->spillRenderPass(false);
this->invalidateState(); this->invalidateState();
if (m_execBarriers.isImageDirty( flushPendingAccesses(*imageView->image(), imageView->imageSubresources(), DxvkAccess::Write);
imageView->image(),
imageView->imageSubresources(), addImageLayoutTransition(*imageView->image(), imageView->imageSubresources(),
DxvkAccess::Write)) VK_IMAGE_LAYOUT_GENERAL, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, VK_ACCESS_2_SHADER_WRITE_BIT,
m_execBarriers.recordCommands(m_cmd); imageView->image()->isFullSubresource(vk::pickSubresourceLayers(imageView->imageSubresources(), 0), extent));
// Query pipeline objects to use for this clear operation // Query pipeline objects to use for this clear operation
DxvkMetaClearPipeline pipeInfo = m_common->metaClear().getClearImagePipeline( DxvkMetaClearPipeline pipeInfo = m_common->metaClear().getClearImagePipeline(
imageView->type(), lookupFormatInfo(imageView->info().format)->flags); imageView->type(), lookupFormatInfo(imageView->info().format)->flags);
// Create a descriptor set pointing to the view // Create a descriptor set pointing to the view
VkDescriptorSet descriptorSet = m_descriptorPool->alloc(pipeInfo.dsetLayout); VkDescriptorSet descriptorSet = m_descriptorPool->alloc(pipeInfo.dsetLayout);
@ -3467,17 +3467,12 @@ namespace dxvk {
0, sizeof(pushArgs), &pushArgs); 0, sizeof(pushArgs), &pushArgs);
m_cmd->cmdDispatch(DxvkCmdBuffer::ExecBuffer, m_cmd->cmdDispatch(DxvkCmdBuffer::ExecBuffer,
workgroups.width, workgroups.height, workgroups.depth); workgroups.width, workgroups.height, workgroups.depth);
m_execBarriers.accessImage( accessImage(DxvkCmdBuffer::ExecBuffer,
imageView->image(), *imageView->image(), imageView->imageSubresources(),
imageView->imageSubresources(), VK_IMAGE_LAYOUT_GENERAL, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT,
imageView->image()->info().layout, VK_ACCESS_2_SHADER_WRITE_BIT);
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
VK_ACCESS_SHADER_WRITE_BIT,
imageView->image()->info().layout,
imageView->image()->info().stages,
imageView->image()->info().access);
m_cmd->trackResource<DxvkAccess::Write>(imageView->image()); m_cmd->trackResource<DxvkAccess::Write>(imageView->image());
} }