mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
webgl: Ensure that renderbuffers have been bound before attaching to a framebuffer.
This commit is contained in:
parent
bb8d9ba74c
commit
8ede221a83
2 changed files with 6 additions and 2 deletions
|
@ -274,7 +274,7 @@ impl WebGLFramebuffer {
|
|||
|
||||
let rb_id = match rb {
|
||||
Some(rb) => {
|
||||
rb.attach(self);
|
||||
rb.attach(self)?;
|
||||
*binding.borrow_mut() = Some(WebGLFramebufferAttachment::Renderbuffer(Dom::from_ref(rb)));
|
||||
Some(rb.id())
|
||||
}
|
||||
|
|
|
@ -174,8 +174,12 @@ impl WebGLRenderbuffer {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn attach(&self, framebuffer: &WebGLFramebuffer) {
|
||||
pub fn attach(&self, framebuffer: &WebGLFramebuffer) -> WebGLResult<()> {
|
||||
if !self.ever_bound.get() {
|
||||
return Err(WebGLError::InvalidOperation);
|
||||
}
|
||||
self.attached_framebuffers.borrow_mut().push(Dom::from_ref(framebuffer));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn unattach(&self, fb: &WebGLFramebuffer) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue