diff options
author | Mátyás Mustoha <matyas.mustoha@h-lab.eu> | 2020-02-20 13:32:38 +0100 |
---|---|---|
committer | Mátyás Mustoha <matyas.mustoha@h-lab.eu> | 2020-02-21 11:04:30 +0100 |
commit | b41805a9206f940737c2644f73d975ae35e38f99 (patch) | |
tree | 119787334ac1d38cb73cf3a1f7cae51aedf57c29 /components/script/dom/webglrenderingcontext.rs | |
parent | f5ff38b87559cd25db44fa7bc6f2a9c4cb2264e0 (diff) | |
download | servo-b41805a9206f940737c2644f73d975ae35e38f99.tar.gz servo-b41805a9206f940737c2644f73d975ae35e38f99.zip |
Add support for WebGL2 framebuffer attachments
Adds an initial implementation for the framebuffer attachments
introduced with WebGL2 and the related enums and constrains checks.
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r-- | components/script/dom/webglrenderingcontext.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 874a089a637..ca5c08b25e3 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -276,6 +276,10 @@ impl WebGLRenderingContext { } } + pub fn webgl_version(&self) -> WebGLVersion { + self.webgl_version + } + pub fn limits(&self) -> &GLLimits { &self.limits } @@ -4266,6 +4270,15 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { return self.webgl_error(InvalidEnum); } + // From the GLES 2.0.25 spec, page 113: + // + // "level specifies the mipmap level of the texture image + // to be attached to the framebuffer and must be + // 0. Otherwise, INVALID_VALUE is generated." + if level != 0 { + return self.webgl_error(InvalidValue); + } + match self.bound_draw_framebuffer.get() { Some(fb) => handle_potential_webgl_error!( self, |