nir/print: compact printing of intrinsic indices
Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14222>
This commit is contained in:
parent
d8fa625bb3
commit
f7e63ec5d8
|
@ -830,17 +830,10 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
|
||||||
fprintf(fp, ") (");
|
fprintf(fp, ") (");
|
||||||
|
|
||||||
for (unsigned i = 0; i < info->num_indices; i++) {
|
for (unsigned i = 0; i < info->num_indices; i++) {
|
||||||
|
unsigned idx = info->indices[i];
|
||||||
|
bool print_raw = true;
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
fprintf(fp, ", ");
|
fprintf(fp, ", ");
|
||||||
|
|
||||||
fprintf(fp, "%d", instr->const_index[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(fp, ")");
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < info->num_indices; i++) {
|
|
||||||
unsigned idx = info->indices[i];
|
|
||||||
fprintf(fp, " /*");
|
|
||||||
switch (idx) {
|
switch (idx) {
|
||||||
case NIR_INTRINSIC_WRITE_MASK: {
|
case NIR_INTRINSIC_WRITE_MASK: {
|
||||||
/* special case wrmask to show it as a writemask.. */
|
/* special case wrmask to show it as a writemask.. */
|
||||||
|
@ -1016,11 +1009,14 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
|
||||||
default: {
|
default: {
|
||||||
unsigned off = info->index_map[idx] - 1;
|
unsigned off = info->index_map[idx] - 1;
|
||||||
fprintf(fp, "%s=%d", nir_intrinsic_index_names[idx], instr->const_index[off]);
|
fprintf(fp, "%s=%d", nir_intrinsic_index_names[idx], instr->const_index[off]);
|
||||||
|
print_raw = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(fp, " */");
|
if (print_raw)
|
||||||
|
fprintf(fp, " /*%d*/", instr->const_index[i]);
|
||||||
}
|
}
|
||||||
|
fprintf(fp, ")");
|
||||||
|
|
||||||
if (!state->shader)
|
if (!state->shader)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue