diff options
author | marha <marha@users.sourceforge.net> | 2013-04-08 08:20:47 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-04-08 08:20:47 +0200 |
commit | a4505330e3469b6956348812ff2d6c24f812a8ba (patch) | |
tree | cf2b88c771188580ab585f763d2e7a0309ecab26 /mesalib/src/mesa/main/texstorage.c | |
parent | 44fb3db38c5148666f62c78e10fc37bb20ed5c5c (diff) | |
parent | 95fb19d661154ba8cfc6c793a0daa25657294b3b (diff) | |
download | vcxsrv-a4505330e3469b6956348812ff2d6c24f812a8ba.tar.gz vcxsrv-a4505330e3469b6956348812ff2d6c24f812a8ba.tar.bz2 vcxsrv-a4505330e3469b6956348812ff2d6c24f812a8ba.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
fontconfig libXau mesa xserver xkeyboard-config git update 8 Apr 2013
Diffstat (limited to 'mesalib/src/mesa/main/texstorage.c')
-rw-r--r-- | mesalib/src/mesa/main/texstorage.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/mesalib/src/mesa/main/texstorage.c b/mesalib/src/mesa/main/texstorage.c index 675fd745b..6309b5716 100644 --- a/mesalib/src/mesa/main/texstorage.c +++ b/mesalib/src/mesa/main/texstorage.c @@ -202,20 +202,9 @@ clear_texture_fields(struct gl_context *ctx, } -/** - * Do error checking for calls to glTexStorage1/2/3D(). - * If an error is found, record it with _mesa_error(), unless the target - * is a proxy texture. - * \return GL_TRUE if any error, GL_FALSE otherwise. - */ -static GLboolean -tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target, - GLsizei levels, GLenum internalformat, - GLsizei width, GLsizei height, GLsizei depth) +GLboolean +_mesa_is_legal_tex_storage_format(struct gl_context *ctx, GLenum internalformat) { - struct gl_texture_object *texObj; - GLboolean legalFormat; - /* check internal format - note that only sized formats are allowed */ switch (internalformat) { case GL_ALPHA: @@ -250,13 +239,27 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target, case GL_LUMINANCE_INTEGER_EXT: case GL_LUMINANCE_ALPHA_INTEGER_EXT: /* these unsized formats are illegal */ - legalFormat = GL_FALSE; - break; + return GL_FALSE; default: - legalFormat = _mesa_base_tex_format(ctx, internalformat) > 0; + return _mesa_base_tex_format(ctx, internalformat) > 0; } +} + + +/** + * Do error checking for calls to glTexStorage1/2/3D(). + * If an error is found, record it with _mesa_error(), unless the target + * is a proxy texture. + * \return GL_TRUE if any error, GL_FALSE otherwise. + */ +static GLboolean +tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target, + GLsizei levels, GLenum internalformat, + GLsizei width, GLsizei height, GLsizei depth) +{ + struct gl_texture_object *texObj; - if (!legalFormat) { + if (!_mesa_is_legal_tex_storage_format(ctx, internalformat)) { _mesa_error(ctx, GL_INVALID_ENUM, "glTexStorage%uD(internalformat = %s)", dims, _mesa_lookup_enum_by_nr(internalformat)); |