Invalidate all WebGLUniformLocation values on program relink

This commit is contained in:
Anthony Ramine 2018-07-19 11:01:37 +02:00
parent 8fabc6660a
commit b64232d77b
4 changed files with 36 additions and 15 deletions

View file

@ -436,7 +436,10 @@ impl WebGLRenderingContext {
None => return,
};
match self.current_program.get() {
Some(ref program) if program.id() == location.program_id() => {}
Some(ref program) if
program.id() == location.program_id() &&
program.link_generation() == location.link_generation()
=> {}
_ => return self.webgl_error(InvalidOperation),
}
handle_potential_webgl_error!(self, f(location));
@ -3612,7 +3615,12 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
) -> JSVal {
// FIXME(nox): https://github.com/servo/servo/issues/21133
if program.is_deleted() || !program.is_linked() || program.id() != location.program_id() {
if
program.is_deleted() ||
!program.is_linked() ||
program.id() != location.program_id() ||
program.link_generation() != location.link_generation()
{
self.webgl_error(InvalidOperation);
return NullValue();
}