webgl: Re-check FBO status on binding an FBO.

When the FBO has been unbound, anything that happened to its
attachments (deletion, new binding, reallocation) may have caused it
to change status.

This doesn't change any test results currently, because we're not
checking if the attachments are deleted, the wrong size, or have
appropriate formats.
This commit is contained in:
Eric Anholt 2016-10-06 23:15:42 -07:00
parent dba7d5eb51
commit 71d266052b

View file

@ -89,6 +89,11 @@ impl WebGLFramebuffer {
}
pub fn bind(&self, target: u32) {
// Update the framebuffer status on binding. It may have
// changed if its attachments were resized or deleted while
// we've been unbound.
self.update_status();
self.target.set(Some(target));
let cmd = WebGLCommand::BindFramebuffer(target, WebGLFramebufferBindingRequest::Explicit(self.id));
self.renderer.send(CanvasMsg::WebGL(cmd)).unwrap();