aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglrenderingcontext.rs
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-03-30 13:59:05 -0400
committerGitHub <noreply@github.com>2020-03-30 13:59:05 -0400
commit69004e43ddf4800b3db3d86ec58b0224a602457a (patch)
tree5896a8dd6376b0c0e680c98bcd30d0be0b256818 /components/script/dom/webglrenderingcontext.rs
parent236762880c48263f8fa2c5a4deb9cf8f7746013c (diff)
parentbfa43fbeba1ffb1adca44d18bb22dbee81069af9 (diff)
downloadservo-69004e43ddf4800b3db3d86ec58b0224a602457a.tar.gz
servo-69004e43ddf4800b3db3d86ec58b0224a602457a.zip
Auto merge of #26025 - szeged:webgl_draw_range_elements, r=jdm
Add support for DrawRangeElements in WebGL2 Adds initial support for the WebGL2 `DrawRangeElements` call. <!-- Please describe your changes on the following line: --> I have started working on this function, but not sure how could I check for the Uniform Block Backing (https://www.khronos.org/registry/webgl/specs/latest/2.0/#ACTIVE_UNIFORM_BLOCK_BACKING). I am looking for some advice. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes cc @mmatyas @zakorgy @jdm <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
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 5f95618aa05..33000497abf 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 {