mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-03 02:10:24 +01:00
Only glUniform1i() can be used to set sampler uniforms. Generate error otherwise.
This commit is contained in:
parent
a90e4c3ddf
commit
fee9bbe475
1 changed files with 14 additions and 0 deletions
|
|
@ -891,8 +891,22 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
|
|||
|
||||
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
|
||||
|
||||
/*
|
||||
* If we're setting a sampler, we must use glUniformi1()!
|
||||
*/
|
||||
if (shProg->Uniforms->Parameters[location].Type == PROGRAM_SAMPLER) {
|
||||
if (type != GL_INT || count != 1) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glUniform(only glUniform1i can be used "
|
||||
"to set sampler uniforms)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
uniformVal = shProg->Uniforms->ParameterValues[location];
|
||||
|
||||
/* XXX obey 'count' parameter! */
|
||||
|
||||
if (type == GL_INT ||
|
||||
type == GL_INT_VEC2 ||
|
||||
type == GL_INT_VEC3 ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue