diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 8cca6cc0..b49f207e 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -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);