mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Add support for DrawRangeElements in WebGL2
Adds initial support for the WebGL2 `DrawRangeElements` call.
This commit is contained in:
parent
c3ecf2ecef
commit
bfa43fbeba
8 changed files with 216 additions and 108 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue