From a25b9cd8d04a0c17d23371f4a358218016f4a0f3 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 16 Feb 2021 13:23:08 -0500 Subject: [PATCH] panfrost: Track coverage, early fragment tests These extra pieces of data are needed to correctly compute pixel kill / zs update settings. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/lib/pan_shader.c | 3 +++ src/panfrost/util/pan_ir.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/panfrost/lib/pan_shader.c b/src/panfrost/lib/pan_shader.c index 20e9d43817c..bed64b04b6c 100644 --- a/src/panfrost/lib/pan_shader.c +++ b/src/panfrost/lib/pan_shader.c @@ -174,6 +174,8 @@ pan_shader_compile(const struct panfrost_device *dev, info->fs.writes_depth = true; if (s->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_STENCIL)) info->fs.writes_stencil = true; + if (s->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK)) + info->fs.writes_coverage = true; uint64_t outputs_read = s->info.outputs_read; if (outputs_read & BITFIELD64_BIT(FRAG_RESULT_COLOR)) @@ -187,6 +189,7 @@ pan_shader_compile(const struct panfrost_device *dev, info->fs.can_discard = s->info.fs.uses_discard; info->fs.helper_invocations = s->info.fs.needs_quad_helper_invocations; + info->fs.early_fragment_tests = s->info.fs.early_fragment_tests; /* List of reasons we need to execute frag shaders when things * are masked off */ diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h index b8925a3fdd3..0cdd0a1bad4 100644 --- a/src/panfrost/util/pan_ir.h +++ b/src/panfrost/util/pan_ir.h @@ -163,12 +163,14 @@ struct pan_shader_info { bool can_discard; bool writes_depth; bool writes_stencil; + bool writes_coverage; bool sidefx; bool reads_sample_id; bool reads_sample_pos; bool reads_sample_mask_in; bool reads_helper_invocation; bool sample_shading; + bool early_fragment_tests; BITSET_WORD outputs_read; } fs;