diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-10-22 08:02:27 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-10-22 08:02:27 -0600 |
commit | fc3e095ae3275767a27b3e1b0d0c2964dc35eabf (patch) | |
tree | d4ea207ab99b07f40142fcdb181884d5adef21dc | |
parent | 9b16be8408b11f7580f0a670b55ad126f17a7deb (diff) |
mesa: move convolution image adjustment code for glCopyTexSubImage1/2/3D()
Do it after initial error checking, after we know the texture's internal format.
Conflicts:
src/mesa/main/teximage.c
-rw-r--r-- | src/mesa/main/teximage.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 0a3113df53..2024784921 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3032,9 +3032,6 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - /* XXX should test internal format */ - _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); - if (copytexsubimage_error_check1(ctx, 1, target, level)) return; @@ -3045,6 +3042,10 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, { texImage = _mesa_select_tex_image(ctx, texObj, target, level); + if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { + _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); + } + if (copytexsubimage_error_check2(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1, texImage)) @@ -3079,9 +3080,6 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - /* XXX should test internal format */ - _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); - if (copytexsubimage_error_check1(ctx, 2, target, level)) return; @@ -3092,6 +3090,11 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, { texImage = _mesa_select_tex_image(ctx, texObj, target, level); + if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { + _mesa_adjust_image_for_convolution(ctx, 2, + &postConvWidth, &postConvHeight); + } + if (copytexsubimage_error_check2(ctx, 2, target, level, xoffset, yoffset, 0, postConvWidth, postConvHeight, texImage)) goto out; @@ -3126,9 +3129,6 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - /* XXX should test internal format */ - _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); - if (copytexsubimage_error_check1(ctx, 3, target, level)) return; @@ -3139,6 +3139,11 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, { texImage = _mesa_select_tex_image(ctx, texObj, target, level); + if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { + _mesa_adjust_image_for_convolution(ctx, 2, + &postConvWidth, &postConvHeight); + } + if (copytexsubimage_error_check2(ctx, 3, target, level, xoffset, yoffset, zoffset, postConvWidth, postConvHeight, texImage)) |