mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 17:50:12 +01:00
panfrost: Disable tib read/write when colourmask = 0x0
There might still be Z/S updates so we can't drop the whole shader but we can shortcircuit the colour pipeline. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5124>
This commit is contained in:
parent
f69b6e9116
commit
3e4e849e6a
3 changed files with 16 additions and 10 deletions
|
|
@ -99,10 +99,12 @@ struct panfrost_blend_final {
|
||||||
/* Set for a shader, clear for an equation */
|
/* Set for a shader, clear for an equation */
|
||||||
bool is_shader;
|
bool is_shader;
|
||||||
|
|
||||||
/* Set if the destination needs to be loaded from the tilebuffer,
|
/* Clear if the destination needs to be loaded from the tilebuffer */
|
||||||
* basically (for an equation) or if a shader is present */
|
|
||||||
bool no_blending;
|
bool no_blending;
|
||||||
|
|
||||||
|
/* Set if the colour mask is 0x0 (nothing is written) */
|
||||||
|
bool no_colour;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
struct panfrost_blend_shader_final shader;
|
struct panfrost_blend_shader_final shader;
|
||||||
struct panfrost_blend_equation_final equation;
|
struct panfrost_blend_equation_final equation;
|
||||||
|
|
|
||||||
|
|
@ -255,6 +255,8 @@ panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti, struc
|
||||||
(rt->equation.alpha_mode == 0x122) &&
|
(rt->equation.alpha_mode == 0x122) &&
|
||||||
(rt->equation.color_mask == 0xf);
|
(rt->equation.color_mask == 0xf);
|
||||||
|
|
||||||
|
final.no_colour = (rt->equation.color_mask == 0x0);
|
||||||
|
|
||||||
return final;
|
return final;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -725,6 +725,7 @@ panfrost_frag_meta_blend_update(struct panfrost_context *ctx,
|
||||||
} else {
|
} else {
|
||||||
struct midgard_blend_rt *mrts = rts;
|
struct midgard_blend_rt *mrts = rts;
|
||||||
|
|
||||||
|
if (!blend[i].no_colour) {
|
||||||
mrts[i].flags = 0x200;
|
mrts[i].flags = 0x200;
|
||||||
|
|
||||||
bool is_srgb = (ctx->pipe_framebuffer.nr_cbufs > i) &&
|
bool is_srgb = (ctx->pipe_framebuffer.nr_cbufs > i) &&
|
||||||
|
|
@ -735,6 +736,7 @@ panfrost_frag_meta_blend_update(struct panfrost_context *ctx,
|
||||||
SET_BIT(mrts[i].flags, MALI_BLEND_LOAD_TIB, !blend[i].no_blending);
|
SET_BIT(mrts[i].flags, MALI_BLEND_LOAD_TIB, !blend[i].no_blending);
|
||||||
SET_BIT(mrts[i].flags, MALI_BLEND_SRGB, is_srgb);
|
SET_BIT(mrts[i].flags, MALI_BLEND_SRGB, is_srgb);
|
||||||
SET_BIT(mrts[i].flags, MALI_BLEND_NO_DITHER, !ctx->blend->base.dither);
|
SET_BIT(mrts[i].flags, MALI_BLEND_NO_DITHER, !ctx->blend->base.dither);
|
||||||
|
}
|
||||||
|
|
||||||
if (blend[i].is_shader) {
|
if (blend[i].is_shader) {
|
||||||
mrts[i].blend.shader = blend[i].shader.gpu | blend[i].shader.first_tag;
|
mrts[i].blend.shader = blend[i].shader.gpu | blend[i].shader.first_tag;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue