From 1c77f6d27e2ff8ec17ce7873d401d307ba319eb0 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sun, 14 Sep 2014 17:10:34 +0100 Subject: [PATCH] In GetTextureData() handle MS textures as if they were arrays * Client code is expected to handle this and request arrayIdx N for the Nth sample (possibly offset if it's an array of MS textures). --- renderdoc/driver/d3d11/d3d11_analyse.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/d3d11/d3d11_analyse.cpp b/renderdoc/driver/d3d11/d3d11_analyse.cpp index 7b9ec27e1..eddb83f80 100644 --- a/renderdoc/driver/d3d11/d3d11_analyse.cpp +++ b/renderdoc/driver/d3d11/d3d11_analyse.cpp @@ -2074,6 +2074,17 @@ byte *D3D11DebugManager::GetTextureData(ResourceId id, uint32_t arrayIdx, uint32 desc.MiscFlags = 0; desc.Usage = D3D11_USAGE_STAGING; + bool wasms = false; + + if(desc.SampleDesc.Count > 1) + { + desc.ArraySize *= desc.SampleDesc.Count; + desc.SampleDesc.Count = 1; + desc.SampleDesc.Quality = 0; + + wasms = true; + } + ID3D11Texture2D *d = NULL; mips = desc.MipLevels ? desc.MipLevels : CalcNumMips(desc.Width, desc.Height, 1); @@ -2094,7 +2105,10 @@ byte *D3D11DebugManager::GetTextureData(ResourceId id, uint32_t arrayIdx, uint32 bytesize = GetByteSize(desc.Width, desc.Height, 1, desc.Format, mip); - m_pImmediateContext->CopyResource(UNWRAP(WrappedID3D11Texture2D, d), wrapTex->GetReal()); + if(wasms) + CopyTex2DMSToArray(UNWRAP(WrappedID3D11Texture2D, d), wrapTex->GetReal()); + else + m_pImmediateContext->CopyResource(UNWRAP(WrappedID3D11Texture2D, d), wrapTex->GetReal()); } else if(WrappedID3D11Texture3D::m_TextureList.find(id) != WrappedID3D11Texture3D::m_TextureList.end()) {