mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 18:38:11 +02:00
swrast: fix texel decoding in opt_sample_rgba_2d()
This commit is contained in:
parent
7ac233ec15
commit
1e7517f059
1 changed files with 5 additions and 5 deletions
|
|
@ -1391,11 +1391,11 @@ opt_sample_rgba_2d(GLcontext *ctx,
|
|||
const GLint col = IFLOOR(texcoords[i][0] * width) & colMask;
|
||||
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[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]);
|
||||
const GLuint texel = *((GLuint *) img->Data + pos);
|
||||
rgba[i][RCOMP] = UBYTE_TO_FLOAT( (texel >> 24) );
|
||||
rgba[i][GCOMP] = UBYTE_TO_FLOAT( (texel >> 16) & 0xff );
|
||||
rgba[i][BCOMP] = UBYTE_TO_FLOAT( (texel >> 8) & 0xff );
|
||||
rgba[i][ACOMP] = UBYTE_TO_FLOAT( (texel ) & 0xff );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue