diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 29 | ||||
-rw-r--r-- | src/panfrost/include/panfrost-job.h | 8 |
2 files changed, 13 insertions, 24 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index c9aace9f982..09a319ec2fb 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -1083,36 +1083,17 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data) struct midgard_blend_rt rts[4]; for (unsigned i = 0; i < rt_count; ++i) { - unsigned blend_count = 0x200; - - if (blend[i].is_shader) { - /* For a blend shader, the bottom nibble corresponds to - * the number of work registers used, which signals the - * -existence- of a blend shader */ - - assert(blend[i].shader.work_count >= 2); - blend_count |= MIN2(blend[i].shader.work_count, 3); - } else { - /* Otherwise, the bottom bit simply specifies if - * blending (anything other than REPLACE) is enabled */ - - if (!blend[i].no_blending) - blend_count |= 0x1; - } - + rts[i].flags = 0x200; bool is_srgb = (ctx->pipe_framebuffer.nr_cbufs > i) && (ctx->pipe_framebuffer.cbufs[i]) && util_format_is_srgb(ctx->pipe_framebuffer.cbufs[i]->format); - rts[i].flags = blend_count; - - if (is_srgb) - rts[i].flags |= MALI_BLEND_SRGB; - - if (!ctx->blend->base.dither) - rts[i].flags |= MALI_BLEND_NO_DITHER; + SET_BIT(rts[i].flags, MALI_BLEND_MRT_SHADER, blend[i].is_shader); + SET_BIT(rts[i].flags, MALI_BLEND_LOAD_TIB, !blend[i].no_blending); + SET_BIT(rts[i].flags, MALI_BLEND_SRGB, is_srgb); + SET_BIT(rts[i].flags, MALI_BLEND_NO_DITHER, !ctx->blend->base.dither); /* TODO: sRGB in blend shaders is currently * unimplemented. Contact me (Alyssa) if you're diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h index fb356e1e6d9..d9a3fe9327e 100644 --- a/src/panfrost/include/panfrost-job.h +++ b/src/panfrost/include/panfrost-job.h @@ -417,6 +417,14 @@ union midgard_blend { }; }; +/* We need to load the tilebuffer to blend (i.e. the destination factor is not + * ZERO) */ + +#define MALI_BLEND_LOAD_TIB (0x1) + +/* A blend shader is used to blend this render target */ +#define MALI_BLEND_MRT_SHADER (0x2) + /* On MRT Midgard systems (using an MFBD), each render target gets its own * blend descriptor */ |