Add WebGLSampler support

Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13
This commit is contained in:
Mátyás Mustoha 2019-10-04 11:22:07 +02:00
parent 78438113d4
commit 26df1962c3
16 changed files with 394 additions and 88 deletions

View file

@ -103,16 +103,6 @@ macro_rules! handle_object_deletion {
};
}
macro_rules! optional_root_object_to_js_or_null {
($cx: expr, $binding:expr) => {{
rooted!(in($cx) let mut rval = NullValue());
if let Some(object) = $binding {
object.to_jsval($cx, rval.handle_mut());
}
rval.get()
}};
}
fn has_invalid_blend_constants(arg1: u32, arg2: u32) -> bool {
match (arg1, arg2) {
(constants::CONSTANT_COLOR, constants::CONSTANT_ALPHA) => true,
@ -4259,7 +4249,7 @@ impl Textures {
}
}
fn active_unit_enum(&self) -> u32 {
pub fn active_unit_enum(&self) -> u32 {
self.active_unit.get() + constants::TEXTURE0
}