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
parent
81ab13a2a4
commit
f49065b1e6
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue