mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-11 18:50:17 +01:00
mesa: access pixels as GLushort in unpack_SL8()
Per the format comments and the texstore code, use a GLushort to access the pixel. The code was OK as-is on little endian machines.
This commit is contained in:
parent
2134d2f35b
commit
25c8a112ab
1 changed files with 3 additions and 3 deletions
|
|
@ -749,13 +749,13 @@ unpack_SL8(const void *src, GLfloat dst[][4], GLuint n)
|
|||
static void
|
||||
unpack_SLA8(const void *src, GLfloat dst[][4], GLuint n)
|
||||
{
|
||||
const GLubyte *s = (const GLubyte *) src;
|
||||
const GLushort *s = (const GLushort *) src;
|
||||
GLuint i;
|
||||
for (i = 0; i < n; i++) {
|
||||
dst[i][RCOMP] =
|
||||
dst[i][GCOMP] =
|
||||
dst[i][BCOMP] = nonlinear_to_linear(s[i*2+0]);
|
||||
dst[i][ACOMP] = UBYTE_TO_FLOAT(s[i*2+1]); /* linear! */
|
||||
dst[i][BCOMP] = nonlinear_to_linear(s[i] & 0xff);
|
||||
dst[i][ACOMP] = UBYTE_TO_FLOAT(s[i] >> 8); /* linear! */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue