[Piglit] [PATCH] vp-max-array: fix incorrect program parameters query

Ian Romanick idr at freedesktop.org
Tue Aug 30 10:58:58 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/30/2011 09:56 AM, Brian Paul wrote:
> The vertex program declares a local parameter array of a certain size
> but we were querying GL_MAX_PROGRAM_PARAMETERS_ARB instead of
> GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB to get the local parameter limit.

The test may be wrong, but I don't think it's wrong in that particular
way.  I wrote this test with the intention of validating this line of
the ARB_vertex_program spec:

    "The limit on vertex program parameter bindings can be queried with
    a <pname> of MAX_PROGRAM_PARAMETERS_ARB, and must be at least 96."

Since MAX_PROGRAM_LOCAL_PARAMETERS_ARB also has to be at least 96, I
foolishly assumed that the local parameters could always be used to fill
all of the total program parameters.

> This fixes Mesa bug https://bugs.freedesktop.org/show_bug.cgi?id=40405

Any idea what the 'glxinfo -l' output is on the failing system?  It
seems really weird that MAX_PROGRAM_LOCAL_PARAMETERS_ARB would be
smaller than MAX_PROGRAM_PARAMETERS_ARB.  I can envision apps having
problems with that too.  For reference, on my i965 system I get:

    GL_VERTEX_PROGRAM_ARB:
        GL_MAX_PROGRAM_PARAMETERS_ARB = 1024
        GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 1024
        GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 1024
        GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 256

I'll send out some patches that fix the problems with the test and make
it more complete.

> ---
>  tests/shaders/vp-max-array.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/shaders/vp-max-array.c b/tests/shaders/vp-max-array.c
> index 67c8c3a..b0e541d 100644
> --- a/tests/shaders/vp-max-array.c
> +++ b/tests/shaders/vp-max-array.c
> @@ -65,11 +65,11 @@ piglit_init(int argc, char **argv)
>  	piglit_require_vertex_program();
>  
>  	glGetProgramivARB(GL_VERTEX_PROGRAM_ARB,
> -			  GL_MAX_PROGRAM_PARAMETERS_ARB,
> +			  GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB,
>  			  & max_parameters);
>  	if (max_parameters < 96) {
>  		if (! piglit_automatic)
> -			printf("GL_MAX_PROGRAM_PARAMETERS_ARB < 96\n");
> +			printf("GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB < 96\n");
>  
>  		piglit_report_result(PIGLIT_FAIL);
>  	}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5dJOIACgkQX1gOwKyEAw9GRACfcy3cKsX0miCHS2lD83RYRJIk
QCQAoJxCkJgawBxYqSEzaV8pVDrhoQ3U
=rXuZ
-----END PGP SIGNATURE-----


More information about the Piglit mailing list