Mesa (master): i965: Move color calc code around a bit.

Rafael Antognolli rantogno at kemper.freedesktop.org
Thu Jul 13 23:43:17 UTC 2017


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

Author: Rafael Antognolli <rafael.antognolli at intel.com>
Date:   Mon Jun 19 17:15:55 2017 -0700

i965: Move color calc code around a bit.

This makes the code more consistent accross generations.

Signed-off-by: Rafael Antognolli <rafael.antognolli at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_cc.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c
index 1574788736..676edaff12 100644
--- a/src/mesa/drivers/dri/i965/brw_cc.c
+++ b/src/mesa/drivers/dri/i965/brw_cc.c
@@ -123,6 +123,14 @@ static void upload_cc_unit(struct brw_context *brw)
       GLenum srcA = ctx->Color.Blend[0].SrcA;
       GLenum dstA = ctx->Color.Blend[0].DstA;
 
+      if (eqRGB == GL_MIN || eqRGB == GL_MAX) {
+	 srcRGB = dstRGB = GL_ONE;
+      }
+
+      if (eqA == GL_MIN || eqA == GL_MAX) {
+	 srcA = dstA = GL_ONE;
+      }
+
       /* If the renderbuffer is XRGB, we have to frob the blend function to
        * force the destination alpha to 1.0.  This means replacing GL_DST_ALPHA
        * with GL_ONE and GL_ONE_MINUS_DST_ALPHA with GL_ZERO.
@@ -136,14 +144,6 @@ static void upload_cc_unit(struct brw_context *brw)
 	 dstA   = brw_fix_xRGB_alpha(dstA);
       }
 
-      if (eqRGB == GL_MIN || eqRGB == GL_MAX) {
-	 srcRGB = dstRGB = GL_ONE;
-      }
-
-      if (eqA == GL_MIN || eqA == GL_MAX) {
-	 srcA = dstA = GL_ONE;
-      }
-
       cc->cc6.dest_blend_factor = brw_translate_blend_factor(dstRGB);
       cc->cc6.src_blend_factor = brw_translate_blend_factor(srcRGB);
       cc->cc6.blend_function = brw_translate_blend_equation(eqRGB);




More information about the mesa-commit mailing list