panfrost: Implement alpha-to-coverage
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:
parent
f23cdd4f72
commit
490fbce239
|
@ -107,7 +107,6 @@ panfrost_create_blend_state(struct pipe_context *pipe,
|
|||
so->base = *blend;
|
||||
|
||||
/* TODO: The following features are not yet implemented */
|
||||
assert(!blend->alpha_to_coverage);
|
||||
assert(!blend->alpha_to_one);
|
||||
|
||||
for (unsigned c = 0; c < PIPE_MAX_COLOR_BUFS; ++c) {
|
||||
|
|
|
@ -672,6 +672,9 @@ panfrost_frag_meta_blend_update(struct panfrost_context *ctx,
|
|||
(dev->quirks & MIDGARD_SFBD) && ctx->blend &&
|
||||
!ctx->blend->base.dither);
|
||||
|
||||
SET_BIT(fragmeta->unknown2_4, MALI_ALPHA_TO_COVERAGE,
|
||||
ctx->blend->base.alpha_to_coverage);
|
||||
|
||||
/* Get blending setup */
|
||||
unsigned rt_count = MAX2(ctx->pipe_framebuffer.nr_cbufs, 1);
|
||||
|
||||
|
@ -857,7 +860,8 @@ panfrost_frag_shader_meta_init(struct panfrost_context *ctx,
|
|||
|
||||
SET_BIT(fragmeta->midgard1.flags_lo, MALI_EARLY_Z,
|
||||
!fs->can_discard && !fs->writes_global &&
|
||||
!fs->writes_depth && !fs->writes_stencil);
|
||||
!fs->writes_depth && !fs->writes_stencil &&
|
||||
!ctx->blend->base.alpha_to_coverage);
|
||||
|
||||
/* Add the writes Z/S flags if needed. */
|
||||
SET_BIT(fragmeta->midgard1.flags_lo, MALI_WRITES_Z, fs->writes_depth);
|
||||
|
|
|
@ -110,8 +110,7 @@ enum mali_func {
|
|||
/* Next flags to unknown2_4 */
|
||||
#define MALI_STENCIL_TEST (1 << 0)
|
||||
|
||||
/* What?! */
|
||||
#define MALI_SAMPLE_ALPHA_TO_COVERAGE_NO_BLEND_SHADER (1 << 1)
|
||||
#define MALI_ALPHA_TO_COVERAGE (1 << 1)
|
||||
|
||||
#define MALI_NO_DITHER (1 << 9)
|
||||
#define MALI_DEPTH_RANGE_A (1 << 12)
|
||||
|
|
|
@ -237,7 +237,7 @@ static const struct pandecode_flag_info u4_flag_info[] = {
|
|||
FLAG_INFO(DEPTH_RANGE_A),
|
||||
FLAG_INFO(DEPTH_RANGE_B),
|
||||
FLAG_INFO(STENCIL_TEST),
|
||||
FLAG_INFO(SAMPLE_ALPHA_TO_COVERAGE_NO_BLEND_SHADER),
|
||||
FLAG_INFO(ALPHA_TO_COVERAGE),
|
||||
{}
|
||||
};
|
||||
#undef FLAG_INFO
|
||||
|
|
Loading…
Reference in New Issue