From 75de5533986817fb5d300154386e0137ea16c1f2 Mon Sep 17 00:00:00 2001 From: Qin Jiajia Date: Sun, 16 May 2021 17:11:17 +0000 Subject: [PATCH] Use the device maximum supported shader model Use the device maximum supported shader model for DXC compiler. Bug: None Change-Id: I05f66d499405a3512a43daca35bb20be84f1f6c5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51080 Commit-Queue: Corentin Wallez Reviewed-by: Austin Eng Reviewed-by: Rafael Cintron Reviewed-by: Corentin Wallez --- src/dawn_native/d3d12/ShaderModuleD3D12.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp index c554dacb5a..00cbc36fde 100644 --- a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp +++ b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp @@ -314,12 +314,15 @@ namespace dawn_native { namespace d3d12 { options_glsl.force_zero_initialized_variables = true; spirv_cross::CompilerHLSL::Options options_hlsl; - if (GetDevice()->IsExtensionEnabled(Extension::ShaderFloat16)) { + if (GetDevice()->IsToggleEnabled(Toggle::UseDXC)) { options_hlsl.shader_model = ToBackend(GetDevice())->GetDeviceInfo().shaderModel; - options_hlsl.enable_16bit_types = true; } else { options_hlsl.shader_model = 51; } + + if (GetDevice()->IsExtensionEnabled(Extension::ShaderFloat16)) { + options_hlsl.enable_16bit_types = true; + } // PointCoord and PointSize are not supported in HLSL // TODO (hao.x.li@intel.com): The point_coord_compat and point_size_compat are // required temporarily for https://bugs.chromium.org/p/dawn/issues/detail?id=146,