diff --git a/src/dxgi/dxgi_factory.cpp b/src/dxgi/dxgi_factory.cpp index 695d22ab..4da06672 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 8083b6fd..3a5123a8 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; }