diff options
author | Brian Paul <[email protected]> | 2000-12-10 19:23:19 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2000-12-10 19:23:19 +0000 |
commit | 90f042ae8dbc00ecedab5cc68dbc6abae4228af5 (patch) | |
tree | 3c075fe61d2b793e71ae0d5d2efeeb7b5425c8c2 /src/mesa/main/convolve.c | |
parent | 8aa019d2efcf0295beae51989fe4b419ca50ca17 (diff) |
generate GL_INVALID_OPERATION error for bad image format/type combinations
Diffstat (limited to 'src/mesa/main/convolve.c')
-rw-r--r-- | src/mesa/main/convolve.c | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index 5bb4e82a843..c496e6c8f55 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -1,4 +1,4 @@ -/* $Id: convolve.c,v 1.15 2000/11/23 02:50:56 jtaylor Exp $ */ +/* $Id: convolve.c,v 1.16 2000/12/10 19:23:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -130,8 +130,12 @@ _mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, G return; } - if (!_mesa_is_legal_format_and_type(format, type) || - format == GL_COLOR_INDEX || + if (!_mesa_is_legal_format_and_type(format, type)) { + gl_error(ctx, GL_INVALID_OPERATION, "glConvolutionFilter1D(format or type)"); + return; + } + + if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX || format == GL_DEPTH_COMPONENT || format == GL_INTENSITY || @@ -204,8 +208,11 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G return; } - if (!_mesa_is_legal_format_and_type(format, type) || - format == GL_COLOR_INDEX || + if (!_mesa_is_legal_format_and_type(format, type)) { + gl_error(ctx, GL_INVALID_OPERATION, "glConvolutionFilter2D(format or type)"); + return; + } + if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX || format == GL_DEPTH_COMPONENT || format == GL_INTENSITY || @@ -569,8 +576,12 @@ _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *im gl_update_state(ctx); } - if (!_mesa_is_legal_format_and_type(format, type) || - format == GL_COLOR_INDEX || + if (!_mesa_is_legal_format_and_type(format, type)) { + gl_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter(format or type)"); + return; + } + + if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX || format == GL_DEPTH_COMPONENT || format == GL_INTENSITY || @@ -753,8 +764,12 @@ _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, return; } - if (!_mesa_is_legal_format_and_type(format, type) || - format == GL_COLOR_INDEX || + if (!_mesa_is_legal_format_and_type(format, type)) { + gl_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter(format or type)"); + return; + } + + if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX || format == GL_DEPTH_COMPONENT || format == GL_INTENSITY || @@ -818,8 +833,12 @@ _mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLs return; } - if (!_mesa_is_legal_format_and_type(format, type) || - format == GL_COLOR_INDEX || + if (!_mesa_is_legal_format_and_type(format, type)) { + gl_error(ctx, GL_INVALID_OPERATION, "glSeparableFilter2D(format or type)"); + return; + } + + if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX || format == GL_DEPTH_COMPONENT || format == GL_INTENSITY || |