GLProgram: raise error when uniform location cannot be determined
This commit is contained in:
parent
d4a2222447
commit
e600ec871f
@ -114,7 +114,14 @@ static VALUE GLProgram_load_uniform_location(VALUE self, VALUE uniform)
|
|||||||
}
|
}
|
||||||
if (uniform_index >= 0)
|
if (uniform_index >= 0)
|
||||||
{
|
{
|
||||||
glprogram->uniforms[uniform_index] = glGetUniformLocation(glprogram->id, uniform_cstr);
|
GLint location = glGetUniformLocation(glprogram->id, uniform_cstr);
|
||||||
|
if (location < 0)
|
||||||
|
{
|
||||||
|
rb_raise(rb_eRuntimeError,
|
||||||
|
"Cannot determine uniform location for '%s'",
|
||||||
|
uniform_cstr);
|
||||||
|
}
|
||||||
|
glprogram->uniforms[uniform_index] = location;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user