win-capture: Use IUnknown for getting swap backbuffers

Using IDXGIResource doesn't work with D3D12.  D3D12 textures are not a
subclass of that class.
master
jp9000 2016-10-29 08:23:44 -07:00
parent 81ab13a2a4
commit f49065b1e6
1 changed files with 3 additions and 3 deletions

View File

@ -87,12 +87,12 @@ static HRESULT STDMETHODCALLTYPE hook_resize_buffers(IDXGISwapChain *swap,
return hr; return hr;
} }
static inline IDXGIResource *get_dxgi_backbuffer(IDXGISwapChain *swap) static inline IUnknown *get_dxgi_backbuffer(IDXGISwapChain *swap)
{ {
IDXGIResource *res = nullptr; IDXGIResource *res = nullptr;
HRESULT hr; HRESULT hr;
hr = swap->GetBuffer(0, __uuidof(ID3D11Resource), (void**)&res); hr = swap->GetBuffer(0, __uuidof(IUnknown), (void**)&res);
if (FAILED(hr)) if (FAILED(hr))
hlog_hr("get_dxgi_backbuffer: GetBuffer 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, static HRESULT STDMETHODCALLTYPE hook_present(IDXGISwapChain *swap,
UINT sync_interval, UINT flags) UINT sync_interval, UINT flags)
{ {
IDXGIResource *backbuffer = nullptr; IUnknown *backbuffer = nullptr;
bool capture_overlay = global_hook_info->capture_overlay; bool capture_overlay = global_hook_info->capture_overlay;
bool test_draw = (flags & DXGI_PRESENT_TEST) != 0; bool test_draw = (flags & DXGI_PRESENT_TEST) != 0;
bool capture; bool capture;