diff options
author | Roland Scheidegger <sroland@vmware.com> | 2009-03-28 01:43:50 +0100 |
---|---|---|
committer | Roland Scheidegger <sroland@vmware.com> | 2009-03-28 02:06:49 +0100 |
commit | a693a2998c996f063edec8a83a4f6a175f39c471 (patch) | |
tree | c32982b0c8d56da2927a23c5a23e8e55b7c45995 /src/mesa/drivers/dri/intel/intel_tex_format.c | |
parent | 02a579f2e7abc832dd46956048d1116f7dc3dd92 (diff) | |
download | external_mesa3d-a693a2998c996f063edec8a83a4f6a175f39c471.zip external_mesa3d-a693a2998c996f063edec8a83a4f6a175f39c471.tar.gz external_mesa3d-a693a2998c996f063edec8a83a4f6a175f39c471.tar.bz2 |
i965: srgb texture fixes
i965 can either do SRGBA8_REV format or SARGB8 format, but not SRGBA8.
Could add SRGBA8_REV support to mesa, but simply use SARGB8 for now.
While here, also add true srgb luminance / luminance_alpha support -
unfortunately the published docs fail to mention which asics support
this, tested on g43 so assume this works on any g4x.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_tex_format.c')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_format.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index ce33cdc..3322a71 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -1,5 +1,6 @@ #include "intel_context.h" #include "intel_tex.h" +#include "intel_chipset.h" #include "main/texformat.h" #include "main/enums.h" @@ -160,15 +161,23 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_SRGB8_EXT: case GL_SRGB_ALPHA_EXT: case GL_SRGB8_ALPHA8_EXT: - case GL_SLUMINANCE_EXT: - case GL_SLUMINANCE8_EXT: - case GL_SLUMINANCE_ALPHA_EXT: - case GL_SLUMINANCE8_ALPHA8_EXT: case GL_COMPRESSED_SRGB_EXT: case GL_COMPRESSED_SRGB_ALPHA_EXT: case GL_COMPRESSED_SLUMINANCE_EXT: case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - return &_mesa_texformat_srgba8; + return &_mesa_texformat_sargb8; + case GL_SLUMINANCE_EXT: + case GL_SLUMINANCE8_EXT: + if (IS_G4X(intel->intelScreen->deviceID)) + return &_mesa_texformat_sl8; + else + return &_mesa_texformat_sargb8; + case GL_SLUMINANCE_ALPHA_EXT: + case GL_SLUMINANCE8_ALPHA8_EXT: + if (IS_G4X(intel->intelScreen->deviceID)) + return &_mesa_texformat_sla8; + else + return &_mesa_texformat_sargb8; case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: |