diff options
author | Jordan Justen <[email protected]> | 2012-06-25 10:52:39 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2012-07-21 16:49:42 -0700 |
commit | 9ad8f431b2a47060bf05517246ab0fa8d249c800 (patch) | |
tree | 579bb10a4bd1f1827ff4b38242f1b25d4e01fca0 /src/mesa/main/teximage.c | |
parent | e2e7b467d8a6567437823767af74004a396f1c82 (diff) |
mesa: add glformats integer type/format detection routines
_mesa_is_integer_format is moved to formats.c and renamed
as _mesa_is_enum_format_integer.
_mesa_is_format_unsigned, _mesa_is_type_integer,
_mesa_is_type_unsigned, and _mesa_is_enum_format_or_type_integer
are added.
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r-- | src/mesa/main/teximage.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 64b25a82dec..91df133312b 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -47,6 +47,7 @@ #include "texstate.h" #include "texpal.h" #include "mtypes.h" +#include "glformats.h" /** @@ -1764,8 +1765,8 @@ texture_error_check( struct gl_context *ctx, /* additional checks for integer textures */ if ((ctx->VersionMajor >= 3 || ctx->Extensions.EXT_texture_integer) && - (_mesa_is_integer_format(format) != - _mesa_is_integer_format(internalFormat))) { + (_mesa_is_enum_format_integer(format) != + _mesa_is_enum_format_integer(internalFormat))) { if (!isProxy) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexImage%dD(integer/non-integer format mismatch)", @@ -1939,7 +1940,7 @@ subtexture_error_check2( struct gl_context *ctx, GLuint dimensions, if (ctx->VersionMajor >= 3 || ctx->Extensions.EXT_texture_integer) { /* both source and dest must be integer-valued, or neither */ if (_mesa_is_format_integer_color(destTex->TexFormat) != - _mesa_is_integer_format(format)) { + _mesa_is_enum_format_integer(format)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%dD(integer/non-integer format mismatch)", dimensions); @@ -2042,8 +2043,8 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, if (_mesa_is_color_format(internalFormat)) { struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; - if (_mesa_is_integer_format(rb->InternalFormat) != - _mesa_is_integer_format(internalFormat)) { + if (_mesa_is_enum_format_integer(rb->InternalFormat) != + _mesa_is_enum_format_integer(internalFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexImage%dD(integer vs non-integer)", dimensions); return GL_TRUE; |