From: Jesse Natalie Date: Thu, 11 Aug 2022 16:38:45 +0000 (-0700) Subject: microsoft/compiler: Support up to shader model 6.5 X-Git-Tag: upstream/22.3.5~4253 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4b964b546405fe3d9009fe3e19ab1e453251f63;p=platform%2Fupstream%2Fmesa.git microsoft/compiler: Support up to shader model 6.5 We don't actually use any of the new features, but that's okay, it's still valid DXIL at the higher shader models. Reviewed-by: Giancarlo Devich Reviewed-by: Boris Brezillon Part-of: --- diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 1bf294b..0dc79ac 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -5807,6 +5807,8 @@ type_size_vec4(const struct glsl_type *type, bool bindless) static const unsigned dxil_validator_min_capable_version = DXIL_VALIDATOR_1_4; static const unsigned dxil_validator_max_capable_version = DXIL_VALIDATOR_1_7; +static const unsigned dxil_min_shader_model = SHADER_MODEL_6_1; +static const unsigned dxil_max_shader_model = SHADER_MODEL_6_5; bool nir_to_dxil(struct nir_shader *s, const struct nir_to_dxil_options *opts, @@ -5817,13 +5819,17 @@ nir_to_dxil(struct nir_shader *s, const struct nir_to_dxil_options *opts, debug_dxil = (int)debug_get_option_debug_dxil(); blob_init(blob); - if (opts->shader_model_max < SHADER_MODEL_6_1) { - debug_printf("D3D12: cannot support emitting shader model 6.0 or lower\n"); + if (opts->shader_model_max < dxil_min_shader_model) { + debug_printf("D3D12: cannot support emitting shader models lower than %d.%d\n", + dxil_min_shader_model >> 16, + dxil_min_shader_model & 0xffff); return false; } - if (opts->shader_model_max > SHADER_MODEL_6_2) { - debug_printf("D3D12: cannot support emitting higher than shader model 6.2\n"); + if (opts->shader_model_max > dxil_max_shader_model) { + debug_printf("D3D12: cannot support emitting higher than shader model %d.%d\n", + dxil_max_shader_model >> 16, + dxil_max_shader_model & 0xffff); return false; } diff --git a/src/microsoft/compiler/nir_to_dxil.h b/src/microsoft/compiler/nir_to_dxil.h index dc8228c..80a593e 100644 --- a/src/microsoft/compiler/nir_to_dxil.h +++ b/src/microsoft/compiler/nir_to_dxil.h @@ -85,6 +85,9 @@ enum dxil_shader_model { SHADER_MODEL_6_0 = 0x60000, SHADER_MODEL_6_1, SHADER_MODEL_6_2, + SHADER_MODEL_6_3, + SHADER_MODEL_6_4, + SHADER_MODEL_6_5, }; struct nir_to_dxil_options {