From: Eric Anholt Date: Tue, 3 Jul 2018 23:27:39 +0000 (-0700) Subject: v3d: Skip emitting per-RT blend state for RTs with blend disabled. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=03f6d26b6284cca8f9874928ed11922055247658;p=mesa.git 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. --- 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