From cf55e05f8f2b3082b3a03e476c95bef401e366da Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 19 Aug 2022 14:56:18 -0400 Subject: [PATCH] pan/bi: Handle info.fs.untyped_color_outputs on Valhall Colour outputs in TGSI are untyped so we have to ignore the register format on the store_output. Luckily, Valhall gives us the auto32 escape hatch to deal with it, and Bifrost doesn't care anyway. This will avoid regressions from native int output without corrupting the compiler for GLSL and SPIR-V shaders that are well-typed. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index cedf32b818e..db4ec229d4c 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -770,6 +770,10 @@ bi_emit_blend_op(bi_builder *b, bi_index rgba, nir_alu_type T, uint64_t blend_desc = inputs->blend.bifrost_blend_desc; enum bi_register_format regfmt = bi_reg_fmt_for_nir(T); + /* Workaround for NIR-to-TGSI */ + if (b->shader->nir->info.fs.untyped_color_outputs) + regfmt = BI_REGISTER_FORMAT_AUTO; + if (inputs->is_blend && inputs->blend.nr_samples > 1) { /* Conversion descriptor comes from the compile inputs, pixel * indices derived at run time based on sample ID */