summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/lima
diff options
context:
space:
mode:
authorAndreas Baierl <[email protected]>2019-09-19 08:53:18 +0200
committerVasily Khoruzhick <[email protected]>2019-09-25 16:57:31 +0000
commit0c199808bc84637acce4a0ee7fea8bcabac39b76 (patch)
treecdc13c6629d9c2a88991423a719fa48792e67fa8 /src/gallium/drivers/lima
parent93df862b6affb6b8507e40601212a58012bfa873 (diff)
lima/ppir: Add various varying fetch sources to disassembler
Signed-off-by: Andreas Baierl <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/gallium/drivers/lima')
-rw-r--r--src/gallium/drivers/lima/ir/pp/disasm.c73
1 files changed, 50 insertions, 23 deletions
diff --git a/src/gallium/drivers/lima/ir/pp/disasm.c b/src/gallium/drivers/lima/ir/pp/disasm.c
index 04035a6373a..a45ab85538b 100644
--- a/src/gallium/drivers/lima/ir/pp/disasm.c
+++ b/src/gallium/drivers/lima/ir/pp/disasm.c
@@ -118,6 +118,32 @@ print_source_scalar(unsigned reg, const char *special, bool abs, bool neg)
}
static void
+print_varying_source(ppir_codegen_field_varying *varying)
+{
+ switch (varying->imm.alignment) {
+ case 0:
+ printf("%u.%c", varying->imm.index >> 2,
+ "xyzw"[varying->imm.index & 3]);
+ break;
+ case 1: {
+ const char *c[2] = {"xy", "zw"};
+ printf("%u.%s", varying->imm.index >> 1, c[varying->imm.index & 1]);
+ break;
+ }
+ default:
+ printf("%u", varying->imm.index);
+ break;
+ }
+
+ if (varying->imm.offset_vector != 15) {
+ unsigned reg = (varying->imm.offset_vector << 2) +
+ varying->imm.offset_scalar;
+ printf("+");
+ print_source_scalar(reg, NULL, false, false);
+ }
+}
+
+static void
print_outmod(ppir_codegen_outmod modifier)
{
switch (modifier)
@@ -213,7 +239,28 @@ print_varying(void *code, unsigned offset)
varying->reg.absolute, varying->reg.negate);
break;
case 2:
- printf("gl_FragCoord");
+ switch (varying->imm.perspective) {
+ case 0:
+ printf("cube(");
+ print_varying_source(varying);
+ printf(")");
+ break;
+ case 1:
+ printf("cube(");
+ print_vector_source(varying->reg.source, NULL, varying->reg.swizzle,
+ varying->reg.absolute, varying->reg.negate);
+ printf(")");
+ break;
+ case 2:
+ printf("normalize(");
+ print_vector_source(varying->reg.source, NULL, varying->reg.swizzle,
+ varying->reg.absolute, varying->reg.negate);
+ printf(")");
+ break;
+ default:
+ printf("gl_FragCoord");
+ break;
+ }
break;
case 3:
if (varying->imm.perspective)
@@ -222,27 +269,7 @@ print_varying(void *code, unsigned offset)
printf("gl_PointCoord");
break;
default:
- switch (varying->imm.alignment) {
- case 0:
- printf("%u.%c", varying->imm.index >> 2,
- "xyzw"[varying->imm.index & 3]);
- break;
- case 1: {
- const char *c[2] = {"xy", "zw"};
- printf("%u.%s", varying->imm.index >> 1, c[varying->imm.index & 1]);
- break;
- }
- default:
- printf("%u", varying->imm.index);
- break;
- }
-
- if (varying->imm.offset_vector != 15) {
- unsigned reg = (varying->imm.offset_vector << 2) +
- varying->imm.offset_scalar;
- printf("+");
- print_source_scalar(reg, NULL, false, false);
- }
+ print_varying_source(varying);
break;
}
}
@@ -620,7 +647,7 @@ print_combine(void *code, unsigned offset)
print_dest_scalar(combine->scalar.dest);
}
printf(" ");
-
+
print_source_scalar(combine->scalar.arg0_src, NULL,
combine->scalar.arg0_absolute,
combine->scalar.arg0_negate);