From fe2cf3355fed83a68df7de31d6e1c1df5ffa8665 Mon Sep 17 00:00:00 2001 From: douira Date: Fri, 18 Oct 2024 03:35:20 +0200 Subject: [PATCH] remove remapping and just print the errors as they are, this avoids needing to --- .../sodium/client/gl/shader/GlShader.java | 4 +-- .../sodium/client/gl/shader/ShaderParser.java | 25 ------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/shader/GlShader.java b/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/shader/GlShader.java index 578d9f848e..fc71193b01 100644 --- a/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/shader/GlShader.java +++ b/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/shader/GlShader.java @@ -27,8 +27,8 @@ public GlShader(ShaderType type, ResourceLocation name, ShaderParser.ParsedShade String log = GL20C.glGetShaderInfoLog(handle); if (!log.isEmpty()) { - LOGGER.warn("Shader compilation log for " + this.name + ": " + parsedShader.remapShaderErrorLog(name, log)); - LOGGER.warn("Include table: " + Arrays.toString(parsedShader.includeIds())); + LOGGER.warn("Shader compilation log for {}: {}", this.name, log); + LOGGER.warn("Include table: {}", Arrays.toString(parsedShader.includeIds())); } int result = GlStateManager.glGetShaderi(handle, GL20C.GL_COMPILE_STATUS); diff --git a/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/shader/ShaderParser.java b/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/shader/ShaderParser.java index 30ce4faea7..4b35d936d6 100644 --- a/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/shader/ShaderParser.java +++ b/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/shader/ShaderParser.java @@ -14,31 +14,6 @@ public class ShaderParser { public record ParsedShader(String src, String[] includeIds) { - private static final Pattern LINE_REF_PATTERN = Pattern.compile("(?\\d+):(?\\d+):"); - - public String remapShaderErrorLog(ResourceLocation name, String log) { - // remap all line references with the include id table - Matcher matcher = LINE_REF_PATTERN.matcher(log); - StringBuilder builder = new StringBuilder(); - - while (matcher.find()) { - String source = matcher.group("source"); - var line = matcher.group("line"); - var id = Integer.parseInt(source); - - if (id >= this.includeIds.length) { - matcher.appendReplacement(builder, "unknown_source" + "(#" + id + "):" + line + ":"); - continue; - } - - String includeName = id == 0 ? name.toString() : this.includeIds[id]; - - matcher.appendReplacement(builder, includeName + "(#" + id + "):" + line + ":"); - } - - matcher.appendTail(builder); - return builder.toString(); - } } public static ParsedShader parseShader(String src, ShaderConstants constants) {