[PATCH] dlls/dxgi: Implement IDXGIFactory5::CheckFeatureSupport.
Enables certain D3D12 games to use sync off, since they gate their use of swap_interval == 0 on this feature being present. Signed-off-by: Hans-Kristian Arntzen <post(a)arntzen-software.no> --- dlls/dxgi/factory.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 3f41df9e36..62148adf20 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -445,10 +445,21 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumWarpAdapter(IWineDXGIFactory * static HRESULT STDMETHODCALLTYPE dxgi_factory_CheckFeatureSupport(IWineDXGIFactory *iface, DXGI_FEATURE feature, void *feature_data, UINT data_size) { - FIXME("iface %p, feature %#x, feature_data %p, data_size %u stub!\n", + TRACE("iface %p, feature %#x, feature_data %p, data_size %u.\n", iface, feature, feature_data, data_size); - return E_NOTIMPL; + if (feature == DXGI_FEATURE_PRESENT_ALLOW_TEARING) + { + if (data_size == sizeof(BOOL)) + { + *(BOOL *)feature_data = TRUE; + return S_OK; + } + else + return DXGI_ERROR_INVALID_CALL; + } + else + return DXGI_ERROR_UNSUPPORTED; } static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl = -- 2.26.0
On 3/31/20 7:19 PM, Hans-Kristian Arntzen wrote:
Enables certain D3D12 games to use sync off, since they gate their use of swap_interval == 0 on this feature being present.
Signed-off-by: Hans-Kristian Arntzen <post(a)arntzen-software.no> --- dlls/dxgi/factory.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 3f41df9e36..62148adf20 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -445,10 +445,21 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumWarpAdapter(IWineDXGIFactory * static HRESULT STDMETHODCALLTYPE dxgi_factory_CheckFeatureSupport(IWineDXGIFactory *iface, DXGI_FEATURE feature, void *feature_data, UINT data_size) { - FIXME("iface %p, feature %#x, feature_data %p, data_size %u stub!\n", + TRACE("iface %p, feature %#x, feature_data %p, data_size %u.\n", iface, feature, feature_data, data_size);
Hi, It looks good generally. It's would be better to use a switch statement rather than a if because there are other features. You can add some basic validity checks for other parameters as well. And adding a test should be easy. Thanks, Zhiyi
- return E_NOTIMPL; + if (feature == DXGI_FEATURE_PRESENT_ALLOW_TEARING) + { + if (data_size == sizeof(BOOL)) + { + *(BOOL *)feature_data = TRUE; + return S_OK; + } + else + return DXGI_ERROR_INVALID_CALL; Here I prefer checking data_size != sizeof(BOOL) and return early. + } + else + return DXGI_ERROR_UNSUPPORTED; }
static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl =
April 1, 2020 10:14 AM, "Zhiyi Zhang" <zzhang(a)codeweavers.com> wrote:
It's would be better to use a switch statement rather than a if because there are other features.
What other features? The only one in the header, and the only one documented, is DXGI_FEATURE_PRESENT_ALLOW_TEARING. Chip
On 4/2/20 1:42 AM, Chip Davis wrote:
April 1, 2020 10:14 AM, "Zhiyi Zhang" <zzhang(a)codeweavers.com> wrote:
It's would be better to use a switch statement rather than a if because there are other features. What other features? The only one in the header, and the only one documented, is DXGI_FEATURE_PRESENT_ALLOW_TEARING.
Chip Sorry. You're right. Turns out I was mixing ID3D12Device::CheckFeatureSupport and IDXGIFactory5::CheckFeatureSupport.
participants (3)
-
Chip Davis -
Hans-Kristian Arntzen -
Zhiyi Zhang