diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 7f6052d5c5e..ff8564ffd14 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -4304,6 +4304,20 @@ bi_compile_variant(nir_shader *nir, bi_block *first_block = list_first_entry(&ctx->blocks, bi_block, link); uint64_t preload = first_block->reg_live_in; + /* If multisampling is used with a blend shader, the blend shader needs + * to access the sample coverage mask in r60 and the sample ID in r61. + * Blend shaders run in the same context as fragment shaders, so if a + * blend shader could run, we need to preload these registers + * conservatively. There is believed to be little cost to doing so, so + * do so always to avoid variants of the preload descriptor. + * + * We only do this on Valhall, as Bifrost has to update the RSD for + * multisampling w/ blend shader anyway, so this is handled in the + * driver. We could unify the paths if the cost is acceptable. + */ + if (nir->info.stage == MESA_SHADER_FRAGMENT && ctx->arch >= 9) + preload |= BITFIELD64_BIT(60) | BITFIELD64_BIT(61); + info->ubo_mask |= ctx->ubo_mask; info->tls_size = MAX2(info->tls_size, ctx->info.tls_size);