diff options
author | Mátyás Mustoha <matyas.mustoha@h-lab.eu> | 2020-02-14 11:57:11 +0100 |
---|---|---|
committer | Mátyás Mustoha <matyas.mustoha@h-lab.eu> | 2020-02-14 12:10:16 +0100 |
commit | 796ee705976f8072032a0fc88579ca18aed85999 (patch) | |
tree | 96f82216a560567509a08609cf22f33a127535c0 /components/script/dom/webgltexture.rs | |
parent | 833485887e9e8a4ae4beb71c473df101a4106ee4 (diff) | |
download | servo-796ee705976f8072032a0fc88579ca18aed85999.tar.gz servo-796ee705976f8072032a0fc88579ca18aed85999.zip |
Add initial support for WebGL2 read framebuffer
Adds support for binding to the read framebuffer slot and querying
its status.
Diffstat (limited to 'components/script/dom/webgltexture.rs')
-rw-r--r-- | components/script/dom/webgltexture.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/components/script/dom/webgltexture.rs b/components/script/dom/webgltexture.rs index f7d52c8708a..682f04f0bd8 100644 --- a/components/script/dom/webgltexture.rs +++ b/components/script/dom/webgltexture.rs @@ -197,15 +197,17 @@ impl WebGLTexture { } /* - If a texture object is deleted while its image is attached to the currently - bound framebuffer, then it is as if FramebufferTexture2D had been called, with - a texture of 0, for each attachment point to which this image was attached - in the currently bound framebuffer. - - GLES 2.0, 4.4.3, "Attaching Texture Images to a Framebuffer" - */ - let currently_bound_framebuffer = - self.upcast::<WebGLObject>().context().bound_framebuffer(); - if let Some(fb) = currently_bound_framebuffer { + If a texture object is deleted while its image is attached to one or more attachment + points in a currently bound framebuffer, then it is as if FramebufferTexture had been + called, with a texture of zero, for each attachment point to which this im-age was + attached in that framebuffer. In other words, this texture image is firstdetached from + all attachment points in a currently bound framebuffer. + - GLES 3.0, 4.4.2.3, "Attaching Texture Images to a Framebuffer" + */ + if let Some(fb) = context.get_draw_framebuffer_slot().get() { + let _ = fb.detach_texture(self); + } + if let Some(fb) = context.get_read_framebuffer_slot().get() { let _ = fb.detach_texture(self); } |