Skip to content

Commit

Permalink
fix: Use compatible shader version for Angle backend
Browse files Browse the repository at this point in the history
  • Loading branch information
crykn committed Mar 2, 2024
1 parent 64174ec commit d6067a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.scenes.scene2d.utils.UIUtils;

import de.damios.guacamole.gdx.graphics.ShaderProgramFactory;
import de.damios.guacamole.gdx.reflection.ReflectionUtils;

/**
* This class allows programmatically porting GLSL shader code from version 120
Expand Down Expand Up @@ -111,6 +111,11 @@ public static boolean mustUse32CShader() {
}

public static String getDefaultShaderVersion() {
if (ReflectionUtils.getClassByNameOrNull(
"com.badlogic.gdx.backends.lwjgl3.awt.GlfwAWTLoader") != null)
return "100"; // ANGLE, see
// https://github.com/google/angle/blob/0ed0de4f0b7f5a81fbe35b28e6a68a739f365556/src/compiler/translator/DirectiveHandler.cpp#L285

if (mustUse32CShader())
return "150"; // macOS 3.2 core profile

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

import de.damios.guacamole.Exceptions;
import de.damios.guacamole.Preconditions;
import de.damios.guacamole.annotations.GwtIncompatible;
import de.damios.guacamole.gdx.log.Logger;
import de.damios.guacamole.gdx.log.LoggerService;

Expand Down

0 comments on commit d6067a8

Please sign in to comment.