From a4848201f82514789ac4e122ad20abc0ad2e042c Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 11 Aug 2022 13:13:02 +0200 Subject: [PATCH] [dxvk] Update buffer views in commitGraphicsBarriers Otherwise we might end up accessing stale buffer slices, since this happens before descriptor updates. This is not needed for compute. Also fix weird indentation while we're at it. --- src/dxvk/dxvk_context.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 2f5460026..6486d2671 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -5580,8 +5580,8 @@ namespace dxvk { case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: if ((slot.bufferSlice.length()) && (slot.bufferSlice.bufferInfo().access & storageBufferAccess)) { - requiresBarrier = this->checkBufferBarrier(slot.bufferSlice, - util::pipelineStages(binding.stages), binding.access); + requiresBarrier = this->checkBufferBarrier(slot.bufferSlice, + util::pipelineStages(binding.stages), binding.access); } break; @@ -5589,8 +5589,9 @@ namespace dxvk { case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: if ((slot.bufferView != nullptr) && (slot.bufferView->bufferInfo().access & storageBufferAccess)) { - requiresBarrier = this->checkBufferViewBarrier(slot.bufferView, - util::pipelineStages(binding.stages), binding.access); + slot.bufferView->updateView(); + requiresBarrier = this->checkBufferViewBarrier(slot.bufferView, + util::pipelineStages(binding.stages), binding.access); } break; @@ -5599,8 +5600,8 @@ namespace dxvk { case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: if ((slot.imageView != nullptr) && (slot.imageView->imageInfo().access & storageImageAccess)) { - requiresBarrier = this->checkImageViewBarrier(slot.imageView, - util::pipelineStages(binding.stages), binding.access); + requiresBarrier = this->checkImageViewBarrier(slot.imageView, + util::pipelineStages(binding.stages), binding.access); } break;