[d3d9] Fix behavior on multiple image unlocks

This commit is contained in:
WinterSnowfall 2024-11-19 21:58:15 +02:00
parent 4b3b691332
commit 90382259c1
No known key found for this signature in database

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);