Package com.hbm_m.client.render
Class GlVaoSafety
java.lang.Object
com.hbm_m.client.render.GlVaoSafety
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 Summary
Modifier and TypeMethodDescriptionstatic voidbindVertexArray(int vao) Exact VAO bind, including0(unbind).static intstatic intstatic voidwithAttribEditVao(Runnable work) Runsworkwith a non-zero VAO bound so attrib pointer setup is legal.
-
Method Details
-
getDummyVao
public static int getDummyVao() -
bindVertexArray
public static void bindVertexArray(int vao) Exact VAO bind, including0(unbind). -
currentBinding
public static int currentBinding() -
withAttribEditVao
Runsworkwith a non-zero VAO bound so attrib pointer setup is legal. Restores the previous VAO and ARRAY_BUFFER binding afterward.
-