Gen2 doesn't support the A8 texture format. Currently the driver
substitutes it with I8, but that results in incorrect RGB values.
Use A8L8 instead. We end up wasting a bit of memory, but at least
we should get the correct results.
v2: Handle the fallback in _mesa_choose_tex_format() and also
do it for all alpha formats that currently accept A8
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72819
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80050
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38873
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
return MAPSURF_8BIT | MT_8BIT_L8;
case MESA_FORMAT_I_UNORM8:
return MAPSURF_8BIT | MT_8BIT_I8;
- case MESA_FORMAT_A_UNORM8:
- return MAPSURF_8BIT | MT_8BIT_I8; /* Kludge! */
case MESA_FORMAT_L8A8_UNORM:
return MAPSURF_16BIT | MT_16BIT_AY88;
case MESA_FORMAT_B5G6R5_UNORM:
ctx->TextureFormatSupported[MESA_FORMAT_B5G5R5A1_UNORM] = true;
ctx->TextureFormatSupported[MESA_FORMAT_B5G6R5_UNORM] = true;
ctx->TextureFormatSupported[MESA_FORMAT_L_UNORM8] = true;
- ctx->TextureFormatSupported[MESA_FORMAT_A_UNORM8] = true;
+ if (intel->gen == 3)
+ ctx->TextureFormatSupported[MESA_FORMAT_A_UNORM8] = true;
ctx->TextureFormatSupported[MESA_FORMAT_I_UNORM8] = true;
ctx->TextureFormatSupported[MESA_FORMAT_L8A8_UNORM] = true;
case GL_ALPHA4:
case GL_ALPHA8:
RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_L8A8_UNORM);
break;
case GL_ALPHA12:
case GL_ALPHA16:
RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM16);
RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_L8A8_UNORM);
break;
/* Luminance formats */
case GL_COMPRESSED_ALPHA_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_L8A8_UNORM);
break;
case GL_COMPRESSED_LUMINANCE_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_L_UNORM8);