panfrost: Fix fixed-function blend on Mali v6

Mali v6 (G72) doesn't support constants in blend equations, let's use
a shader in that case.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>
This commit is contained in:
Boris Brezillon 2020-10-07 14:37:56 +02:00
parent 8389976b7c
commit 7f2ea2a433

View file

@ -103,8 +103,10 @@ static void *
panfrost_create_blend_state(struct pipe_context *pipe,
const struct pipe_blend_state *blend)
{
struct panfrost_device *dev = pan_device(pipe->screen);
struct panfrost_context *ctx = pan_context(pipe);
struct panfrost_blend_state *so = rzalloc(ctx, struct panfrost_blend_state);
unsigned version = dev->gpu_id >> 12;
so->base = *blend;
/* TODO: The following features are not yet implemented */
@ -129,6 +131,10 @@ panfrost_create_blend_state(struct pipe_context *pipe,
&rt->equation,
&rt->constant_mask);
/* v6 doesn't support blend constants in FF blend equations. */
if (rt->has_fixed_function && version == 6 && rt->constant_mask)
rt->has_fixed_function = false;
if (rt->has_fixed_function) {
rt->opaque = pipe.rgb_src_factor == PIPE_BLENDFACTOR_ONE &&
pipe.rgb_dst_factor == PIPE_BLENDFACTOR_ZERO &&