aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglrenderingcontext.rs
diff options
context:
space:
mode:
authorIstvan <istvan.miklos@h-lab.eu>2020-03-18 10:53:23 +0100
committerIstvan <istvan.miklos@h-lab.eu>2020-03-30 13:55:01 +0200
commitbfa43fbeba1ffb1adca44d18bb22dbee81069af9 (patch)
tree8710396fb106aa65a34cff6c0a48ea0da5417e74 /components/script/dom/webglrenderingcontext.rs
parentc3ecf2ecef36bfc35ba75442c81d54fd2bc695be (diff)
downloadservo-bfa43fbeba1ffb1adca44d18bb22dbee81069af9.tar.gz
servo-bfa43fbeba1ffb1adca44d18bb22dbee81069af9.zip
Add support for DrawRangeElements in WebGL2
Adds initial support for the WebGL2 `DrawRangeElements` call.
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r--components/script/dom/webglrenderingcontext.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index 8e76eb552a3..476c6b5a076 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -960,7 +960,11 @@ impl WebGLRenderingContext {
let type_size = match type_ {
constants::UNSIGNED_BYTE => 1,
constants::UNSIGNED_SHORT => 2,
- constants::UNSIGNED_INT if self.extension_manager.is_element_index_uint_enabled() => 4,
+ constants::UNSIGNED_INT => match self.webgl_version() {
+ WebGLVersion::WebGL1 if self.extension_manager.is_element_index_uint_enabled() => 4,
+ WebGLVersion::WebGL2 => 4,
+ _ => return Err(InvalidEnum),
+ },
_ => return Err(InvalidEnum),
};
if offset % type_size != 0 {