Class InstancedGlCompat

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

public final class InstancedGlCompat extends Object
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 Details

    • supportsInstancedAttributeDivisor

      public static boolean supportsInstancedAttributeDivisor()
      Checks whether the current GL context supports both glVertexAttribDivisor (core or ARB) and glDrawElementsInstanced (core or ARB).

      Without a bound GLFW context, returns false to avoid stale TLS capabilities left by Sodium/Iris worker threads.

    • glVertexAttribDivisorCompat

      public static void glVertexAttribDivisorCompat(int index, int divisor)
      Core GL 3.3 divisor, otherwise ARBInstancedArrays. Must agree with the check in supportsInstancedAttributeDivisor().
    • glDrawElementsInstancedCompat

      public static void glDrawElementsInstancedCompat(int mode, int count, int type, long indices, int primcount)
      Core GL 3.1 draw instanced, otherwise ARBDrawInstanced.