summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-07-03 16:27:39 -0700
committerEric Anholt <[email protected]>2018-07-05 12:39:36 -0700
commit03f6d26b6284cca8f9874928ed11922055247658 (patch)
treee4dc9ac6f696c2017711712df103fa4220754671 /src/gallium/drivers/v3d
parent572f6ab489db2d2311d89ab5910764ebb83cb49d (diff)
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.
Diffstat (limited to 'src/gallium/drivers/v3d')
-rw-r--r--src/gallium/drivers/v3d/v3dx_emit.c10
1 files changed, 8 insertions, 2 deletions
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,10 +276,16 @@ 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
assert(rt == 0);