webgl: Request OES_element_index_uint extension on WebGL1

Needed to support u32 index buffers.
This commit is contained in:
Mike Welsh 2021-01-06 13:01:07 -08:00
parent 63bd59c5fe
commit 8d1d2efea4
1 changed files with 6 additions and 0 deletions

View File

@ -146,6 +146,12 @@ impl WebGlRenderBackend {
.into_js_result()?
.ok_or("VAO extension not found")?
.unchecked_into::<OesVertexArrayObject>();
// On WebGL1, we need to explicitly request support for u32 index buffers.
let _ext = gl
.get_extension("OES_element_index_uint")
.into_js_result()?
.ok_or("OES_element_index_uint extension not available")?;
(gl, None, vao, 1)
} else {
return Err("Unable to create WebGL rendering context".into());