From 03f6d26b6284cca8f9874928ed11922055247658 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 3 Jul 2018 16:27:39 -0700 Subject: v3d: Skip emitting per-RT blend state for RTs with blend disabled. Cleans up the CL of fbo-drawbuffers2-blend a bit. We could do better on more complicated cases by noticing if multiple RTs have the same blend state and emitting them in a single packet. --- src/gallium/drivers/v3d/v3dx_emit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/v3d') diff --git a/src/gallium/drivers/v3d/v3dx_emit.c b/src/gallium/drivers/v3d/v3dx_emit.c index 78edf02d79a..ce5eafec55c 100644 --- a/src/gallium/drivers/v3d/v3dx_emit.c +++ b/src/gallium/drivers/v3d/v3dx_emit.c @@ -276,9 +276,15 @@ static void emit_rt_blend(struct v3d_context *v3d, struct v3d_job *job, struct pipe_blend_state *blend, int rt) { - cl_emit(&job->bcl, BLEND_CONFIG, config) { - struct pipe_rt_blend_state *rtblend = &blend->rt[rt]; + struct pipe_rt_blend_state *rtblend = &blend->rt[rt]; +#if V3D_VERSION >= 40 + /* We don't need to emit blend state for disabled RTs. */ + if (!rtblend->blend_enable) + return; +#endif + + cl_emit(&job->bcl, BLEND_CONFIG, config) { #if V3D_VERSION >= 40 config.render_target_mask = 1 << rt; #else -- cgit v1.2.3