[Mesa-dev] [PATCH 2/2] mesa: Moves up error check for subtexture dimensions

Eduardo Lima Mitev elima at igalia.com
Tue Sep 15 04:47:38 PDT 2015


For consistency and efficiency, the (sub)texture dimension error check
should go before the validation of format, type and internal format.
---
 src/mesa/main/teximage.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index d9453e3..09040d5 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2117,6 +2117,12 @@ texsubimage_error_check(struct gl_context *ctx, GLuint dimensions,
       return GL_TRUE;
    }
 
+   if (error_check_subtexture_dimensions(ctx, dimensions,
+                                         texImage, xoffset, yoffset, zoffset,
+                                         width, height, depth, callerName)) {
+      return GL_TRUE;
+   }
+
    err = _mesa_error_check_format_and_type(ctx, format, type);
    if (err != GL_NO_ERROR) {
       _mesa_error(ctx, err,
@@ -2145,12 +2151,6 @@ texsubimage_error_check(struct gl_context *ctx, GLuint dimensions,
       return GL_TRUE;
    }
 
-   if (error_check_subtexture_dimensions(ctx, dimensions,
-                                         texImage, xoffset, yoffset, zoffset,
-                                         width, height, depth, callerName)) {
-      return GL_TRUE;
-   }
-
    if (_mesa_is_format_compressed(texImage->TexFormat)) {
       if (_mesa_format_no_online_compression(ctx, texImage->InternalFormat)) {
          _mesa_error(ctx, GL_INVALID_OPERATION,
-- 
2.4.6



More information about the mesa-dev mailing list