From c1a1ff3915bb8704878d3507ce59090beefb3005 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 21 Mar 2018 04:58:31 +0100 Subject: [PATCH] [d3d11] Implement remaining D3D11.1 feature queries --- src/d3d11/d3d11_device.cpp | 24 +++++++++++++++++++++++- src/d3d11/d3d11_include.h | 7 +++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 6859723f8..bd6fddc74 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -1364,6 +1364,9 @@ namespace dxvk { if (FeatureSupportDataSize != sizeof(D3D11_FEATURE_DATA_THREADING)) return E_INVALIDARG; + // We report native support for command lists here so that we do not actually + // have to re-implement the UpdateSubresource bug from the D3D11 runtime, see + // https://msdn.microsoft.com/en-us/library/windows/desktop/ff476486(v=vs.85).aspx) auto info = static_cast(pFeatureSupportData); info->DriverConcurrentCreates = TRUE; info->DriverCommandLists = TRUE; @@ -1421,8 +1424,27 @@ namespace dxvk { return E_INVALIDARG; auto info = static_cast(pFeatureSupportData); - info->TileBasedDeferredRenderer = false; + info->TileBasedDeferredRenderer = FALSE; } return S_OK; + + case D3D11_FEATURE_SHADER_MIN_PRECISION_SUPPORT: { + if (FeatureSupportDataSize != sizeof(D3D11_FEATURE_DATA_SHADER_MIN_PRECISION_SUPPORT)) + return E_INVALIDARG; + + // Report that we only support full 32-bit operations + auto info = static_cast(pFeatureSupportData); + info->PixelShaderMinPrecision = 0; + info->AllOtherShaderStagesMinPrecision = 0; + } return S_OK; + + case D3D11_FEATURE_D3D9_SHADOW_SUPPORT: { + if (FeatureSupportDataSize != sizeof(D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT)) + return E_INVALIDARG; + + auto info = static_cast(pFeatureSupportData); + info->SupportsDepthAsTextureWithLessEqualComparisonFilter = TRUE; + return S_OK; + } break; default: Logger::err(str::format( diff --git a/src/d3d11/d3d11_include.h b/src/d3d11/d3d11_include.h index 3937df5a9..b173220d0 100644 --- a/src/d3d11/d3d11_include.h +++ b/src/d3d11/d3d11_include.h @@ -63,4 +63,11 @@ typedef struct D3D11_QUERY_DATA_PIPELINE_STATISTICS { typedef struct D3D11_FEATURE_DATA_ARCHITECTURE_INFO { BOOL TileBasedDeferredRenderer; } D3D11_FEATURE_DATA_ARCHITECTURE_INFO; +typedef struct D3D11_FEATURE_DATA_SHADER_MIN_PRECISION_SUPPORT { + UINT PixelShaderMinPrecision; + UINT AllOtherShaderStagesMinPrecision; +} D3D11_FEATURE_DATA_SHADER_MIN_PRECISION_SUPPORT; +typedef struct D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT { + BOOL SupportsDepthAsTextureWithLessEqualComparisonFilter; +} D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT; #endif \ No newline at end of file