summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_texfilter.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-09-30 22:50:05 -0600
committerBrian Paul <brianp@vmware.com>2009-09-30 22:50:08 -0600
commit8c36ca707ca8879d6f888de7733ffb6b04ddc48a (patch)
treee893ea85a88956299c8438448470b71953da4e11 /src/mesa/swrast/s_texfilter.c
parent3d6a20e5b6c7567ed64fceed7744cf39eea34400 (diff)
swrast: fix some texformat regressions
Need to be careful with component ordering for MESA_FORMAT_RGB888 and MESA_FORMAT_RGBA8888.
Diffstat (limited to 'src/mesa/swrast/s_texfilter.c')
-rw-r--r--src/mesa/swrast/s_texfilter.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index 6cba8ed34b..db03c6aa39 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -1351,9 +1351,9 @@ opt_sample_rgb_2d(GLcontext *ctx,
GLint j = IFLOOR(texcoords[k][1] * height) & rowMask;
GLint pos = (j << shift) | i;
GLubyte *texel = ((GLubyte *) img->Data) + 3*pos;
- rgba[k][RCOMP] = UBYTE_TO_FLOAT(texel[0]);
+ rgba[k][RCOMP] = UBYTE_TO_FLOAT(texel[2]);
rgba[k][GCOMP] = UBYTE_TO_FLOAT(texel[1]);
- rgba[k][BCOMP] = UBYTE_TO_FLOAT(texel[2]);
+ rgba[k][BCOMP] = UBYTE_TO_FLOAT(texel[0]);
}
}
@@ -1392,10 +1392,10 @@ opt_sample_rgba_2d(GLcontext *ctx,
const GLint row = IFLOOR(texcoords[i][1] * height) & rowMask;
const GLint pos = (row << shift) | col;
const GLubyte *texel = ((GLubyte *) img->Data) + (pos << 2); /* pos*4 */
- rgba[i][RCOMP] = UBYTE_TO_FLOAT(texel[0]);
- rgba[i][GCOMP] = UBYTE_TO_FLOAT(texel[1]);
- rgba[i][BCOMP] = UBYTE_TO_FLOAT(texel[2]);
- rgba[i][ACOMP] = UBYTE_TO_FLOAT(texel[3]);
+ rgba[i][RCOMP] = UBYTE_TO_FLOAT(texel[3]);
+ rgba[i][GCOMP] = UBYTE_TO_FLOAT(texel[2]);
+ rgba[i][BCOMP] = UBYTE_TO_FLOAT(texel[1]);
+ rgba[i][ACOMP] = UBYTE_TO_FLOAT(texel[0]);
}
}