Skip to content

Commit

Permalink
change: Make Windows Intel blacklist less aggressive
Browse files Browse the repository at this point in the history
This should accomodate most generation 7 and 8 setups that don't seem to
exhibit issues, while keeping bad configs (Bay Trail and Ivy Bridge)
blacklisted.
  • Loading branch information
mrmangohands committed Jul 15, 2021
1 parent e51bcd3 commit 9c05c65
Showing 1 changed file with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import me.jellysquid.mods.sodium.client.render.chunk.shader.ChunkShaderBindingPoints;
import net.minecraft.util.Formatting;
import net.minecraft.util.Util;
import org.lwjgl.opengl.GL;
import org.lwjgl.opengl.GL20C;

import java.util.ArrayList;
Expand Down Expand Up @@ -341,9 +342,6 @@ public static boolean isSupported(boolean disableDriverBlacklist) {
GlFunctions.isInstancedArraySupported();
}

// https://www.intel.com/content/www/us/en/support/articles/000005654/graphics.html
private static final Pattern INTEL_BUILD_MATCHER = Pattern.compile("(\\d.\\d.\\d) - Build (\\d+).(\\d+).(\\d+).(\\d+)");

private static final String INTEL_VENDOR_NAME = "Intel";

/**
Expand Down Expand Up @@ -371,23 +369,11 @@ private static boolean isKnownBrokenIntelDriver() {
return false;
}

String version = GL20C.glGetString(GL20C.GL_VERSION);

// The returned version string may be null in the case of an error
if (version == null) {
return false;
}

Matcher matcher = INTEL_BUILD_MATCHER.matcher(version);

// If the version pattern doesn't match, assume we're dealing with something special
if (!matcher.matches()) {
return false;
//This is the best approximation we have of the set of drivers that aren't broken.
if (GL.getCapabilities().OpenGL43 && System.getProperty("os.name") == "Windows 10") {
return true;
}

// Anything with a major build of >=100 is GPU Gen8 or newer
// The fourth group is the major build number
return Integer.parseInt(matcher.group(4)) < 100;
return false;
}

@Override
Expand Down

0 comments on commit 9c05c65

Please sign in to comment.