From 1cc531eaf8002cef3e9707cdc3398f45909e38d2 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 5 Jul 2019 10:25:06 +0200 Subject: [PATCH] [d3d11] Return error when mapping an already mapped image Final Fantasy XIV does this. Should avoid some unnecessary work. --- src/d3d11/d3d11_context_imm.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index d164f4c03..461dad65b 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -334,6 +334,9 @@ namespace dxvk { if (unlikely(Subresource >= pResource->CountSubresources())) return E_INVALIDARG; + if (unlikely(pResource->GetMapType(Subresource) != D3D11_MAP(~0u))) + return E_OUTOFMEMORY; + pResource->SetMapType(Subresource, MapType); VkFormat packedFormat = m_parent->LookupPackedFormat(