From b90d7b9b38b92114532553db01d72b20cbc43d4d Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Fri, 20 May 2022 09:44:45 +0200 Subject: [PATCH] broadcom/compiler: don't promote early fragment tests when writing sample mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the sample mask is being written it means we want to discard some of the samples generated so we should not be promoting the fragment shader to do early tests, since that would not take into account the sample mask written from the shader. Fixes: dEQP-VK.fragment_operations.early_fragment.sample_count_early_fragment_tests_depth_samples_4 Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/compiler/nir_to_vir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index 1f9c2fa5bf5..a1561d418c5 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -1931,6 +1931,7 @@ emit_frag_end(struct v3d_compile *c) !(c->s->info.num_images || c->s->info.num_ssbos) && !c->s->info.fs.uses_discard && !c->fs_key->sample_alpha_to_coverage && + c->output_sample_mask_index == -1 && has_any_tlb_color_write) { c->s->info.fs.early_fragment_tests = true; }