From 19b76825d0f8fb1c4c95f411c7880fa267d693ac Mon Sep 17 00:00:00 2001 From: Krzysztof Dobrowolski Date: Wed, 24 Aug 2022 11:29:16 +0200 Subject: [PATCH] [d3d9] Fix for missing restriction check in UpdateSurface. The spec of IDirect3DDevice9::UpdateSurface contains the following restriction: - Neither surface can be created with multisampling. The only valid flag for both surfaces is D3DMULTISAMPLE_NONE. This commit adds this check and returns D3DERR_INVALIDCALL when source or destination surfaces are multisampled. --- src/d3d9/d3d9_device.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index a90bc5e5b..cbe5404f2 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -746,6 +746,12 @@ namespace dxvk { if (unlikely(srcTextureInfo->Desc()->Format != dstTextureInfo->Desc()->Format)) return D3DERR_INVALIDCALL; + if (unlikely(srcTextureInfo->Desc()->MultiSample != D3DMULTISAMPLE_NONE)) + return D3DERR_INVALIDCALL; + + if (unlikely(dstTextureInfo->Desc()->MultiSample != D3DMULTISAMPLE_NONE)) + return D3DERR_INVALIDCALL; + const DxvkFormatInfo* formatInfo = lookupFormatInfo(dstTextureInfo->GetFormatMapping().FormatColor); VkOffset3D srcOffset = { 0u, 0u, 0u };