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 <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Qin Jiajia 2021-05-16 17:11:17 +00:00 committed by Commit Bot service account
parent 53abfc95f4
commit 75de553398
1 changed files with 5 additions and 2 deletions

View File

@ -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,