mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Allow binding the null buffer in vertexAttribPointer if offset is 0
This commit is contained in:
parent
0ba66f9f12
commit
7f9d560f28
3 changed files with 10 additions and 11 deletions
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue