From 3e8a6ec46307447a855da3c8e05da71eb6a43498 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 19 Sep 2019 16:38:01 +0200 Subject: [PATCH] [dxgi] Implement IDXGIFactory5 --- src/dxgi/dxgi_factory.cpp | 26 ++++++++++++++++++++++++-- src/dxgi/dxgi_factory.h | 9 +++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/dxgi/dxgi_factory.cpp b/src/dxgi/dxgi_factory.cpp index 695d22abd..4da066722 100644 --- a/src/dxgi/dxgi_factory.cpp +++ b/src/dxgi/dxgi_factory.cpp @@ -30,7 +30,8 @@ namespace dxvk { || riid == __uuidof(IDXGIFactory1) || riid == __uuidof(IDXGIFactory2) || riid == __uuidof(IDXGIFactory3) - || riid == __uuidof(IDXGIFactory4)) { + || riid == __uuidof(IDXGIFactory4) + || riid == __uuidof(IDXGIFactory5)) { *ppvObject = ref(this); return S_OK; } @@ -310,5 +311,26 @@ namespace dxvk { UINT STDMETHODCALLTYPE DxgiFactory::GetCreationFlags() { return m_flags; } - + + + HRESULT STDMETHODCALLTYPE DxgiFactory::CheckFeatureSupport( + DXGI_FEATURE Feature, + void* pFeatureSupportData, + UINT FeatureSupportDataSize) { + switch (Feature) { + case DXGI_FEATURE_PRESENT_ALLOW_TEARING: { + auto info = static_cast(pFeatureSupportData); + + if (FeatureSupportDataSize != sizeof(*info)) + return E_INVALIDARG; + + *info = TRUE; + } return S_OK; + + default: + Logger::err(str::format("DxgiFactory: CheckFeatureSupport: Unknown feature: ", uint32_t(Feature))); + return E_INVALIDARG; + } + } + } diff --git a/src/dxgi/dxgi_factory.h b/src/dxgi/dxgi_factory.h index 8083b6fde..3a5123a8c 100644 --- a/src/dxgi/dxgi_factory.h +++ b/src/dxgi/dxgi_factory.h @@ -10,7 +10,7 @@ namespace dxvk { - class DxgiFactory : public DxgiObject { + class DxgiFactory : public DxgiObject { public: @@ -112,7 +112,12 @@ namespace dxvk { DWORD dwCookie) final; UINT STDMETHODCALLTYPE GetCreationFlags() final; - + + HRESULT STDMETHODCALLTYPE CheckFeatureSupport( + DXGI_FEATURE Feature, + void* pFeatureSupportData, + UINT FeatureSupportDataSize) final; + const DxgiOptions* GetOptions() const { return &m_options; }