pan/bi: Add store_channels property
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 20 Mar 2020 16:38:53 +0000 (12:38 -0400)
committerMarge Bot <eric+marge@anholt.net>
Sun, 22 Mar 2020 03:32:35 +0000 (03:32 +0000)
It can't be inferred from the usual writemask since stores don't write
to a register destination.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4276>

src/panfrost/bifrost/bi_print.c
src/panfrost/bifrost/bifrost_compile.c
src/panfrost/bifrost/compiler.h

index 2a03b3cab5d8fff34bf39f5620301be9d80cb1a8..f06cff849d394934736fd88d011d979ae02790f2 100644 (file)
@@ -345,6 +345,8 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
                 fprintf(fp, ".%s", bi_cond_name(ins->csel_cond));
         else if (ins->type == BI_BLEND)
                 fprintf(fp, ".loc%u", ins->blend_location);
+        else if (ins->type == BI_STORE || ins->type == BI_STORE_VAR)
+                fprintf(fp, ".v%u", ins->store_channels);
 
         if (ins->dest)
                 bi_print_alu_type(ins->dest_type, fp);
index 25bb4ab9c58539882f78b5356d14e26ce10297e7..3d7bbfbba6314b0766bc0c93922a04e2ba9804cc 100644 (file)
@@ -194,7 +194,8 @@ bi_emit_st_vary(bi_context *ctx, nir_intrinsic_instr *instr)
                 .swizzle = {
                         { 0, 1, 2, 3 },
                         { 0 }, { 1 }, { 2}
-                }
+                },
+                .store_channels = 4, /* TODO: WRITEMASK */
         };
 
         bi_emit(ctx, address);
index ee868f75d925dee7400a885b2b1bced55f9f28b9..b09bd536729a10fe3261ad94dfedd338c75d22d0 100644 (file)
@@ -261,6 +261,9 @@ typedef struct {
 
                 /* For BLEND -- the location 0-7 */
                 unsigned blend_location;
+
+                /* For STORE, STORE_VAR -- channel count */
+                unsigned store_channels;
         };
 } bi_instruction;