Leadwerks

11-30-2008, 01:45 AM

I am trying to find a way to reliably determine the maximum size allowed for a uniform matrix array. I have been looking at MAX_VERTEX_UNIFORM_COMPONENTS_ARB. According to the spec, this returns the maximum number of floats that can be stored in uniform values:

A vertex shader may define one or more "uniform" variables. These values

are to remain constant over a primitive or a sequence of primitives. The

OpenGL Shading Language specification defines a set of built-in uniform

variables for vertex shaders that correspond to the state that GL

manages for the purpose of processing vertices. The amount of storage

that is available for vertex shader uniform variables is specified by

the implementation dependent constant MAX_VERTEX_UNIFORM_COMPONENTS_ARB.

This value represents the number of individual floating point values, or

individual integer values or individual Boolean values that can be held

in uniform variable storage for a vertex shader. A link error will be

generated if an attempt is made to utilize more than the space available

for vertex shader uniform variables.

On my AMD 3870 that value is 512, which would only allow an array of up to 32 matrices. But I know that isn't right because my animation matrices can be up to 60 matrices on an ATI X1550, which I determined by trial and error.

Is my understanding of MAX_VERTEX_UNIFORM_COMPONENTS_ARB wrong?

A vertex shader may define one or more "uniform" variables. These values

are to remain constant over a primitive or a sequence of primitives. The

OpenGL Shading Language specification defines a set of built-in uniform

variables for vertex shaders that correspond to the state that GL

manages for the purpose of processing vertices. The amount of storage

that is available for vertex shader uniform variables is specified by

the implementation dependent constant MAX_VERTEX_UNIFORM_COMPONENTS_ARB.

This value represents the number of individual floating point values, or

individual integer values or individual Boolean values that can be held

in uniform variable storage for a vertex shader. A link error will be

generated if an attempt is made to utilize more than the space available

for vertex shader uniform variables.

On my AMD 3870 that value is 512, which would only allow an array of up to 32 matrices. But I know that isn't right because my animation matrices can be up to 60 matrices on an ATI X1550, which I determined by trial and error.

Is my understanding of MAX_VERTEX_UNIFORM_COMPONENTS_ARB wrong?