Implement instanced WebGL drawing calls (part of #20791)

This commit is contained in:
Anthony Ramine 2018-03-20 10:11:46 +01:00
parent 0aefffc5bf
commit 4e6eea221a
12 changed files with 432 additions and 125 deletions

View file

@ -973,6 +973,15 @@ impl WebGLImpl {
WebGLCommand::UseProgram(program_id) => {
ctx.gl().use_program(program_id.map_or(0, |p| p.get()))
}
WebGLCommand::DrawArraysInstanced { mode, first, count, primcount } => {
ctx.gl().draw_arrays_instanced(mode, first, count, primcount)
}
WebGLCommand::DrawElementsInstanced { mode, count, type_, offset, primcount } => {
ctx.gl().draw_elements_instanced(mode, count, type_, offset, primcount)
}
WebGLCommand::VertexAttribDivisor { index, divisor } => {
ctx.gl().vertex_attrib_divisor(index, divisor)
}
}
// TODO: update test expectations in order to enable debug assertions