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:
baldurk
2015-09-16 01:12:33 +02:00
parent c18b1547ac
commit f021aed31b
+12 -1
View File
@@ -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;