mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user