aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webgl2renderingcontext.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/webgl2renderingcontext.rs')
-rw-r--r--components/script/dom/webgl2renderingcontext.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/components/script/dom/webgl2renderingcontext.rs b/components/script/dom/webgl2renderingcontext.rs
index 3f1a7e98d72..d2b3cfe8ea3 100644
--- a/components/script/dom/webgl2renderingcontext.rs
+++ b/components/script/dom/webgl2renderingcontext.rs
@@ -110,10 +110,12 @@ pub struct WebGL2RenderingContext {
default_fb_drawbuffer: Cell<u32>,
}
+// TODO: This should be in mozjs
+// upstream: https://searchfox.org/mozilla-central/source/js/public/ScalarType.h#66
fn typedarray_elem_size(typeid: Type) -> usize {
match typeid {
Type::Int8 | Type::Uint8 | Type::Uint8Clamped => 1,
- Type::Int16 | Type::Uint16 => 2,
+ Type::Int16 | Type::Uint16 | Type::Float16 => 2,
Type::Int32 | Type::Uint32 | Type::Float32 => 4,
Type::Int64 | Type::Float64 => 8,
Type::BigInt64 | Type::BigUint64 => 8,