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

Submitted by Maxence Le Doré on Jan. 3, 2014, 1:18 a.m.

Details

Message ID 1388711906-4910-3-git-send-email-maxence.ledore@gmail.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Maxence Le Doré Jan. 3, 2014, 1:18 a.m.
---
 src/mesa/swrast/s_blend.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Patch hide | download patch | download mbox

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 */