Mesa (mesa_7_5_branch): ARB prog: Set error instead of falling through with incorrect value

Brian Paul brianp at kemper.freedesktop.org
Tue Aug 25 15:46:08 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Aug 24 13:56:01 2009 -0600

ARB prog: Set error instead of falling through with incorrect value

If a fragment program only parameter was queried of a vertex program
(e.g., GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB) no error would be set and
a random value would be returned.  This caused 'glxinfo -l' to show
the same values for GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB,
GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB, GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB,
GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB,
GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB,
GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB as for
GL_MAX_PROGRAM_ENV_PARAMETERS_ARB.  This is confusing and incorrect.

(cherry picked from master, commit 4bccd693a72a0b42dffc849034263a68e779ca91)

---

 src/mesa/shader/arbprogram.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c
index 981565a..a033105 100644
--- a/src/mesa/shader/arbprogram.c
+++ b/src/mesa/shader/arbprogram.c
@@ -985,6 +985,9 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params)
             _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivARB(pname)");
             return;
       }
+   } else {
+      _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivARB(pname)");
+      return;
    }
 }
 




More information about the mesa-commit mailing list