pan/bi: Use ST_TILE for multisampled blend output

ST_TILE lets us specify an explicit sample, whereas BLEND replicates to
all samples. This fully fixes the interaction between blend shaders and
multisampling on Bifrost, manifesting as
dEQP-GLES3.functional.fragment_ops.random.* failures with the
configuration rgba8888d24s8ms4.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12478>
This commit is contained in:
Alyssa Rosenzweig 2021-08-18 22:12:02 +00:00 committed by Marge Bot
parent 4a51366144
commit bfd3ae35c9

View File

@ -507,11 +507,17 @@ static void
bi_emit_blend_op(bi_builder *b, bi_index rgba, nir_alu_type T, unsigned rt)
{
/* Reads 2 or 4 staging registers to cover the input */
unsigned sr_count = (nir_alu_type_get_type_size(T) <= 16) ? 2 : 4;
if (b->shader->inputs->is_blend) {
uint64_t blend_desc = b->shader->inputs->blend.bifrost_blend_desc;
unsigned size = nir_alu_type_get_type_size(T);
unsigned sr_count = (size <= 16) ? 2 : 4;
const struct panfrost_compile_inputs *inputs = b->shader->inputs;
uint64_t blend_desc = inputs->blend.bifrost_blend_desc;
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 */
bi_st_tile(b, rgba, bi_pixel_indices(b, rt), bi_register(60),
bi_imm_u32(blend_desc >> 32), BI_VECSIZE_V4);
} else if (b->shader->inputs->is_blend) {
/* Blend descriptor comes from the compile inputs */
/* Put the result in r0 */
bi_blend_to(b, bi_register(0), rgba,