From 54c45ef3fafb2fdfbbb2ee18e9ac50d518ec636c Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 3 Nov 2024 10:57:47 +0100 Subject: [PATCH] [dxvk] Fix when tracking happens in resource relocation Invalidation now resets tracking, so it is possible that after recreating an image with different usage we'd use it on the wrong command buffer for certain functions. --- src/dxvk/dxvk_context.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index ebb0f6080..6e00dde40 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -6397,11 +6397,11 @@ namespace dxvk { copy.regionCount = 1; copy.pRegions = ®ion; + invalidateBuffer(info.buffer, Rc(info.storage)); + m_cmd->cmdCopyBuffer(DxvkCmdBuffer::ExecBuffer, ©); m_cmd->track(info.buffer, DxvkAccess::Write); - invalidateBuffer(info.buffer, Rc(info.storage)); - memoryBarrier.dstStageMask |= info.buffer->info().stages; memoryBarrier.dstAccessMask |= info.buffer->info().access; } @@ -6493,10 +6493,10 @@ namespace dxvk { copy.regionCount = imageRegions.size(); copy.pRegions = imageRegions.data(); + invalidateImageWithUsage(info.image, Rc(info.storage), info.usageInfo); + m_cmd->cmdCopyImage(DxvkCmdBuffer::ExecBuffer, ©); m_cmd->track(info.image, DxvkAccess::Write); - - invalidateImageWithUsage(info.image, Rc(info.storage), info.usageInfo); } if (!imageBarriers.empty()) {