From: Alyssa Rosenzweig Date: Tue, 26 May 2020 23:48:25 +0000 (-0400) Subject: panfrost: Set MALI_BIFROST_EARLY_Z as necessary X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee6a5a5f0521bc40457258b2f0dede8a3f2f42ba;p=mesa.git panfrost: Set MALI_BIFROST_EARLY_Z as necessary Fixes blending. Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index fa5c7e2da5d..c77afaedc0d 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -332,7 +332,7 @@ panfrost_shader_meta_init(struct panfrost_context *ctx, else { /* First clause ATEST |= 0x4000000. * Less than 32 regs |= 0x200 */ - meta->bifrost1.unk1 = 0x958020; + meta->bifrost1.unk1 = 0x950020; } meta->bifrost1.uniform_buffer_count = panfrost_ubo_count(ctx, st); @@ -730,6 +730,16 @@ panfrost_frag_meta_blend_update(struct panfrost_context *ctx, return; } + if (dev->quirks & IS_BIFROST) { + bool no_blend = true; + + for (unsigned i = 0; i < rt_count; ++i) + no_blend &= (blend[i].no_blending | blend[i].no_colour); + + SET_BIT(fragmeta->bifrost1.unk1, MALI_BIFROST_EARLY_Z, + !fs->can_discard && !fs->writes_depth && no_blend); + } + /* Additional blend descriptor tacked on for jobs using MFBD */ for (unsigned i = 0; i < rt_count; ++i) {