From 36d8bb77a596c42c44d0b4f6782d72209e1d5c31 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Mon, 8 Aug 2022 23:46:10 +0200 Subject: [PATCH] [d3d9] Fix synchronization in UpdateTextureFromBuffer --- src/d3d9/d3d9_device.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index b078f660..4d445514 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -4427,6 +4427,12 @@ namespace dxvk { auto convertFormat = pDestTexture->GetFormatMapping().ConversionFormatInfo; + if (unlikely(pSrcTexture->NeedsReadback(SrcSubresource))) { + const Rc& buffer = pSrcTexture->GetBuffer(SrcSubresource, false); + WaitForResource(buffer, pSrcTexture->GetMappingBufferSequenceNumber(SrcSubresource), 0); + pSrcTexture->SetNeedsReadback(SrcSubresource, false); + } + if (likely(convertFormat.FormatType == D3D9ConversionFormat_None)) { VkOffset3D alignedDestOffset = { int32_t(alignDown(DestOffset.x, formatInfo->blockSize.width)),