Commit 46bba4e4 authored by Connor Abbott's avatar Connor Abbott

bifrost: Refactor and improve interpolation output

flat, per-fragment, etc. really act like modifiers, so print them as
such. Also, disassemble special addresses for gl_FragCoord z and w
components.
parent 917d1387
......@@ -1087,6 +1087,18 @@ static void DumpADD(uint64_t word, Regs regs, Regs nextRegs, uint64_t *consts,
printf(".f32");
else
printf(".v2f16");
} else if (info.srcType == ADDVaryingInterp) {
if (ADD.op & 0x200)
printf(".reuse");
if (ADD.op & 0x400)
printf(".flat");
switch ((ADD.op >> 7) & 0x3) {
case 0: printf(".per_frag"); break;
case 1: printf(".centroid"); break;
case 2: break;
case 3: printf(".explicit"); break;
}
printf(".v%d", ((ADD.op >> 5) & 0x3) + 1);
} else if (info.srcType == ADDBranch) {
BranchCode branchCode = (BranchCode) ((ADD.op >> 6) & 0x3f);
if (branchCode == BrAlways) {
......@@ -1323,27 +1335,18 @@ static void DumpADD(uint64_t word, Regs regs, Regs nextRegs, uint64_t *consts,
break;
}
case ADDVaryingInterp: {
if (ADD.op & 0x200)
printf("reuse ");
if (ADD.op & 0x400)
printf("flat ");
switch ((ADD.op >> 7) & 0x3) {
case 0: printf("per_frag "); break;
case 1: printf("centroid "); break;
case 2: break;
case 3: printf("explicit "); break;
default: break;
}
printf("vec%d ", ((ADD.op >> 5) & 0x3) + 1);
unsigned addr = ADD.op & 0x1f;
if (addr < 0b10100) {
// direct addr
printf("addr:%d", addr);
printf("%d", addr);
} else if (addr < 0b11000) {
// unknown
printf("addr:%d(unknown)", addr);
if (addr == 22)
printf("fragw");
else if (addr == 23)
printf("fragz");
else
printf("unk%d", addr);
} else {
printf("addr:");
DumpSrc(ADD.op & 0x7, regs, consts, false);
}
printf(", ");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment