Преглед изворни кода

mesa: fix incorrect component ordering for sRGB8 texture fetch/store

This format is layered on MESA_FORMAT_RGB888 so the component order is
actually BGR.
Fixes glean pixelFormat failures.
tags/mesa_7_5_rc1
Brian Paul пре 16 година
родитељ
комит
d03053688f
1 измењених фајлова са 6 додато и 5 уклоњено
  1. 6
    5
      src/mesa/main/texformat_tmp.h

+ 6
- 5
src/mesa/main/texformat_tmp.h Прегледај датотеку

@@ -1164,14 +1164,15 @@ static void store_texel_ci8(struct gl_texture_image *texImage,
#if FEATURE_EXT_texture_sRGB

/* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */
/* Note: component order is same as for MESA_FORMAT_RGB888 */
static void FETCH(srgb8)(const struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3);
texel[RCOMP] = nonlinear_to_linear(src[0]);
texel[RCOMP] = nonlinear_to_linear(src[2]);
texel[GCOMP] = nonlinear_to_linear(src[1]);
texel[BCOMP] = nonlinear_to_linear(src[2]);
texel[ACOMP] = CHAN_MAX;
texel[BCOMP] = nonlinear_to_linear(src[0]);
texel[ACOMP] = 1.0F;
}

#if DIM == 3
@@ -1180,9 +1181,9 @@ static void store_texel_srgb8(struct gl_texture_image *texImage,
{
const GLubyte *rgba = (const GLubyte *) texel;
GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3);
dst[0] = rgba[RCOMP]; /* no conversion */
dst[0] = rgba[BCOMP]; /* no conversion */
dst[1] = rgba[GCOMP];
dst[2] = rgba[BCOMP];
dst[2] = rgba[RCOMP];
}
#endif


Loading…
Откажи
Сачувај