mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add support for WebGL2 framebuffer attachments
Adds an initial implementation for the framebuffer attachments introduced with WebGL2 and the related enums and constrains checks.
This commit is contained in:
parent
f5ff38b875
commit
b41805a920
11 changed files with 463 additions and 433 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue