Use GLSM instead of relying on the redirector

This commit is contained in:
Jason Mitchell authored and Jason Mitchell committed 2026-03-21 10:56:19 -07:00
1 parent 70cfa2ae90
commit 5f61e387fb
84 files changed
+628 -1140

No files matched your search

@@ -12,6 +12,7 @@ import net.coderbot.iris.texture.format.TextureFormat;
import net.coderbot.iris.texture.format.TextureFormatLoader;
import net.coderbot.iris.uniforms.VanillaBiomeList;
import net.minecraft.world.biome.BiomeGenBase;
import com.gtnewhorizons.angelica.glsm.GLStateManager;
import org.lwjgl.LWJGLUtil;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL20;
@@ -146,7 +147,7 @@ public class StandardMacros {
* @see <a href="https://github.com/sp614x/optifine/blob/9c6a5b5326558ccc57c6490b66b3be3b2dc8cbef/OptiFineDoc/doc/shaders.txt#L705-L707">Optifine Doc for GLSL Version</a>
*/
public static String getGlVersion(int name) {
final String info = GL11.glGetString(name);
final String info = GLStateManager.glGetString(name);
Matcher matcher = SEMVER_PATTERN.matcher(Objects.requireNonNull(info));
@@ -208,7 +209,7 @@ public class StandardMacros {
* @see <a href="https://github.com/sp614x/optifine/blob/9c6a5b5326558ccc57c6490b66b3be3b2dc8cbef/OptiFineDoc/doc/shaders.txt#L716-L723">Optifine Doc</a>
*/
public static String getVendor() {
String vendor = Objects.requireNonNull(GL11.glGetString(GL11.GL_VENDOR)).toLowerCase(Locale.ROOT);
String vendor = Objects.requireNonNull(GLStateManager.glGetString(GL11.GL_VENDOR)).toLowerCase(Locale.ROOT);
if (vendor.startsWith("ati")) {
return "MC_GL_VENDOR_ATI";
} else if (vendor.startsWith("intel")) {
@@ -230,7 +231,7 @@ public class StandardMacros {
* @see <a href="https://github.com/sp614x/optifine/blob/9c6a5b5326558ccc57c6490b66b3be3b2dc8cbef/OptiFineDoc/doc/shaders.txt#L725-L733">Optifine Doc</a>
*/
public static String getRenderer() {
String renderer = Objects.requireNonNull(GL11.glGetString(GL11.GL_RENDERER)).toLowerCase(Locale.ROOT);
String renderer = Objects.requireNonNull(GLStateManager.glGetString(GL11.GL_RENDERER)).toLowerCase(Locale.ROOT);
if (renderer.startsWith("amd")) {
return "MC_GL_RENDERER_RADEON";
} else if (renderer.startsWith("ati")) {
@@ -263,10 +264,10 @@ public class StandardMacros {
* @see <a href="https://github.com/sp614x/optifine/blob/9c6a5b5326558ccc57c6490b66b3be3b2dc8cbef/OptiFineDoc/doc/shaders.txt#L735-L738">Optifine Doc</a>
*/
public static Set<String> getGlExtensions() {
int numExtensions = GL11.glGetInteger(GL30.GL_NUM_EXTENSIONS);
int numExtensions = GLStateManager.glGetInteger(GL30.GL_NUM_EXTENSIONS);
String[] extensions = new String[numExtensions];
for (int i = 0; i < numExtensions; i++) {
extensions[i] = GL30.glGetStringi(GL11.GL_EXTENSIONS, i);
extensions[i] = GLStateManager.glGetStringi(GL11.GL_EXTENSIONS, i);
}
// TODO note that we do not add extensions based on if the shader uses them and if they are supported