Class GlVaoSafety

java.lang.Object
com.hbm_m.client.render.GlVaoSafety

public final class GlVaoSafety extends Object
Helpers for core-profile VAO rules.

Binding a shared empty "dummy" VAO instead of VAO 0 breaks vanilla and Iris draws (drawElements can crash the GL driver) because the dummy has no vertex buffers or element array. Use bindVertexArray(int) for normal restore/unbind; reserve withAttribEditVao(Runnable) only when code must call glVertexAttribPointer / glEnableVertexAttribArray and the current binding is 0.

  • Method Details

    • getDummyVao

      public static int getDummyVao()
    • bindVertexArray

      public static void bindVertexArray(int vao)
      Exact VAO bind, including 0 (unbind).
    • currentBinding

      public static int currentBinding()
    • withAttribEditVao

      public static void withAttribEditVao(Runnable work)
      Runs work with a non-zero VAO bound so attrib pointer setup is legal. Restores the previous VAO and ARRAY_BUFFER binding afterward.