pan/midgard: Fix vertex texturing on early Midgard
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 11 Nov 2019 13:15:46 +0000 (08:15 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 15 Nov 2019 18:37:33 +0000 (18:37 +0000)
We use a different set of texture registers, probably to save hardware.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Tested-by: Andre Heider <a.heider@gmail.com>
src/panfrost/midgard/midgard_ra.c

index 7035a2a160b8beb8676a66055da262575a9873e7..85ad96ff312151ca925abd5bec414527e4dad9fa 100644 (file)
@@ -441,6 +441,16 @@ allocate_registers(compiler_context *ctx, bool *spilled)
 
         lcra_set_disjoint_class(l, REG_CLASS_TEXR, REG_CLASS_TEXW);
 
+        /* To save space on T720, we don't have real texture registers.
+         * Instead, tex inputs reuse the load/store pipeline registers, and
+         * tex outputs use work r0/r1. Note we still use TEXR/TEXW classes,
+         * noting that this handles interferences and sizes correctly. */
+
+        if (ctx->gpu_id == 0x0720) {
+                l->class_start[REG_CLASS_TEXR] = l->class_start[REG_CLASS_LDST];
+                l->class_start[REG_CLASS_TEXW] = l->class_start[REG_CLASS_WORK];
+        }
+
         unsigned *found_class = calloc(sizeof(unsigned), ctx->temp_count);
 
         mir_foreach_instr_global(ctx, ins) {