From 170ba62bcfc770d8bf94cf4066e7c6b848f3a463 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 27 May 2024 10:13:05 +0100 Subject: [PATCH] Handle calling GetDevice for a dxgi device on a swapchain --- renderdoc/driver/dxgi/dxgi_wrapped.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/renderdoc/driver/dxgi/dxgi_wrapped.cpp b/renderdoc/driver/dxgi/dxgi_wrapped.cpp index 75761d211..2bc60dc4e 100644 --- a/renderdoc/driver/dxgi/dxgi_wrapped.cpp +++ b/renderdoc/driver/dxgi/dxgi_wrapped.cpp @@ -529,6 +529,12 @@ HRESULT WrappedIDXGISwapChain4::GetDevice( *ppDevice = this; AddRef(); } + else if(riid == __uuidof(IDXGIDevice) || riid == __uuidof(IDXGIDevice1) || + riid == __uuidof(IDXGIDevice2) || riid == __uuidof(IDXGIDevice3) || + riid == __uuidof(IDXGIDevice4)) + { + return m_pDevice->QueryInterface(riid, ppDevice); + } else if(!HandleWrap("GetDevice", riid, ppDevice)) { // can probably get away with returning the real result here,