[Public WebGL] Uniform*fv and arrays

Kenneth Russell [email protected]
Wed Feb 16 14:14:23 PST 2011

On Wed, Feb 16, 2011 at 10:33 AM, Vladimir Vukicevic
<[email protected]> wrote:
> ----- Original Message -----
>> Hi,
>> a while ago we had a discussion about the count to uniform*fv and did
>> some changes to how that was calculated. In the same discussion we
>> also
>> talked about how to handle arrays of length 1. If I remember correctly
>> we said that for example "uniform2fv(loc, [0, 1])" should be OK if the
>> uniform is declared as "float foo[1]", but fail with invalid_operation
>> if it was declared as "float foo".
>> At the moment we have two conformance tests which checks that setting
>> non array uniforms with count > 1 succeeds, which does not seem to match
>> the spec. I'm planning to change that and also add a test for arrays of
>> length 1. I just want to make sure I remember this stuff correctly
>> before doing so.
> Hmm.. I don't remember this part, though it would be nice to do.  Problem is
> that I don't know if we can determine when something is foo[1] or foo -- they
> both show up as GL_FLOAT and "length 1" from GetActiveUniform.

Yes, this is an ambiguity in the OpenGL APIs. The ANGLE shader
validator provides more detailed information about the uniforms in
compiled programs. I believe that Chrome's command buffer OpenGL code
uses this information; Gregg as the author can comment further.

To be compliant to the OpenGL ES 2.0 spec, these conformance tests
should be changed to require that INVALID_OPERATION is generated if
more than one element is passed down for a scalar uniform.


You are currently subscribed to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
unsubscribe public_webgl

More information about the public_webgl mailing list