Mesa (master): pack: handle GL_RGB+GL_UNSIGNED_INT_2_10_10_10_REV case

Jordan Justen jljusten at kemper.freedesktop.org
Tue Jan 15 07:24:43 UTC 2013


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

Author: Jordan Justen <jordan.l.justen at intel.com>
Date:   Sun Dec 30 00:40:00 2012 -0800

pack: handle GL_RGB+GL_UNSIGNED_INT_2_10_10_10_REV case

For floats, if GL_RGB is the source, then alpha should be set to
1.0F.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/main/pack.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index 4f0caa7..d6a97b3 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -3641,7 +3641,11 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
                rgba[i][rDst] = ((p      ) & 0x3ff) * rs;
                rgba[i][gDst] = ((p >> 10) & 0x3ff) * gs;
                rgba[i][bDst] = ((p >> 20) & 0x3ff) * bs;
-               rgba[i][aDst] = ((p >> 30)        ) * as;
+               if (aSrc < 0) {
+                  rgba[i][aDst] = 1.0F;
+               } else {
+                  rgba[i][aDst] = (p >> 30) * as;
+               }
             }
          }
          else {
@@ -3652,7 +3656,11 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
                rgba[i][rDst] = ((p      ) & 0x3ff) * rs;
                rgba[i][gDst] = ((p >> 10) & 0x3ff) * gs;
                rgba[i][bDst] = ((p >> 20) & 0x3ff) * bs;
-               rgba[i][aDst] = ((p >> 30)        ) * as;
+               if (aSrc < 0) {
+                  rgba[i][aDst] = 1.0F;
+               } else {
+                  rgba[i][aDst] = (p >> 30) * as;
+               }
             }
          }
          break;




More information about the mesa-commit mailing list