From f021aed31b264b35d5d2fb0a3ced97dc3637f9a4 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 16 Sep 2015 01:12:33 +0200 Subject: [PATCH] Handle unexpected UUIDs in IDXGISwapChain::GetBuffer a bit more nicely * Had some crash reports hitting the assert indicating some other UUID was passed. Most likely is ID3D10Texture2D or similar, which we can't support. Any other just print an error and the UUID. --- renderdoc/driver/dxgi/dxgi_wrapped.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/dxgi/dxgi_wrapped.cpp b/renderdoc/driver/dxgi/dxgi_wrapped.cpp index b3cd1f0c1..24c5c58a8 100644 --- a/renderdoc/driver/dxgi/dxgi_wrapped.cpp +++ b/renderdoc/driver/dxgi/dxgi_wrapped.cpp @@ -379,9 +379,20 @@ HRESULT WrappedIDXGISwapChain2::GetBuffer( { if(ppSurface == NULL) return E_INVALIDARG; - HRESULT ret = m_pReal->GetBuffer(Buffer, riid, ppSurface); + if(riid == __uuidof(ID3D10Texture2D) || riid == __uuidof(ID3D10Resource)) + { + RDCERR("Querying swapchain buffers via D3D10 interface UUIDs is not supported"); + return E_NOINTERFACE; + } + else if(riid != __uuidof(ID3D11Texture2D) && riid == __uuidof(ID3D11Resource)) + { + RDCERR("Unsupported or unrecognised UUID passed to IDXGISwapChain::GetBuffer - %s", ToStr::Get(riid).c_str()); + return E_NOINTERFACE; + } RDCASSERT(riid == __uuidof(ID3D11Texture2D) || riid == __uuidof(ID3D11Resource)); + + HRESULT ret = m_pReal->GetBuffer(Buffer, riid, ppSurface); ID3D11Texture2D *realSurface = (ID3D11Texture2D *)*ppSurface; ID3D11Texture2D *tex = realSurface;