webgl: Update FBO status when textures or RBs are reallocated.

FBO status is supposed to depend on the size of the attachments all
matching, so we need to re-check when it changes.  We don't ensure
matching yet, but this will prevent regressions when we do.
This commit is contained in:
Eric Anholt 2016-11-01 21:45:29 -07:00
parent 8e681dddc1
commit d77373654a
2 changed files with 45 additions and 8 deletions

View file

@ -465,7 +465,11 @@ impl WebGLRenderingContext {
self.ipc_renderer
.send(CanvasMsg::WebGL(msg))
.unwrap()
.unwrap();
if let Some(fb) = self.bound_framebuffer.get() {
fb.invalidate_texture(&*texture);
}
}
fn tex_sub_image_2d(&self,
@ -2621,7 +2625,12 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
match self.bound_renderbuffer.get() {
Some(rb) => handle_potential_webgl_error!(self, rb.storage(internal_format, width, height)),
Some(rb) => {
handle_potential_webgl_error!(self, rb.storage(internal_format, width, height));
if let Some(fb) = self.bound_framebuffer.get() {
fb.invalidate_renderbuffer(&*rb);
}
}
None => self.webgl_error(InvalidOperation),
};