Module: Mesa Branch: master Commit: 1a8f1a324a22bcd99b31482002d4b380ffb7cb34 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a8f1a324a22bcd99b31482002d4b380ffb7cb34
Author: Alyssa Rosenzweig <[email protected]> Date: Thu Apr 23 19:26:01 2020 -0400 pan/bi: Passthrough blend types Signed-off-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766> --- src/panfrost/bifrost/bifrost_compile.c | 5 +++++ src/panfrost/bifrost/compiler.h | 1 + src/panfrost/util/pan_ir.h | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index cdaf772709c..333172f1699 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -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) diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 1cbb211b778..3fc819c8afc 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -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; diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h index 16d2a2b2f67..2d416ffeb21 100644 --- a/src/panfrost/util/pan_ir.h +++ b/src/panfrost/util/pan_ir.h @@ -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 */ _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
