Class GlCompat
java.lang.Object
dev.engine_room.flywheel.backend.gl.GlCompat
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final @UnknownNullability org.lwjgl.opengl.GLCapabilitiesstatic final Driverstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final GlslVersionstatic final intstatic final booleanstatic final booleanstatic final boolean -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetComputeGroupCount(int invocations) static voidinit()static voidsafeMultiDrawElementsIndirect(GlProgram drawProgram, int mode, int type, int start, int end, long stride) Similar in function toGL43.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.static voidsafeShaderSource(int glId, CharSequence source) Modified from:
canvas
-
Field Details
-
CAPABILITIES
public static final @UnknownNullability org.lwjgl.opengl.GLCapabilities CAPABILITIES -
GL_VENDOR_STRING
-
GL_RENDERER_STRING
-
GL_VERSION_STRING
-
GL_SHADING_LANGUAGE_VERSION_STRING
-
DRIVER
-
SUBGROUP_SIZE
public static final int SUBGROUP_SIZE -
ALLOW_DSA
public static final boolean ALLOW_DSA- See Also:
-
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
Modified from:
canvasIdentical 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 toGL43.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.
-