panic!("Draw elements instanced base vertex is not supported");

    unsafe fn draw_elements_instanced_base_vertex(
        _mode: u32,
        _count: i32,
        _element_type: u32,
        _offset: i32,
        _instance_count: i32,
        _base_vertex: i32,
    ) {
        panic!("Draw elements instanced base vertex is not supported");

I understand what draw instanced in OpenGL/WebGL is. I don't understand the above error (and how to work around it). Can someone explain what the above problem is with WebGL2 and how to route around it? (Rust on wasm32 on Chrome).


WebGL2 is a binding of OpenGL ES 3.0 into the web platform; glDrawElementsInstancedBaseVertex is part of OpenGL ES 3.2, and as such is not available in WebGL1 or WebGL2.

You'll need to write your code to use draw_elements_instanced instead of draw_elements_instanced_base_vertex, since you need to stick to APIs available in OpenGL 3.0.

Is there a WebGL2 ext that adds this feature? I'm looking through WebGL Extension Registry and not finding it.

As far as I'm aware, no. While there's for OpenGL ES 3.0, it's not been ported over to WebGL, and WebGL remains on plain OpenGL ES 3.0, not 3.2.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.