diff options
author | Alex Touchet <alextouchet@outlook.com> | 2018-09-11 09:06:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 09:06:42 -0700 |
commit | 025b5550fc6f1fd74605b09973ffc606dae7432c (patch) | |
tree | 7dfb1026318b7a0135273b667d3f44e3ee8d737d /components/script/dom/webglvertexarrayobjectoes.rs | |
parent | 9a7e1d17f0e054cb9f7eaafeee943a2ec5bc5e26 (diff) | |
parent | 049eb6887e29d8409b1dfe55bc31803f1c3220da (diff) | |
download | servo-025b5550fc6f1fd74605b09973ffc606dae7432c.tar.gz servo-025b5550fc6f1fd74605b09973ffc606dae7432c.zip |
Merge branch 'master' into tidy
Diffstat (limited to 'components/script/dom/webglvertexarrayobjectoes.rs')
-rw-r--r-- | components/script/dom/webglvertexarrayobjectoes.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/components/script/dom/webglvertexarrayobjectoes.rs b/components/script/dom/webglvertexarrayobjectoes.rs index c717108b2aa..ca13b2833f5 100644 --- a/components/script/dom/webglvertexarrayobjectoes.rs +++ b/components/script/dom/webglvertexarrayobjectoes.rs @@ -124,8 +124,15 @@ impl WebGLVertexArrayObjectOES { } let context = self.upcast::<WebGLObject>().context(); - let buffer = context.array_buffer().ok_or(WebGLError::InvalidOperation)?; - buffer.increment_attached_counter(); + let buffer = context.array_buffer(); + match buffer { + Some(ref buffer) => buffer.increment_attached_counter(), + None if offset != 0 => { + // https://github.com/KhronosGroup/WebGL/pull/2228 + return Err(WebGLError::InvalidOperation) + }, + _ => {}, + } context.send_command(WebGLCommand::VertexAttribPointer( index, size, @@ -146,7 +153,7 @@ impl WebGLVertexArrayObjectOES { normalized, stride: stride as u8, offset: offset as u32, - buffer: Some(Dom::from_ref(&*buffer)), + buffer: buffer.map(|b| Dom::from_ref(&*b)), divisor: data.divisor, }; |