From 5cb7f26bb7774f4adf47a916054ecab487574798 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 20 Sep 2019 16:43:01 +0200 Subject: [PATCH] [dxgi] Implement IDXGIOutput5 --- src/dxgi/dxgi_output.cpp | 23 ++++++++++++++++++++--- src/dxgi/dxgi_output.h | 9 ++++++++- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/dxgi/dxgi_output.cpp b/src/dxgi/dxgi_output.cpp index 34008974..4607db19 100644 --- a/src/dxgi/dxgi_output.cpp +++ b/src/dxgi/dxgi_output.cpp @@ -56,7 +56,8 @@ namespace dxvk { || riid == __uuidof(IDXGIOutput1) || riid == __uuidof(IDXGIOutput2) || riid == __uuidof(IDXGIOutput3) - || riid == __uuidof(IDXGIOutput4)) { + || riid == __uuidof(IDXGIOutput4) + || riid == __uuidof(IDXGIOutput5)) { *ppvObject = ref(this); return S_OK; } @@ -416,12 +417,28 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE DxgiOutput::DuplicateOutput( IUnknown* pDevice, IDXGIOutputDuplication** ppOutputDuplication) { + return DuplicateOutput1(pDevice, 0, 0, nullptr, ppOutputDuplication); + } + + + HRESULT STDMETHODCALLTYPE DxgiOutput::DuplicateOutput1( + IUnknown* pDevice, + UINT Flags, + UINT SupportedFormatsCount, + const DXGI_FORMAT* pSupportedFormats, + IDXGIOutputDuplication** ppOutputDuplication) { + InitReturnPtr(ppOutputDuplication); + + if (!pDevice) + return E_INVALIDARG; + static bool s_errorShown = false; if (!std::exchange(s_errorShown, true)) - Logger::warn("DxgiOutput::DuplicateOutput: Stub"); + Logger::err("DxgiOutput::DuplicateOutput1: Not implemented"); - return E_NOTIMPL; + // At least return a valid error code + return DXGI_ERROR_UNSUPPORTED; } diff --git a/src/dxgi/dxgi_output.h b/src/dxgi/dxgi_output.h index 5b2223c4..33e5447c 100644 --- a/src/dxgi/dxgi_output.h +++ b/src/dxgi/dxgi_output.h @@ -24,7 +24,7 @@ namespace dxvk { } - class DxgiOutput : public DxgiObject { + class DxgiOutput : public DxgiObject { public: @@ -101,6 +101,13 @@ namespace dxvk { IUnknown* pDevice, IDXGIOutputDuplication** ppOutputDuplication) final; + HRESULT STDMETHODCALLTYPE DuplicateOutput1( + IUnknown* pDevice, + UINT Flags, + UINT SupportedFormatsCount, + const DXGI_FORMAT* pSupportedFormats, + IDXGIOutputDuplication** ppOutputDuplication) final; + BOOL STDMETHODCALLTYPE SupportsOverlays() final; HRESULT STDMETHODCALLTYPE CheckOverlaySupport(