mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-02-28 20:54:40 +01:00
Improve Iris compatibility
- Use config-based areShadersEnabled when choosing the engine
This commit is contained in:
parent
8fcc1df383
commit
e48ecccf32
4 changed files with 16 additions and 3 deletions
|
@ -77,7 +77,7 @@ public class Backend {
|
|||
FlwEngine preferredChoice = FlwConfig.get()
|
||||
.getEngine();
|
||||
|
||||
boolean usingShaders = IrisShaderHandler.isShaderPackInUse();
|
||||
boolean usingShaders = IrisShaderHandler.areShadersEnabled();
|
||||
boolean canUseEngine = switch (preferredChoice) {
|
||||
case OFF -> true;
|
||||
case BATCHING -> !usingShaders;
|
||||
|
|
|
@ -19,6 +19,10 @@ public class IrisShaderHandler {
|
|||
private IrisShaderHandler() {
|
||||
}
|
||||
|
||||
public static boolean areShadersEnabled() {
|
||||
return HANDLER.areShadersEnabled();
|
||||
}
|
||||
|
||||
public static boolean isShaderPackInUse() {
|
||||
return HANDLER.isShaderPackInUse();
|
||||
}
|
||||
|
@ -28,6 +32,10 @@ public class IrisShaderHandler {
|
|||
}
|
||||
|
||||
private interface InternalHandler {
|
||||
default boolean areShadersEnabled() {
|
||||
return false;
|
||||
};
|
||||
|
||||
default boolean isShaderPackInUse() {
|
||||
return false;
|
||||
};
|
||||
|
@ -38,6 +46,11 @@ public class IrisShaderHandler {
|
|||
}
|
||||
|
||||
private static class InternalHandlerImpl implements InternalHandler {
|
||||
@Override
|
||||
public boolean areShadersEnabled() {
|
||||
return IrisApi.getInstance().getConfig().areShadersEnabled();
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean isShaderPackInUse() {
|
||||
return IrisApi.getInstance().isShaderPackInUse();
|
||||
|
|
Loading…
Add table
Reference in a new issue