mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 12:40:09 +01:00
mesa: Fix bad conversion in AL1616_REV texstore.
This commit is contained in:
parent
b47f7316da
commit
db352f58fa
1 changed files with 12 additions and 8 deletions
|
|
@ -2197,18 +2197,22 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS)
|
|||
GLuint *dstUI = (GLuint *) dstRow;
|
||||
if (dstFormat == MESA_FORMAT_AL1616) {
|
||||
for (col = 0; col < srcWidth; col++) {
|
||||
/* src[0] is luminance, src[1] is alpha */
|
||||
dstUI[col] = PACK_COLOR_1616( FLOAT_TO_USHORT(src[1]),
|
||||
FLOAT_TO_USHORT(src[0]) );
|
||||
src += 2;
|
||||
GLushort l, a;
|
||||
|
||||
UNCLAMPED_FLOAT_TO_USHORT(l, src[0]);
|
||||
UNCLAMPED_FLOAT_TO_USHORT(a, src[1]);
|
||||
dstUI[col] = PACK_COLOR_1616(a, l);
|
||||
src += 2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (col = 0; col < srcWidth; col++) {
|
||||
/* src[0] is luminance, src[1] is alpha */
|
||||
dstUI[col] = PACK_COLOR_1616_REV( FLOAT_TO_UBYTE(src[1]),
|
||||
FLOAT_TO_UBYTE(src[0]) );
|
||||
src += 2;
|
||||
GLushort l, a;
|
||||
|
||||
UNCLAMPED_FLOAT_TO_USHORT(l, src[0]);
|
||||
UNCLAMPED_FLOAT_TO_USHORT(a, src[1]);
|
||||
dstUI[col] = PACK_COLOR_1616_REV(a, l);
|
||||
src += 2;
|
||||
}
|
||||
}
|
||||
dstRow += dstRowStride;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue