diff --git a/build.gradle b/build.gradle index af1a0da87..743d79717 100644 --- a/build.gradle +++ b/build.gradle @@ -94,7 +94,6 @@ sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { maven { - //location of the maven for mixed mappings and registrate name "tterrag maven" url "https://maven.tterrag.com/" } diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlShader.java b/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlShader.java index 09fbe99bb..cf8dafa5b 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlShader.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/shader/GlShader.java @@ -15,25 +15,22 @@ public class GlShader extends GlObject { public final ShaderType type; public GlShader(Shader shader) { - this(shader.type, shader.name, shader.getSource()); - } + this.type = shader.type; + this.name = shader.name; + int handle = GL20.glCreateShader(shader.type.glEnum); - public GlShader(ShaderType type, ResourceLocation name, String source) { - this.type = type; - this.name = name; - int handle = GL20.glCreateShader(type.glEnum); - - GlCompat.safeShaderSource(handle, source); + GlCompat.safeShaderSource(handle, shader.getSource()); GL20.glCompileShader(handle); String log = GL20.glGetShaderInfoLog(handle); if (!log.isEmpty()) { - Backend.log.error("Shader compilation log for " + name + ": " + log); + Backend.log.error("Shader compilation log for " + shader.name + ": " + log); + Backend.log.error(shader.printSource()); } if (GL20.glGetShaderi(handle, GL20.GL_COMPILE_STATUS) != GL20.GL_TRUE) { - throw new RuntimeException("Could not compile " + name + ". See log for details."); + throw new RuntimeException("Could not compile " + shader.name + ". See log for details."); } setHandle(handle); diff --git a/src/main/java/com/jozufozu/flywheel/backend/loading/Shader.java b/src/main/java/com/jozufozu/flywheel/backend/loading/Shader.java index 32ac93007..c27f4183d 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/loading/Shader.java +++ b/src/main/java/com/jozufozu/flywheel/backend/loading/Shader.java @@ -135,12 +135,18 @@ public class Shader { }); } - public void printSource() { - Backend.log.debug("Source for shader '" + name + "':"); + public String printSource() { + StringBuilder builder = new StringBuilder(); + + builder.append("Source for shader '").append(name).append("':\n"); int i = 1; for (String s : source.split("\n")) { - Backend.log.debug(String.format("%1$4s: ", i++) + s); + builder.append(String.format("%1$4s: ", i++)) + .append(s) + .append('\n'); } + + return builder.toString(); } public static Stream lines(String s) {