Re: [Mesa3d-dev] glxinfo -l ARB prog errors
On Sat, Feb 20, 2010 at 9:32 AM, Xavier Chantry chantry.xav...@gmail.com wrote: On Sat, Feb 20, 2010 at 5:22 PM, Brian Paul brian.e.p...@gmail.com wrote: On Fri, Feb 19, 2010 at 7:34 PM, Xavier Chantry chantry.xav...@gmail.com wrote: It seems the commit below will always report an user error when glxinfo -l is called. And indeed I always get the following : $ glxinfo -l ... GL_VERTEX_PROGRAM_ARB: ... Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Should glxinfo be fixed to avoid this error ? We could just put the fragment program only parameter in its own list, and not use them when target is vertex program. Well, normally GL errors aren't reported to stderr so most people running non-debug builds won't see those. But yeah, we probably shouldn't generate the errors anyway. Feel free to write a patch to glxinfo... I only realized yesterday that non-debug was the reason other people (and some of my systems) didn't show these errors. It had been bugging me for a while :) Attached patch should fix it. Thanks. I'll commit it soon. -Brian -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
Re: [Mesa3d-dev] glxinfo -l ARB prog errors
On Fri, Feb 19, 2010 at 7:34 PM, Xavier Chantry chantry.xav...@gmail.com wrote: It seems the commit below will always report an user error when glxinfo -l is called. And indeed I always get the following : $ glxinfo -l ... GL_VERTEX_PROGRAM_ARB: ... Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Should glxinfo be fixed to avoid this error ? We could just put the fragment program only parameter in its own list, and not use them when target is vertex program. Well, normally GL errors aren't reported to stderr so most people running non-debug builds won't see those. But yeah, we probably shouldn't generate the errors anyway. Feel free to write a patch to glxinfo... -Brian -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
Re: [Mesa3d-dev] glxinfo -l ARB prog errors
On Sat, Feb 20, 2010 at 5:22 PM, Brian Paul brian.e.p...@gmail.com wrote: On Fri, Feb 19, 2010 at 7:34 PM, Xavier Chantry chantry.xav...@gmail.com wrote: It seems the commit below will always report an user error when glxinfo -l is called. And indeed I always get the following : $ glxinfo -l ... GL_VERTEX_PROGRAM_ARB: ... Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Should glxinfo be fixed to avoid this error ? We could just put the fragment program only parameter in its own list, and not use them when target is vertex program. Well, normally GL errors aren't reported to stderr so most people running non-debug builds won't see those. But yeah, we probably shouldn't generate the errors anyway. Feel free to write a patch to glxinfo... I only realized yesterday that non-debug was the reason other people (and some of my systems) didn't show these errors. It had been bugging me for a while :) Attached patch should fix it. From 6bbb70ec1fdd88997afbb31c5308395a09b5dd88 Mon Sep 17 00:00:00 2001 From: Xavier Chantry chantry.xav...@gmail.com Date: Sat, 20 Feb 2010 03:45:15 +0100 Subject: [PATCH] glxinfo: Fix User error in glGetProgramivARB glxinfo needed fixing after commit 4bccd69. Move fragment program only parameters into their own list so that they are not queried for a vertex program. Signed-off-by: Xavier Chantry chantry.xav...@gmail.com --- progs/xdemos/glxinfo.c | 21 + 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c index d871088..cad365c 100644 --- a/progs/xdemos/glxinfo.c +++ b/progs/xdemos/glxinfo.c @@ -171,7 +171,7 @@ print_program_limits(GLenum target) GLenum token; const char *name; }; - static const struct token_name limits[] = { + static const struct token_name common_limits[] = { { GL_MAX_PROGRAM_INSTRUCTIONS_ARB, GL_MAX_PROGRAM_INSTRUCTIONS_ARB }, { GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB }, { GL_MAX_PROGRAM_TEMPORARIES_ARB, GL_MAX_PROGRAM_TEMPORARIES_ARB }, @@ -184,6 +184,9 @@ print_program_limits(GLenum target) { GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB, GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB }, { GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB, GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB }, { GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB }, + { (GLenum) 0, NULL } + }; + static const struct token_name fragment_limits[] = { { GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB, GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB }, { GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB, GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB }, { GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB, GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB }, @@ -192,8 +195,10 @@ print_program_limits(GLenum target) { GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB, GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB }, { (GLenum) 0, NULL } }; + PFNGLGETPROGRAMIVARBPROC GetProgramivARB_func = (PFNGLGETPROGRAMIVARBPROC) glXGetProcAddressARB((GLubyte *) glGetProgramivARB); + GLint max[1]; int i; @@ -207,12 +212,20 @@ print_program_limits(GLenum target) return; /* something's wrong */ } - for (i = 0; limits[i].token; i++) { - GetProgramivARB_func(target, limits[i].token, max); + for (i = 0; common_limits[i].token; i++) { + GetProgramivARB_func(target, common_limits[i].token, max); if (glGetError() == GL_NO_ERROR) { - printf(%s = %d\n, limits[i].name, max[0]); + printf(%s = %d\n, common_limits[i].name, max[0]); } } + if (target == GL_FRAGMENT_PROGRAM_ARB) { + for (i = 0; fragment_limits[i].token; i++) { + GetProgramivARB_func(target, fragment_limits[i].token, max); + if (glGetError() == GL_NO_ERROR) { + printf(%s = %d\n, fragment_limits[i].name, max[0]); + } + } + } #endif /* GL_ARB_vertex_program / GL_ARB_fragment_program */ } -- 1.7.0 -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
[Mesa3d-dev] glxinfo -l ARB prog errors
It seems the commit below will always report an user error when glxinfo -l is called. And indeed I always get the following : $ glxinfo -l ... GL_VERTEX_PROGRAM_ARB: ... Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname) Should glxinfo be fixed to avoid this error ? We could just put the fragment program only parameter in its own list, and not use them when target is vertex program. commit 4bccd693a72a0b42dffc849034263a68e779ca91 Author: Ian Romanick ian.d.roman...@intel.com Date: Mon Aug 24 12:48:01 2009 -0700 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. diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 39136ef..4d8cff0 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -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; } } -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev