mesa/teximage: report the correct function which triggered the error
authorNanley Chery <nanley.g.chery@intel.com>
Fri, 7 Aug 2015 23:37:47 +0000 (16:37 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Wed, 12 Aug 2015 20:48:45 +0000 (13:48 -0700)
This function would always report that a dimension or size error occurred
in glTexImage even when it was called from glCompressedTexImage. Replace
the static string with the dynamically determined caller name.

Reviewed-by: Tapani Palli <tapani.palli@intel.com>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
src/mesa/main/teximage.c

index fc69387204f6a1fe5bb3deb50e36dd1ecc488333..d35dc12e2cbe51677805432154375134e3405653 100644 (file)
@@ -3336,15 +3336,15 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
 
       if (!dimensionsOK) {
          _mesa_error(ctx, GL_INVALID_VALUE,
-                     "glTexImage%uD(invalid width or height or depth)",
-                     dims);
+                     "%s%uD(invalid width or height or depth)",
+                     func, dims);
          return;
       }
 
       if (!sizeOK) {
          _mesa_error(ctx, GL_OUT_OF_MEMORY,
-                     "glTexImage%uD(image too large: %d x %d x %d, %s format)",
-                     dims, width, height, depth,
+                     "%s%uD(image too large: %d x %d x %d, %s format)",
+                     func, dims, width, height, depth,
                      _mesa_enum_to_string(internalFormat));
          return;
       }