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

Brian Paul brian.e.paul at gmail.com
Tue Aug 30 13:10:14 PDT 2011


On Tue, Aug 30, 2011 at 11:58 AM, Ian Romanick <idr at freedesktop.org> wrote:
> -----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?

softpipe:
        GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 16384
        GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 2147483647
        GL_MAX_PROGRAM_TEMPORARIES_ARB = 256
        GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 128
        GL_MAX_PROGRAM_PARAMETERS_ARB = 4096
        GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 4096
        GL_MAX_PROGRAM_ATTRIBS_ARB = 16
        GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 17
        GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 1
        GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 1
        GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 1024
        GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 256


> 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

Looks like we're not even setting the LOCAL/ENV limits in gallium and
just using defaults.  Funny it hasn't been noticed until now.


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

The patch series works here for softpipe/llvmpipe but swrast fails
because the native limits are all zero.  swrast isn't filling them in.
 Again, funny it hasn't been noticed until now.

I'll work on some Mesa/gallium patches...

-Brian


More information about the Piglit mailing list