Class GlCompat

java.lang.Object
dev.engine_room.flywheel.backend.gl.GlCompat

public final class GlCompat extends Object
  • Field Details

    • CAPABILITIES

      public static final @UnknownNullability org.lwjgl.opengl.GLCapabilities CAPABILITIES
    • GL_VENDOR_STRING

      public static final String GL_VENDOR_STRING
    • GL_RENDERER_STRING

      public static final String GL_RENDERER_STRING
    • GL_VERSION_STRING

      public static final String GL_VERSION_STRING
    • GL_SHADING_LANGUAGE_VERSION_STRING

      public static final String GL_SHADING_LANGUAGE_VERSION_STRING
    • DRIVER

      public static final Driver DRIVER
    • SUBGROUP_SIZE

      public static final int SUBGROUP_SIZE
    • ALLOW_DSA

      public static final boolean ALLOW_DSA
      See Also:
    • MAX_GLSL_VERSION

      public static final GlslVersion MAX_GLSL_VERSION
    • SUPPORTS_DSA

      public static final boolean SUPPORTS_DSA
    • SUPPORTS_INSTANCING

      public static final boolean SUPPORTS_INSTANCING
    • SUPPORTS_INDIRECT

      public static final boolean SUPPORTS_INDIRECT
  • Method Details

    • init

      public static void init()
    • getComputeGroupCount

      public static int getComputeGroupCount(int invocations)
    • safeShaderSource

      public static void safeShaderSource(int glId, CharSequence source)
      Modified from:
      canvas

      Identical in function to GL20C.glShaderSource(int, CharSequence) but passes a null pointer for string length to force the driver to rely on the null terminator for string length. This is a workaround for an apparent flaw with some AMD drivers that don't receive or interpret the length correctly, resulting in an access violation when the driver tries to read past the string memory.

      Hat tip to fewizz for the find and the fix.

    • safeMultiDrawElementsIndirect

      public static void safeMultiDrawElementsIndirect(GlProgram drawProgram, int mode, int type, int start, int end, long stride)
      Similar in function to GL43.glMultiDrawElementsIndirect(int, int, long, int, int), but uses consecutive DI instead of MDI if MDI is known to not work well with the current driver. Unlike the original function, stride cannot be equal to 0.