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