From 5ddefed02baf56ba65602abe1729acd263f11f13 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 14 Dec 2018 10:22:53 +0000 Subject: [PATCH] Check for shaders being present before doing MSAA<->Array copy --- renderdoc/driver/d3d11/d3d11_msaa_array_conv.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/renderdoc/driver/d3d11/d3d11_msaa_array_conv.cpp b/renderdoc/driver/d3d11/d3d11_msaa_array_conv.cpp index 7649f42e2..94e276917 100644 --- a/renderdoc/driver/d3d11/d3d11_msaa_array_conv.cpp +++ b/renderdoc/driver/d3d11/d3d11_msaa_array_conv.cpp @@ -171,6 +171,12 @@ struct Tex2DMSToArrayStateTracker void D3D11DebugManager::CopyArrayToTex2DMS(ID3D11Texture2D *destMS, ID3D11Texture2D *srcArray, UINT selectedSlice) { + if(!CopyArrayToMSPS) + { + RDCWARN("Can't copy array to MSAA texture, contents will be undefined."); + return; + } + bool singleSliceMode = (selectedSlice != ~0U); D3D11MarkerRegion copy("CopyArrayToTex2DMS"); @@ -508,6 +514,12 @@ void D3D11DebugManager::CopyArrayToTex2DMS(ID3D11Texture2D *destMS, ID3D11Textur void D3D11DebugManager::CopyTex2DMSToArray(ID3D11Texture2D *destArray, ID3D11Texture2D *srcMS) { + if(!CopyMSToArrayPS) + { + RDCWARN("Can't copy array to MSAA texture, contents will be undefined."); + return; + } + // we have to use exclusively the unwrapped context here as this might be happening during // capture and we don't want to serialise any of this work, and the parameters might not exist // as wrapped objects for that reason