nir: rename nir_lower_io_to_temporaries -> nir_lower_io_vars_to_temporaries

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35760>
This commit is contained in:
Marek Olšák
2025-06-25 19:05:19 -04:00
committed by Marge Bot
parent 1e03827c77
commit 1754507d49
38 changed files with 67 additions and 67 deletions
+1 -1
View File
@@ -1326,7 +1326,7 @@ preprocess_shader(const struct gl_constants *consts,
(nir->info.outputs_written & (VARYING_BIT_CLIP_DIST0 | VARYING_BIT_CLIP_DIST1)))
NIR_PASS(_, nir, gl_nir_zero_initialize_clip_distance);
NIR_PASS(_, nir, nir_lower_io_to_temporaries,
NIR_PASS(_, nir, nir_lower_io_vars_to_temporaries,
nir_shader_get_entrypoint(nir), true,
options->lower_all_io_to_temps ||
nir->info.stage == MESA_SHADER_VERTEX ||
+1 -1
View File
@@ -188,7 +188,7 @@ else
'nir_lower_int_to_float.c',
'nir_lower_io.c',
'nir_lower_io_array_vars_to_elements.c',
'nir_lower_io_to_temporaries.c',
'nir_lower_io_vars_to_temporaries.c',
'nir_lower_io_to_scalar.c',
'nir_lower_io_vars_to_scalar.c',
'nir_lower_is_helper_invocation.c',
+4 -4
View File
@@ -480,7 +480,7 @@ typedef struct nir_variable {
/**
* Can this variable be coalesced with another?
*
* This is set by nir_lower_io_to_temporaries to say that any
* This is set by nir_lower_io_vars_to_temporaries to say that any
* copies involving this variable should stay put. Propagating it can
* duplicate the resulting load/store, which is not wanted, and may
* result in a load/store of the variable with an indirect offset which
@@ -4934,9 +4934,9 @@ bool nir_lower_indirect_var_derefs(nir_shader *shader,
bool nir_lower_locals_to_regs(nir_shader *shader, uint8_t bool_bitsize);
bool nir_lower_io_to_temporaries(nir_shader *shader,
nir_function_impl *entrypoint,
bool outputs, bool inputs);
bool nir_lower_io_vars_to_temporaries(nir_shader *shader,
nir_function_impl *entrypoint,
bool outputs, bool inputs);
bool nir_lower_vars_to_scratch(nir_shader *shader,
nir_variable_mode modes,
@@ -26,7 +26,7 @@
* intrinsics, and resets the offset source to 0. Non-constant offsets remain
* unchanged - since we don't know what part of a compound variable is
* accessed, we allocate storage for the entire thing. For drivers that use
* nir_lower_io_to_temporaries() before nir_lower_io(), this guarantees that
* nir_lower_io_vars_to_temporaries() before nir_lower_io(), this guarantees that
* the offset source will be 0, so that they don't have to add it in manually.
*/
+5 -5
View File
@@ -630,7 +630,7 @@ lower_interpolate_at(nir_intrinsic_instr *intrin, struct lower_io_state *state,
static nir_def *
uncompact_view_index(nir_builder *b, nir_src compact_index_src)
{
/* We require nir_lower_io_to_temporaries when using absolute view indices,
/* We require nir_lower_io_vars_to_temporaries when using absolute view indices,
* which ensures index is constant */
assert(nir_src_is_const(compact_index_src));
unsigned compact_index = nir_src_as_uint(compact_index_src);
@@ -1039,7 +1039,7 @@ nir_lower_io_passes(nir_shader *nir, bool renumber_vs_inputs)
nir->xfb_info == NULL;
/* TODO: Sorting variables by location is required due to some bug
* in nir_lower_io_to_temporaries. If variables are not sorted,
* in nir_lower_io_vars_to_temporaries. If variables are not sorted,
* dEQP-GLES31.functional.separate_shader.random.0 fails.
*
* This isn't needed if nir_assign_io_var_locations is called because it
@@ -1052,7 +1052,7 @@ nir_lower_io_passes(nir_shader *nir, bool renumber_vs_inputs)
nir_sort_variables_by_location(nir, varying_var_mask);
if (!has_indirect_inputs || !has_indirect_outputs) {
NIR_PASS(_, nir, nir_lower_io_to_temporaries,
NIR_PASS(_, nir, nir_lower_io_vars_to_temporaries,
nir_shader_get_entrypoint(nir), !has_indirect_outputs,
!has_indirect_inputs);
@@ -1063,8 +1063,8 @@ nir_lower_io_passes(nir_shader *nir, bool renumber_vs_inputs)
NIR_PASS(_, nir, nir_lower_var_copies);
NIR_PASS(_, nir, nir_lower_global_vars_to_local);
/* This is partially redundant with nir_lower_io_to_temporaries.
* The problem is that nir_lower_io_to_temporaries doesn't handle TCS.
/* This is partially redundant with nir_lower_io_vars_to_temporaries.
* The problem is that nir_lower_io_vars_to_temporaries doesn't handle TCS.
*/
if (nir->info.stage == MESA_SHADER_TESS_CTRL) {
NIR_PASS(_, nir, nir_lower_indirect_derefs,
@@ -331,8 +331,8 @@ move_variables_to_list(nir_shader *shader, nir_variable_mode mode,
}
bool
nir_lower_io_to_temporaries(nir_shader *shader, nir_function_impl *entrypoint,
bool outputs, bool inputs)
nir_lower_io_vars_to_temporaries(nir_shader *shader, nir_function_impl *entrypoint,
bool outputs, bool inputs)
{
struct lower_io_state state;
+1 -1
View File
@@ -11,7 +11,7 @@
* we know that it will never cause clipping/culling.
* Remove the sysval_output in that case.
*
* Assumes that nir_lower_io_to_temporaries was run,
* Assumes that nir_lower_io_vars_to_temporaries was run,
* and works best with scalar store_outputs.
*/
+3 -3
View File
@@ -30,7 +30,7 @@
*
* Merges compatible input/output variables residing in different components
* of the same location. It's expected that further passes such as
* nir_lower_io_to_temporaries will combine loads and stores of the merged
* nir_lower_io_vars_to_temporaries will combine loads and stores of the merged
* variables, producing vector nir_load_input/nir_store_output instructions
* when all is said and done.
*/
@@ -436,7 +436,7 @@ nir_opt_vectorize_io_vars_impl(nir_function_impl *impl, nir_variable_mode modes)
/* Actually lower all the IO load/store intrinsics. Load instructions are
* lowered to a vector load and an ALU instruction to grab the channels we
* want. Outputs are lowered to a write-masked store of the vector output.
* For non-TCS outputs, we then run nir_lower_io_to_temporaries at the end
* For non-TCS outputs, we then run nir_lower_io_vars_to_temporaries at the end
* to clean up the partial writes.
*/
nir_foreach_block(block, impl) {
@@ -567,7 +567,7 @@ nir_opt_vectorize_io_vars_impl(nir_function_impl *impl, nir_variable_mode modes)
}
/* Demote the old var to a global, so that things like
* nir_lower_io_to_temporaries() don't trigger on it.
* nir_lower_io_vars_to_temporaries() don't trigger on it.
*/
util_dynarray_foreach(&demote_vars, nir_variable *, varp) {
(*varp)->data.mode = nir_var_shader_temp;
+1 -1
View File
@@ -580,7 +580,7 @@ validate_intrinsic_instr(nir_intrinsic_instr *instr, validate_state *state)
* good to validate here that no new copy derefs were added. Right now
* we can't as there are some specific cases where copies are added even
* after the lowering. One example is the Intel compiler, that calls
* nir_lower_io_to_temporaries when linking some shader stages.
* nir_lower_io_vars_to_temporaries when linking some shader stages.
*/
break;
}