panfrost: Identify coverage_mask

The driver specifies the mask directly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
This commit is contained in:
Alyssa Rosenzweig 2020-07-02 10:06:33 -04:00 committed by Marge Bot
parent 546a600ba5
commit 3e251328fa
3 changed files with 8 additions and 17 deletions

View file

@ -835,7 +835,7 @@ panfrost_frag_shader_meta_init(struct panfrost_context *ctx,
fs = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
fragmeta->alpha_coverage = ~MALI_ALPHA_COVERAGE(0.000000);
fragmeta->coverage_mask = 0xFFFF;
fragmeta->unknown2_3 = MALI_DEPTH_FUNC(MALI_FUNC_ALWAYS) | 0x10;
fragmeta->unknown2_4 = 0x4e0;

View file

@ -384,13 +384,6 @@ enum mali_format {
};
/* Alpha coverage is encoded as 4-bits (from a clampf), with inversion
* literally performing a bitwise invert. This function produces slightly wrong
* results and I'm not sure why; some rounding issue I suppose... */
#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_lo */
/* Should be set when the fragment shader updates the depth value. */
@ -610,7 +603,11 @@ struct mali_shader_meta {
u32 unknown2_2;
u16 alpha_coverage;
/* Generated from SAMPLE_COVERAGE_VALUE and SAMPLE_COVERAGE_INVERT. See
* 13.8.3 ("Multisample Fragment Operations") in the OpenGL ES 3.2
* specification. Only matters when multisampling is enabled. */
u16 coverage_mask;
u16 unknown2_3;
u8 stencil_mask_front;

View file

@ -2642,14 +2642,8 @@ pandecode_vertex_tiler_postfix_pre(
pandecode_prop("depth_units = %f", s->depth_units);
}
if (s->alpha_coverage) {
bool invert_alpha_coverage = s->alpha_coverage & 0xFFF0;
uint16_t inverted_coverage = invert_alpha_coverage ? ~s->alpha_coverage : s->alpha_coverage;
pandecode_prop("alpha_coverage = %sMALI_ALPHA_COVERAGE(%f)",
invert_alpha_coverage ? "~" : "",
MALI_GET_ALPHA_COVERAGE(inverted_coverage));
}
if (s->coverage_mask)
pandecode_prop("coverage_mask = 0x%X", s->coverage_mask);
if (s->unknown2_2)
pandecode_prop(".unknown2_2 = %X", s->unknown2_2);