<p>It&#39;s entirely possible that I&#39;m still asleep, but what problem does this solve? Are ROPs not defined for FP operands?</p>
<p>Sending from a mobile, pardon my terseness. ~ C.</p>
<div class="gmail_quote">On Nov 6, 2011 4:31 AM, &quot;Morgan Armand&quot; &lt;<a href="mailto:morgan.devel@gmail.com">morgan.devel@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
 src/gallium/drivers/softpipe/sp_quad_blend.c |   78 ++++++++++++++++++-------<br>
 1 files changed, 56 insertions(+), 22 deletions(-)<br>
<br>
diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c<br>
index 598df26..4813ada 100644<br>
--- a/src/gallium/drivers/softpipe/sp_quad_blend.c<br>
+++ b/src/gallium/drivers/softpipe/sp_quad_blend.c<br>
@@ -702,19 +702,19 @@ blend_quad(struct quad_stage *qs,<br>
     */<br>
    switch (softpipe-&gt;blend-&gt;rt[blend_index].rgb_func) {<br>
    case PIPE_BLEND_ADD:<br>
-      VEC4_ADD_SAT(quadColor[0], source[0], blend_dest[0]); /* R */<br>
-      VEC4_ADD_SAT(quadColor[1], source[1], blend_dest[1]); /* G */<br>
-      VEC4_ADD_SAT(quadColor[2], source[2], blend_dest[2]); /* B */<br>
+      VEC4_ADD(quadColor[0], source[0], blend_dest[0]); /* R */<br>
+      VEC4_ADD(quadColor[1], source[1], blend_dest[1]); /* G */<br>
+      VEC4_ADD(quadColor[2], source[2], blend_dest[2]); /* B */<br>
       break;<br>
    case PIPE_BLEND_SUBTRACT:<br>
-      VEC4_SUB_SAT(quadColor[0], source[0], blend_dest[0]); /* R */<br>
-      VEC4_SUB_SAT(quadColor[1], source[1], blend_dest[1]); /* G */<br>
-      VEC4_SUB_SAT(quadColor[2], source[2], blend_dest[2]); /* B */<br>
+      VEC4_SUB(quadColor[0], source[0], blend_dest[0]); /* R */<br>
+      VEC4_SUB(quadColor[1], source[1], blend_dest[1]); /* G */<br>
+      VEC4_SUB(quadColor[2], source[2], blend_dest[2]); /* B */<br>
       break;<br>
    case PIPE_BLEND_REVERSE_SUBTRACT:<br>
-      VEC4_SUB_SAT(quadColor[0], blend_dest[0], source[0]); /* R */<br>
-      VEC4_SUB_SAT(quadColor[1], blend_dest[1], source[1]); /* G */<br>
-      VEC4_SUB_SAT(quadColor[2], blend_dest[2], source[2]); /* B */<br>
+      VEC4_SUB(quadColor[0], blend_dest[0], source[0]); /* R */<br>
+      VEC4_SUB(quadColor[1], blend_dest[1], source[1]); /* G */<br>
+      VEC4_SUB(quadColor[2], blend_dest[2], source[2]); /* B */<br>
       break;<br>
    case PIPE_BLEND_MIN:<br>
       VEC4_MIN(quadColor[0], source[0], blend_dest[0]); /* R */<br>
@@ -735,13 +735,13 @@ blend_quad(struct quad_stage *qs,<br>
     */<br>
    switch (softpipe-&gt;blend-&gt;rt[blend_index].alpha_func) {<br>
    case PIPE_BLEND_ADD:<br>
-      VEC4_ADD_SAT(quadColor[3], source[3], blend_dest[3]); /* A */<br>
+      VEC4_ADD(quadColor[3], source[3], blend_dest[3]); /* A */<br>
       break;<br>
    case PIPE_BLEND_SUBTRACT:<br>
-      VEC4_SUB_SAT(quadColor[3], source[3], blend_dest[3]); /* A */<br>
+      VEC4_SUB(quadColor[3], source[3], blend_dest[3]); /* A */<br>
       break;<br>
    case PIPE_BLEND_REVERSE_SUBTRACT:<br>
-      VEC4_SUB_SAT(quadColor[3], blend_dest[3], source[3]); /* A */<br>
+      VEC4_SUB(quadColor[3], blend_dest[3], source[3]); /* A */<br>
       break;<br>
    case PIPE_BLEND_MIN:<br>
       VEC4_MIN(quadColor[3], source[3], blend_dest[3]); /* A */<br>
@@ -856,6 +856,10 @@ blend_fallback(struct quad_stage *qs,<br>
<br>
    for (cbuf = 0; cbuf &lt; softpipe-&gt;framebuffer.nr_cbufs; cbuf++)<br>
    {<br>
+      const enum pipe_format format =<br>
+         softpipe-&gt;framebuffer.cbufs[cbuf]-&gt;format;<br>
+      const struct util_format_description *desc =<br>
+         util_format_description(format);<br>
       /* which blend/mask state index to use: */<br>
       const uint blend_buf = blend-&gt;independent_blend_enable ? cbuf : 0;<br>
       float dest[4][QUAD_SIZE];<br>
@@ -909,10 +913,19 @@ blend_fallback(struct quad_stage *qs,<br>
<br>
<br>
          if (blend-&gt;logicop_enable) {<br>
-            logicop_quad( qs, quadColor, dest );<br>
+            if (desc-&gt;channel[0].type != UTIL_FORMAT_TYPE_FLOAT) {<br>
+               logicop_quad( qs, quadColor, dest );<br>
+            }<br>
          }<br>
          else if (blend-&gt;rt[blend_buf].blend_enable) {<br>
             blend_quad(qs, quadColor, dest, blend_color, blend_buf);<br>
+<br>
+            /* If fixed-point dest color buffer, need to clamp the outgoing<br>
+             * fragment colors now.<br>
+             */<br>
+            if (clamp) {<br>
+               clamp_colors(quadColor);<br>
+            }<br>
          }<br>
<br>
          rebase_colors(bqs-&gt;base_format[cbuf], quadColor);<br>
@@ -969,6 +982,13 @@ blend_single_add_src_alpha_inv_src_alpha(struct quad_stage *qs,<br>
          }<br>
       }<br>
<br>
+      /* If fixed-point dest color buffer, need to clamp the incoming<br>
+       * fragment colors now.<br>
+       */<br>
+      if (bqs-&gt;clamp[0]) {<br>
+         clamp_colors(quadColor);<br>
+      }<br>
+<br>
       VEC4_MUL(source[0], quadColor[0], alpha); /* R */<br>
       VEC4_MUL(source[1], quadColor[1], alpha); /* G */<br>
       VEC4_MUL(source[2], quadColor[2], alpha); /* B */<br>
@@ -978,12 +998,19 @@ blend_single_add_src_alpha_inv_src_alpha(struct quad_stage *qs,<br>
       VEC4_MUL(dest[0], dest[0], one_minus_alpha); /* R */<br>
       VEC4_MUL(dest[1], dest[1], one_minus_alpha); /* G */<br>
       VEC4_MUL(dest[2], dest[2], one_minus_alpha); /* B */<br>
-      VEC4_MUL(dest[3], dest[3], one_minus_alpha); /* B */<br>
+      VEC4_MUL(dest[3], dest[3], one_minus_alpha); /* A */<br>
<br>
-      VEC4_ADD_SAT(quadColor[0], source[0], dest[0]); /* R */<br>
-      VEC4_ADD_SAT(quadColor[1], source[1], dest[1]); /* G */<br>
-      VEC4_ADD_SAT(quadColor[2], source[2], dest[2]); /* B */<br>
-      VEC4_ADD_SAT(quadColor[3], source[3], dest[3]); /* A */<br>
+      VEC4_ADD(quadColor[0], source[0], dest[0]); /* R */<br>
+      VEC4_ADD(quadColor[1], source[1], dest[1]); /* G */<br>
+      VEC4_ADD(quadColor[2], source[2], dest[2]); /* B */<br>
+      VEC4_ADD(quadColor[3], source[3], dest[3]); /* A */<br>
+<br>
+      /* If fixed-point dest color buffer, need to clamp the outgoing<br>
+       * fragment colors now.<br>
+       */<br>
+      if (bqs-&gt;clamp[0]) {<br>
+         clamp_colors(quadColor);<br>
+      }<br>
<br>
       rebase_colors(bqs-&gt;base_format[0], quadColor);<br>
<br>
@@ -1035,10 +1062,17 @@ blend_single_add_one_one(struct quad_stage *qs,<br>
          clamp_colors(quadColor);<br>
       }<br>
<br>
-      VEC4_ADD_SAT(quadColor[0], quadColor[0], dest[0]); /* R */<br>
-      VEC4_ADD_SAT(quadColor[1], quadColor[1], dest[1]); /* G */<br>
-      VEC4_ADD_SAT(quadColor[2], quadColor[2], dest[2]); /* B */<br>
-      VEC4_ADD_SAT(quadColor[3], quadColor[3], dest[3]); /* A */<br>
+      VEC4_ADD(quadColor[0], quadColor[0], dest[0]); /* R */<br>
+      VEC4_ADD(quadColor[1], quadColor[1], dest[1]); /* G */<br>
+      VEC4_ADD(quadColor[2], quadColor[2], dest[2]); /* B */<br>
+      VEC4_ADD(quadColor[3], quadColor[3], dest[3]); /* A */<br>
+<br>
+      /* If fixed-point dest color buffer, need to clamp the outgoing<br>
+       * fragment colors now.<br>
+       */<br>
+      if (bqs-&gt;clamp[0]) {<br>
+         clamp_colors(quadColor);<br>
+      }<br>
<br>
       rebase_colors(bqs-&gt;base_format[0], quadColor);<br>
<br>
--<br>
1.7.7.1.msysgit.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>