mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
nir: print i/o variables in location order
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25036>
This commit is contained in:
parent
cdcb2ab538
commit
6ae2147dd6
1 changed files with 19 additions and 3 deletions
|
|
@ -2620,10 +2620,26 @@ nir_print_shader_annotated(nir_shader *shader, FILE *fp,
|
|||
if (shader->constant_data_size)
|
||||
fprintf(fp, "constants: %u\n", shader->constant_data_size);
|
||||
for (unsigned i = 0; i < nir_num_variable_modes; i++) {
|
||||
if (BITFIELD_BIT(i) == nir_var_function_temp)
|
||||
nir_variable_mode mode = BITFIELD_BIT(i);
|
||||
if (mode == nir_var_function_temp)
|
||||
continue;
|
||||
nir_foreach_variable_with_modes(var, shader, BITFIELD_BIT(i))
|
||||
print_var_decl(var, &state);
|
||||
|
||||
if (mode == nir_var_shader_in || mode == nir_var_shader_out) {
|
||||
for (unsigned j = 0; j < 128; j++) {
|
||||
nir_variable *vars[NIR_MAX_VEC_COMPONENTS] = {0};
|
||||
nir_foreach_variable_with_modes(var, shader, mode) {
|
||||
if (var->data.location == j)
|
||||
vars[var->data.location_frac] = var;
|
||||
}
|
||||
for (unsigned j = 0; j < ARRAY_SIZE(vars); j++)
|
||||
if (vars[j]) {
|
||||
print_var_decl(vars[j], &state);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
nir_foreach_variable_with_modes(var, shader, mode)
|
||||
print_var_decl(var, &state);
|
||||
}
|
||||
}
|
||||
|
||||
foreach_list_typed(nir_function, func, node, &shader->functions) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue