From 8c012e879646b65924817b8dfb75c7073a0b1b02 Mon Sep 17 00:00:00 2001 From: Xinghua Cao Date: Thu, 27 Aug 2020 02:56:05 +0000 Subject: [PATCH] D3D12: fix shader model comparison D3D12_SHADER_MODEL is encoded as 0xMm with M the major version and m the minor version. After decoding D3D12_SHADER_MODEL to a custom shader model format as Mm, which is a decimal value, it's meaningless to compare these two values. Bug: dawn:426 Change-Id: I3eb9a2a1392307616a5ac4d0aa49790bcc363629 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/27300 Reviewed-by: Corentin Wallez Reviewed-by: Jiawei Shao Commit-Queue: Xinghua Cao --- src/dawn_native/d3d12/D3D12Info.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dawn_native/d3d12/D3D12Info.cpp b/src/dawn_native/d3d12/D3D12Info.cpp index e19dd8179b..b2706930ae 100644 --- a/src/dawn_native/d3d12/D3D12Info.cpp +++ b/src/dawn_native/d3d12/D3D12Info.cpp @@ -98,7 +98,7 @@ namespace dawn_native { namespace d3d12 { D3D12_FEATURE_DATA_D3D12_OPTIONS4 featureData4 = {}; if (SUCCEEDED(adapter.GetDevice()->CheckFeatureSupport( D3D12_FEATURE_D3D12_OPTIONS4, &featureData4, sizeof(featureData4)))) { - info.supportsShaderFloat16 = info.shaderModel >= D3D_SHADER_MODEL_6_2 && + info.supportsShaderFloat16 = driverShaderModel >= D3D_SHADER_MODEL_6_2 && featureData4.Native16BitShaderOpsSupported; }