diff options
author | Brian Paul <[email protected]> | 2009-09-03 11:23:05 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-09-03 11:45:17 -0600 |
commit | 95027a00870bc1d12ea24dfb092a0cad6cbd5035 (patch) | |
tree | 0e69858daa7f9672fa847aa185bdfd89d4b0d62e /src/mesa/main/convolve.c | |
parent | dc947c8f92732fab75f89015e2d506e964a41ace (diff) |
mesa: use new combined PBO validate/map helpers
Diffstat (limited to 'src/mesa/main/convolve.c')
-rw-r--r-- | src/mesa/main/convolve.c | 58 |
1 files changed, 15 insertions, 43 deletions
diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index 7e0761e68b8..714909f451d 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -144,21 +144,12 @@ _mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, G ctx->Convolution1D.Width = width; ctx->Convolution1D.Height = 1; - if (!_mesa_validate_pbo_access(1, &ctx->Unpack, width, 1, 1, - format, type, image)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glConvolutionFilter1D(invalid PBO access)"); + image = _mesa_map_validate_pbo_source(ctx, + 1, &ctx->Unpack, width, 1, 1, + format, type, image, + "glConvolutionFilter1D"); + if (!image) return; - } - - image = _mesa_map_pbo_source(ctx, &ctx->Unpack, image); - if (!image) { - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glConvolutionFilter1D(PBO is mapped)"); - } - return; - } _mesa_unpack_color_span_float(ctx, width, GL_RGBA, ctx->Convolution1D.Filter, @@ -231,21 +222,12 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G ctx->Convolution2D.Width = width; ctx->Convolution2D.Height = height; - if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1, - format, type, image)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glConvolutionFilter2D(invalid PBO access)"); + image = _mesa_map_validate_pbo_source(ctx, + 2, &ctx->Unpack, width, height, 1, + format, type, image, + "glConvolutionFilter2D"); + if (!image) return; - } - - image = _mesa_map_pbo_source(ctx, &ctx->Unpack, image); - if (!image) { - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glConvolutionFilter2D(PBO is mapped)"); - } - return; - } /* Unpack filter image. We always store filters in RGBA format. */ for (i = 0; i < height; i++) { @@ -576,22 +558,12 @@ _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, return; } - if (!_mesa_validate_pbo_access(2, &ctx->Pack, - filter->Width, filter->Height, - 1, format, type, image)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetConvolutionFilter(invalid PBO access)"); - return; - } - - image = _mesa_map_pbo_dest(ctx, &ctx->Pack, image); - if (!image) { - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetConvolutionFilter(PBO is mapped)"); - } + image = _mesa_map_validate_pbo_dest(ctx, 2, &ctx->Pack, + filter->Width, filter->Height, 1, + format, type, image, + "glGetConvolutionFilter"); + if (!image) return; - } for (row = 0; row < filter->Height; row++) { GLvoid *dst = _mesa_image_address2d(&ctx->Pack, image, filter->Width, |