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

[d3d9] Fix synchronization after readback

This commit is contained in:
Robin Kertels 2022-02-21 15:03:38 +01:00 committed by Joshie
parent a37cd46491
commit a81c653b42

View File

@ -4228,6 +4228,7 @@ namespace dxvk {
cPackedFormat);
}
});
TrackTextureMappingBufferSequenceNumber(pResource, Subresource);
} else if (!(Flags & D3DLOCK_DONOTWAIT) && !WaitForResource(mappedBuffer, pResource->GetMappingBufferSequenceNumber(Subresource), D3DLOCK_DONOTWAIT)) {
pResource->EnableStagingBufferUploads(Subresource);
}
@ -4589,7 +4590,10 @@ namespace dxvk {
const bool directMapping = pResource->GetMapMode() == D3D9_COMMON_BUFFER_MAP_MODE_DIRECT;
const bool skipWait = (!needsReadback && (usesStagingBuffer || readOnly || (noOverlap && !directMapping))) || noOverwrite;
if (!skipWait) {
if (!(Flags & D3DLOCK_DONOTWAIT) && !WaitForResource(mappingBuffer, pResource->GetMappingBufferSequenceNumber(), D3DLOCK_DONOTWAIT))
if (unlikely(needsReadback)) {
Logger::warn("Buffer readback is unimplemented.");
// Remember to update the sequence number when implementing buffer readback.
} else if (!(Flags & D3DLOCK_DONOTWAIT) && !WaitForResource(mappingBuffer, pResource->GetMappingBufferSequenceNumber(), D3DLOCK_DONOTWAIT))
pResource->EnableStagingBufferUploads();
if (!WaitForResource(mappingBuffer, pResource->GetMappingBufferSequenceNumber(), Flags))