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>
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;
};
-/* 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. */
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;
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);