diff options
author | Jesse Natalie <jenatali@microsoft.com> | 2024-03-31 11:14:27 -0700 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-04-04 20:29:10 +0000 |
commit | b6b5514a5bee0cd8baaa43a276c2825e17932fee (patch) | |
tree | d05a62834198251526884dc6ca4df0bf01c58475 /src/microsoft | |
parent | c37e9c1e293159990c5e5ebd88aadac431275274 (diff) |
microsoft/compiler: When sorting variables, put unused variables last
These variables will only be used for xfb
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28535>
Diffstat (limited to 'src/microsoft')
-rw-r--r-- | src/microsoft/compiler/dxil_nir.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/microsoft/compiler/dxil_nir.c b/src/microsoft/compiler/dxil_nir.c index 51943f98a5f..dba218ca7b5 100644 --- a/src/microsoft/compiler/dxil_nir.c +++ b/src/microsoft/compiler/dxil_nir.c @@ -1595,8 +1595,9 @@ dxil_sort_ps_outputs(nir_shader* s) enum dxil_sysvalue_type { DXIL_NO_SYSVALUE = 0, DXIL_USED_SYSVALUE, + DXIL_UNUSED_NO_SYSVALUE, DXIL_SYSVALUE, - DXIL_GENERATED_SYSVALUE + DXIL_GENERATED_SYSVALUE, }; static enum dxil_sysvalue_type @@ -1619,6 +1620,9 @@ nir_var_to_dxil_sysvalue_type(nir_variable *var, uint64_t other_stage_mask) return DXIL_SYSVALUE; return DXIL_USED_SYSVALUE; default: + if (var->data.location < VARYING_SLOT_PATCH0 && + !((1ull << var->data.location) & other_stage_mask)) + return DXIL_UNUSED_NO_SYSVALUE; return DXIL_NO_SYSVALUE; } } |