Package com.hbm_m.client.render
Class InstancedGlCompat
java.lang.Object
com.hbm_m.client.render.InstancedGlCompat
Static GL compatibility helpers for instanced rendering.
Extracted from InstancedStaticPartRenderer to keep the main
renderer focused on batching logic. All methods are stateless and
thread-safe (they only query/call GL entry points).
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidglDrawElementsInstancedCompat(int mode, int count, int type, long indices, int primcount) Core GL 3.1 draw instanced, otherwiseARBDrawInstanced.static voidglVertexAttribDivisorCompat(int index, int divisor) Core GL 3.3 divisor, otherwiseARBInstancedArrays.static booleanChecks whether the current GL context supports bothglVertexAttribDivisor(core or ARB) andglDrawElementsInstanced(core or ARB).
-
Method Details
-
supportsInstancedAttributeDivisor
public static boolean supportsInstancedAttributeDivisor()Checks whether the current GL context supports bothglVertexAttribDivisor(core or ARB) andglDrawElementsInstanced(core or ARB).Without a bound GLFW context, returns
falseto avoid stale TLS capabilities left by Sodium/Iris worker threads. -
glVertexAttribDivisorCompat
public static void glVertexAttribDivisorCompat(int index, int divisor) Core GL 3.3 divisor, otherwiseARBInstancedArrays. Must agree with the check insupportsInstancedAttributeDivisor(). -
glDrawElementsInstancedCompat
public static void glDrawElementsInstancedCompat(int mode, int count, int type, long indices, int primcount) Core GL 3.1 draw instanced, otherwiseARBDrawInstanced.
-