Add support for WebGL2 read and draw buffer settings

Adds support for the `ReadBuffer` and `DrawBuffers`
WebGL2 calls and the related parameter getters.

See:

- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4
- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11
This commit is contained in:
Mátyás Mustoha 2020-02-25 10:47:59 +01:00
parent e8e0b70266
commit 0afe27ef18
17 changed files with 315 additions and 51 deletions

View file

@ -1510,6 +1510,11 @@ impl WebGLRenderingContext {
// FIXME: https://github.com/servo/servo/issues/13710
}
pub fn valid_color_attachment_enum(&self, attachment: u32) -> bool {
let last_slot = constants::COLOR_ATTACHMENT0 + self.limits().max_color_attachments - 1;
constants::COLOR_ATTACHMENT0 <= attachment && attachment <= last_slot
}
}
#[cfg(not(feature = "webgl_backtrace"))]