pan/bi: Passthrough blend types
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 23 Apr 2020 23:26:01 +0000 (19:26 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 27 Apr 2020 14:52:25 +0000 (14:52 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766>

src/panfrost/bifrost/bifrost_compile.c
src/panfrost/bifrost/compiler.h
src/panfrost/util/pan_ir.h

index cdaf772709cb85bb622707491af476737bb00b17..333172f1699e4b9325d83b913a531e1a0a057587 100644 (file)
@@ -163,6 +163,10 @@ bi_emit_frag_out(bi_context *ctx, nir_intrinsic_instr *instr)
                 .writemask = 0xF
         };
 
+        assert(blend.blend_location < 8);
+        assert(ctx->blend_types);
+        ctx->blend_types[blend.blend_location] = blend.src_types[0];
+
         bi_emit(ctx, blend);
         bi_schedule_barrier(ctx);
 }
@@ -1074,6 +1078,7 @@ bifrost_compile_shader_nir(nir_shader *nir, panfrost_program *program, unsigned
         panfrost_nir_assign_sysvals(&ctx->sysvals, nir);
         program->sysval_count = ctx->sysvals.sysval_count;
         memcpy(program->sysvals, ctx->sysvals.sysvals, sizeof(ctx->sysvals.sysvals[0]) * ctx->sysvals.sysval_count);
+        ctx->blend_types = program->blend_types;
 
         nir_foreach_function(func, nir) {
                 if (!func->impl)
index 1cbb211b778a445f2bbb0a4762da6d16c0112619..3fc819c8afc93b696555449577438452f210506b 100644 (file)
@@ -387,6 +387,7 @@ typedef struct {
        bi_block *break_block;
        bi_block *continue_block;
        bool emitted_atest;
+       nir_alu_type *blend_types;
 
        /* For creating temporaries */
        unsigned temp_alloc;
index 16d2a2b2f674866d175bc2ca468f66213362a406..2d416ffeb21b7ba0ec84e8746834e38759eace15 100644 (file)
@@ -86,6 +86,9 @@ typedef struct {
         int work_register_count;
         int uniform_cutoff;
 
+        /* For Bifrost - output type for each RT */
+        nir_alu_type blend_types[8];
+
         /* Prepended before uniforms, mapping to SYSVAL_ names for the
          * sysval */