Mesa (mesa_7_5_branch): mesa: better error message for invalid texture unit index

Brian Paul brianp at kemper.freedesktop.org
Mon Jun 8 15:55:24 UTC 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: 33d63277706aede31559a24c0db76b37609e76ef
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=33d63277706aede31559a24c0db76b37609e76ef

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Jun  8 09:52:31 2009 -0600

mesa: better error message for invalid texture unit index

---

 src/mesa/shader/arbprogparse.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index c7a0310..bb4c5b3 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -1014,7 +1014,10 @@ parse_teximage_num (GLcontext * ctx, const GLubyte ** inst,
    GLint i = parse_integer (inst, Program);
 
    if ((i < 0) || (i >= (int)ctx->Const.MaxTextureImageUnits)) {
-      program_error(ctx, Program->Position, "Invalid texture image index");
+      char s[100];
+      _mesa_snprintf(s, sizeof(s), "Invalid texture image index %d (%u is max)",
+                     i, ctx->Const.MaxTextureImageUnits);
+      program_error(ctx, Program->Position, s);
       return 1;
    }
 




More information about the mesa-commit mailing list