Skip to content

Commit

Permalink
[d3d9] Fail GetRTData if src and dst have mismatching sizes
Browse files Browse the repository at this point in the history
MySims tries to do this and needs this to fail,
otherwise mouse picking is off.
  • Loading branch information
K0bin committed Feb 5, 2024
1 parent 5312ef1 commit 08f9170
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/d3d9/d3d9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,17 @@ namespace dxvk {
if (srcTexInfo->Desc()->Format != dstTexInfo->Desc()->Format)
return D3DERR_INVALIDCALL;

D3DSURFACE_DESC srcSurfDesc;
D3DSURFACE_DESC dstSurfDesc;
if (unlikely(src->GetDesc(&srcSurfDesc) != D3D_OK)) {
return D3DERR_INVALIDCALL;
}
if (unlikely(dst->GetDesc(&dstSurfDesc) != D3D_OK)) {
return D3DERR_INVALIDCALL;
}
if (srcSurfDesc.Width != dstSurfDesc.Width || srcSurfDesc.Height != dstSurfDesc.Height)
return D3DERR_INVALIDCALL;

if (dstTexInfo->Desc()->Pool == D3DPOOL_DEFAULT)
return this->StretchRect(pRenderTarget, nullptr, pDestSurface, nullptr, D3DTEXF_NONE);

Expand Down

0 comments on commit 08f9170

Please sign in to comment.