mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 06:20:09 +01:00
pan/mdg: Print constant vectors less wrong
For !32-bit types, we need to pay attention to rep_low/high/half to determine the effective swizzle. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>
This commit is contained in:
parent
cd26bd9425
commit
b833702cc1
1 changed files with 13 additions and 5 deletions
|
|
@ -365,10 +365,7 @@ print_vector_constants(FILE *fp, unsigned src_binary,
|
|||
comp_mask = effective_writemask(alu, condense_writemask(alu->mask, bits));
|
||||
num_comp = util_bitcount(comp_mask);
|
||||
|
||||
fprintf(fp, "#");
|
||||
if (num_comp > 1)
|
||||
fprintf(fp, "vec%d(", num_comp);
|
||||
|
||||
fprintf(fp, "<");
|
||||
bool first = true;
|
||||
|
||||
for (unsigned i = 0; i < max_comp; ++i) {
|
||||
|
|
@ -376,6 +373,17 @@ print_vector_constants(FILE *fp, unsigned src_binary,
|
|||
|
||||
unsigned c = (src->swizzle >> (i * 2)) & 3;
|
||||
|
||||
if (bits == 16 && !src->half) {
|
||||
if (i < 4)
|
||||
c += (src->rep_high * 4);
|
||||
else
|
||||
c += (!src->rep_low * 4);
|
||||
} else if (bits == 32 && !src->half) {
|
||||
/* Implicitly ok */
|
||||
} else {
|
||||
printf(" (%d%d%d)", src->rep_low, src->rep_high, src->half);
|
||||
}
|
||||
|
||||
if (first)
|
||||
first = false;
|
||||
else
|
||||
|
|
@ -386,7 +394,7 @@ print_vector_constants(FILE *fp, unsigned src_binary,
|
|||
}
|
||||
|
||||
if (num_comp > 1)
|
||||
fprintf(fp, ")");
|
||||
fprintf(fp, ">");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue