summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorXiang, Haihao <[email protected]>2007-01-31 09:47:02 +0800
committerXiang, Haihao <[email protected]>2007-01-31 09:47:02 +0800
commit5893474c741274cde7a312c920dacfb00790c302 (patch)
tree1c4685f4edbefe461c30f5373f501ec27aaf4155 /src/mesa/main/image.c
parent876e372567ad44c03b9d9db6e57d3a06b684f6e1 (diff)
_mesa_pack_rgba_span_float: fix for packing data into group
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 6ff4089f0ea..fc8e1f0f574 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1331,6 +1331,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
dst[i*4+2] = FLOAT_TO_BYTE(rgba[i][RCOMP]);
dst[i*4+3] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
}
+ break;
case GL_ABGR_EXT:
for (i=0;i<n;i++) {
dst[i*4+0] = FLOAT_TO_BYTE(rgba[i][ACOMP]);
@@ -1479,6 +1480,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
dst[i*4+2] = FLOAT_TO_SHORT(rgba[i][RCOMP]);
dst[i*4+3] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
}
+ break;
case GL_ABGR_EXT:
for (i=0;i<n;i++) {
dst[i*4+0] = FLOAT_TO_SHORT(rgba[i][ACOMP]);
@@ -1815,7 +1817,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
for (i=0;i<n;i++) {
dst[i] = (((GLint) (rgba[i][RCOMP] * 7.0F)) )
| (((GLint) (rgba[i][GCOMP] * 7.0F)) << 3)
- | (((GLint) (rgba[i][BCOMP] * 3.0F)) << 5);
+ | (((GLint) (rgba[i][BCOMP] * 3.0F)) << 6);
}
}
break;
@@ -1861,9 +1863,9 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
else if (dstFormat == GL_ABGR_EXT) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (((GLint) (rgba[i][ACOMP] * 15.0F)) << 4)
+ dst[i] = (((GLint) (rgba[i][ACOMP] * 15.0F)) << 12)
| (((GLint) (rgba[i][BCOMP] * 15.0F)) << 8)
- | (((GLint) (rgba[i][GCOMP] * 15.0F)) << 12)
+ | (((GLint) (rgba[i][GCOMP] * 15.0F)) << 4)
| (((GLint) (rgba[i][RCOMP] * 15.0F)) );
}
}