mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
webgl: Don't update texture attachment state if we throw an error.
If we're going to return from this function without updating the underlying GL state because of a WebGLError, we shouldn't have updated our shadow of the GL state.
This commit is contained in:
parent
59634cf78e
commit
bf5a3db745
1 changed files with 5 additions and 5 deletions
|
@ -190,11 +190,6 @@ impl WebGLFramebuffer {
|
|||
// Note, from the GLES 2.0.25 spec, page 113:
|
||||
// "If texture is zero, then textarget and level are ignored."
|
||||
Some(texture) => {
|
||||
*binding.borrow_mut() = Some(WebGLFramebufferAttachment::Texture {
|
||||
texture: JS::from_ref(texture),
|
||||
level: level }
|
||||
);
|
||||
|
||||
// From the GLES 2.0.25 spec, page 113:
|
||||
//
|
||||
// "level specifies the mipmap level of the texture image
|
||||
|
@ -234,6 +229,11 @@ impl WebGLFramebuffer {
|
|||
_ => return Err(WebGLError::InvalidOperation),
|
||||
}
|
||||
|
||||
*binding.borrow_mut() = Some(WebGLFramebufferAttachment::Texture {
|
||||
texture: JS::from_ref(texture),
|
||||
level: level }
|
||||
);
|
||||
|
||||
Some(texture.id())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue