Module: Mesa
Branch: mesa_7_2_branch
Commit: fc3e095ae3275767a27b3e1b0d0c2964dc35eabf
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fc3e095ae3275767a27b3e1b0d0c2964dc35eabf

Author: Brian Paul <[EMAIL PROTECTED]>
Date:   Wed Oct 22 08:02:27 2008 -0600

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

---

 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 0a3113d..2024784 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))

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to