Reputation: 95
I've just read through this answer and its comments and have some related questions:
Upvotes: 2
Views: 456
Reputation: 22168
No, these rules do not apply to uniforms. Consequently, you are not allowed to call glUniform3fv
on a vec4
.
The Spec states in Section 7.6.1:
For all [...] uniform types loadable with Uniform* commands, the command used must match the size and type of the uniform, as declared in the shader, and no type conversions are done.
Upvotes: 3
Reputation: 40842
The specs in (7.6. UNIFORMVARIABLES) say that the Uniform*
would result in INVALID_OPERATION
error if:
the size indicated in the name of the
Uniform*
command used does not match the size of the uniform declared in the shader,
or
the component type and count indicated in the name of the
Uniform*
command used does not match the type of the uniform declared in the shader, where a boolean uniform component type is considered to match any of theUniform*i{v}
,Uniform*ui{v}
, orUniform*f{v}
commands.
And testing to call glUniform3f
for a vec4
uniform will indeed result in a INVALID_OPERATION
error.
Upvotes: 4