[Mesa-dev] [PATCH] mesa/teximage: report the correct function which triggered the error

Nanley Chery nanleychery at gmail.com
Tue Aug 11 17:09:47 PDT 2015

From: Nanley Chery <nanley.g.chery at intel.com>

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.

Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
 src/mesa/main/teximage.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 03e45fc..d519fa5 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -3428,15 +3428,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);
       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,

More information about the mesa-dev mailing list