[Mesa-dev] [PATCH 3/7] swrast: support factors for min/max blending

Maxence Le Doré maxence.ledore at gmail.com
Thu Jan 2 17:18:22 PST 2014


---
 src/mesa/swrast/s_blend.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c
index 1037b62..59ffa7a 100644
--- a/src/mesa/swrast/s_blend.c
+++ b/src/mesa/swrast/s_blend.c
@@ -767,6 +767,16 @@ blend_general_float(struct gl_context *ctx, GLuint n, const GLubyte mask[],
 	    g = MAX2( Gd, Gs );
 	    b = MAX2( Bd, Bs );
             break;
+         case GL_FACTOR_MIN_AMD:
+            r = MIN2( Rs * sR, Rd * dR);
+            g = MIN2( Gs * sG, Gd * dG);
+            b = MIN2( Bs * sB, Bd * dB);
+            break;
+         case GL_FACTOR_MAX_AMD:
+            r = MAX2( Rs * sR, Rd * dR);
+            g = MAX2( Gs * sG, Gd * dG);
+            b = MAX2( Bs * sB, Bd * dB);
+            break;
 	 default:
             /* should never get here */
             r = g = b = 0.0F;  /* silence uninitialized var warning */
@@ -791,6 +801,12 @@ blend_general_float(struct gl_context *ctx, GLuint n, const GLubyte mask[],
          case GL_MAX:
 	    a = MAX2( Ad, As );
             break;
+         case GL_FACTOR_MIN_AMD:
+            a = MIN2( As * sA, Ad * dA);
+            break;
+         case GL_FACTOR_MAX_AMD:
+            a = MAX2( As * sA, Ad * dA);
+            break;
          default:
             /* should never get here */
             a = 0.0F;  /* silence uninitialized var warning */
-- 
1.8.5.2



More information about the mesa-dev mailing list