From f49065b1e64f5379617fa36207a4e8c30431c9aa Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 29 Oct 2016 08:23:44 -0700 Subject: [PATCH] win-capture: Use IUnknown for getting swap backbuffers Using IDXGIResource doesn't work with D3D12. D3D12 textures are not a subclass of that class. --- plugins/win-capture/graphics-hook/dxgi-capture.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/win-capture/graphics-hook/dxgi-capture.cpp b/plugins/win-capture/graphics-hook/dxgi-capture.cpp index 6580169b3..96f89e76c 100644 --- a/plugins/win-capture/graphics-hook/dxgi-capture.cpp +++ b/plugins/win-capture/graphics-hook/dxgi-capture.cpp @@ -87,12 +87,12 @@ static HRESULT STDMETHODCALLTYPE hook_resize_buffers(IDXGISwapChain *swap, return hr; } -static inline IDXGIResource *get_dxgi_backbuffer(IDXGISwapChain *swap) +static inline IUnknown *get_dxgi_backbuffer(IDXGISwapChain *swap) { IDXGIResource *res = nullptr; HRESULT hr; - hr = swap->GetBuffer(0, __uuidof(ID3D11Resource), (void**)&res); + hr = swap->GetBuffer(0, __uuidof(IUnknown), (void**)&res); if (FAILED(hr)) hlog_hr("get_dxgi_backbuffer: GetBuffer failed", hr); @@ -102,7 +102,7 @@ static inline IDXGIResource *get_dxgi_backbuffer(IDXGISwapChain *swap) static HRESULT STDMETHODCALLTYPE hook_present(IDXGISwapChain *swap, UINT sync_interval, UINT flags) { - IDXGIResource *backbuffer = nullptr; + IUnknown *backbuffer = nullptr; bool capture_overlay = global_hook_info->capture_overlay; bool test_draw = (flags & DXGI_PRESENT_TEST) != 0; bool capture;