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

[d3d9] Fix behavior on multiple image unlocks

This commit is contained in:
WinterSnowfall 2024-11-19 21:58:15 +02:00 committed by Robin Kertels
parent bb227fa850
commit 77020760f1

View File

@ -4980,9 +4980,13 @@ namespace dxvk {
UINT Subresource = pResource->CalcSubresource(Face, MipLevel);
// We weren't locked anyway!
if (unlikely(!pResource->GetLocked(Subresource)))
return D3D_OK;
// Don't allow multiple unlockings, except for D3DRTYPE_TEXTURE
if (unlikely(!pResource->GetLocked(Subresource))) {
if (pResource->GetType() == D3DRTYPE_TEXTURE)
return D3D_OK;
else
return D3DERR_INVALIDCALL;
}
MapTexture(pResource, Subresource); // Add it to the list of mapped resources
pResource->SetLocked(Subresource, false);