summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texformat.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-08-07 11:14:35 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2014-11-13 19:13:27 +0200
commit40a08e0d6a57cc79ee72a62aeedec20cae774ed5 (patch)
tree5f70ae36404d229f028b9b10309c44e7272bad94 /src/mesa/main/texformat.c
parent7988ff2fd1f56b2c78809937eaa663de02a144bc (diff)
downloadexternal_mesa3d-40a08e0d6a57cc79ee72a62aeedec20cae774ed5.zip
external_mesa3d-40a08e0d6a57cc79ee72a62aeedec20cae774ed5.tar.gz
external_mesa3d-40a08e0d6a57cc79ee72a62aeedec20cae774ed5.tar.bz2
i915: Use L8A8 instead of I8 to simulate A8 on gen2
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>
Diffstat (limited to 'src/mesa/main/texformat.c')
-rw-r--r--src/mesa/main/texformat.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 832e661..ec16af9 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -155,12 +155,14 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
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 */
@@ -224,6 +226,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
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);