Module: Mesa
Branch: master
Commit: 03f6d26b6284cca8f9874928ed11922055247658
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=03f6d26b6284cca8f9874928ed11922055247658

Author: Eric Anholt <[email protected]>
Date:   Tue Jul  3 16:27:39 2018 -0700

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(-)

diff --git a/src/gallium/drivers/v3d/v3dx_emit.c 
b/src/gallium/drivers/v3d/v3dx_emit.c
index 78edf02d79..ce5eafec55 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);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to