diff options
| author | Roland Scheidegger <sroland@vmware.com> | 2010-05-04 15:58:29 +0200 |
|---|---|---|
| committer | Roland Scheidegger <sroland@vmware.com> | 2010-05-04 15:58:29 +0200 |
| commit | 0ae2f59c0287f4baec6c7de5f2f0fdf736fba26d (patch) | |
| tree | ee14bf3e8bba80649541c4e13fc07c60baf6c248 /src/mesa/main/teximage.c | |
| parent | 7662e3519bef3802024da3050b886068281e02b1 (diff) | |
| parent | 1c920c61764b17fd9fb4a89d2db7355fbe1d7565 (diff) | |
Merge commit 'origin/master' into gallium-msaa
Diffstat (limited to 'src/mesa/main/teximage.c')
| -rw-r--r-- | src/mesa/main/teximage.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index e0c5cf9c37..0b55097bd6 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -46,6 +46,7 @@ #include "texfetch.h" #include "teximage.h" #include "texstate.h" +#include "texpal.h" #include "mtypes.h" @@ -1279,8 +1280,8 @@ texture_error_check( GLcontext *ctx, GLenum target, if (type != GL_UNSIGNED_SHORT_8_8_MESA && type != GL_UNSIGNED_SHORT_8_8_REV_MESA) { char message[100]; - sprintf(message, - "glTexImage%d(format/type YCBCR mismatch", dimensions); + _mesa_snprintf(message, sizeof(message), + "glTexImage%d(format/type YCBCR mismatch", dimensions); _mesa_error(ctx, GL_INVALID_ENUM, message); return GL_TRUE; /* error */ } @@ -1295,9 +1296,9 @@ texture_error_check( GLcontext *ctx, GLenum target, if (border != 0) { if (!isProxy) { char message[100]; - sprintf(message, - "glTexImage%d(format=GL_YCBCR_MESA and border=%d)", - dimensions, border); + _mesa_snprintf(message, sizeof(message), + "glTexImage%d(format=GL_YCBCR_MESA and border=%d)", + dimensions, border); _mesa_error(ctx, GL_INVALID_VALUE, message); } return GL_TRUE; @@ -3380,7 +3381,6 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, } } - void GLAPIENTRY _mesa_CompressedTexImage2DARB(GLenum target, GLint level, GLenum internalFormat, GLsizei width, @@ -3396,6 +3396,24 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, _mesa_lookup_enum_by_nr(internalFormat), width, height, border, imageSize, data); +#if FEATURE_ES + switch (internalFormat) { + case GL_PALETTE4_RGB8_OES: + case GL_PALETTE4_RGBA8_OES: + case GL_PALETTE4_R5_G6_B5_OES: + case GL_PALETTE4_RGBA4_OES: + case GL_PALETTE4_RGB5_A1_OES: + case GL_PALETTE8_RGB8_OES: + case GL_PALETTE8_RGBA8_OES: + case GL_PALETTE8_R5_G6_B5_OES: + case GL_PALETTE8_RGBA4_OES: + case GL_PALETTE8_RGB5_A1_OES: + _mesa_cpal_compressed_teximage2d(target, level, internalFormat, + width, height, imageSize, data); + return; + } +#endif + if (target == GL_TEXTURE_2D || (ctx->Extensions.ARB_texture_cube_map && target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && |
