From 8ed94d38b4169e18bf81e956241d1c8674cc2ec6 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 31 Jan 2020 12:37:38 +0100 Subject: panfrost: Add the MALI_WRITES_{Z,S} flags We discovered 2 new shader flags used when a fragment shader updates the depth/stencil value through a ZS writeout. If those flags are not set, the depth/stencil value stored in the depth/stencil tilebuffer remain unchanged. While at it, rename unknown2 into flags_hi and rename flags into flags_lo. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/include/panfrost-job.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/panfrost/include') diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h index 0861d10e509..1a59f4c77c8 100644 --- a/src/panfrost/include/panfrost-job.h +++ b/src/panfrost/include/panfrost-job.h @@ -384,7 +384,10 @@ enum mali_format { #define MALI_ALPHA_COVERAGE(clampf) ((uint16_t) (int) (clampf * 15.0f)) #define MALI_GET_ALPHA_COVERAGE(nibble) ((float) nibble / 15.0f) -/* Applies to midgard1.flags */ +/* Applies to midgard1.flags_lo */ + +/* Should be set when the fragment shader updates the depth value. */ +#define MALI_WRITES_Z (1 << 4) /* Should the hardware perform early-Z testing? Normally should be set * for performance reasons. Clear if you use: discard, @@ -406,6 +409,11 @@ enum mali_format { #define MALI_READS_ZS (1 << 8) #define MALI_READS_TILEBUFFER (1 << 12) +/* Applies to midgard1.flags_hi */ + +/* Should be set when the fragment shader updates the stencil value. */ +#define MALI_WRITES_S (1 << 2) + /* The raw Midgard blend payload can either be an equation or a shader * address, depending on the context */ @@ -534,12 +542,12 @@ struct mali_shader_meta { } bifrost1; struct { unsigned uniform_buffer_count : 4; - unsigned flags : 12; + unsigned flags_lo : 12; /* vec4 units */ unsigned work_count : 5; unsigned uniform_count : 5; - unsigned unknown2 : 6; + unsigned flags_hi : 6; } midgard1; }; -- cgit v1.2.3