ARB prog: Set error instead of falling through with incorrect value
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 24 Aug 2009 19:48:01 +0000 (12:48 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 24 Aug 2009 19:51:29 +0000 (12:51 -0700)
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.

src/mesa/shader/arbprogram.c

index 39136efadac2e755de8d7f43813150a2d8887ee3..4d8cff070012b46abae9d082679e86d7af31b8dc 100644 (file)
@@ -1001,6 +1001,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;
    }
 }