Added missing .0, and shader dumping

This commit is contained in:
mcrcortex
2025-05-09 09:46:00 +10:00
parent 4aa04c7cce
commit ef8a5af94b
2 changed files with 10 additions and 3 deletions

View File

@@ -6,6 +6,9 @@ import me.cortex.voxy.common.Logger;
import me.cortex.voxy.common.util.TrackedObject;
import org.lwjgl.opengl.GL20C;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
import java.util.stream.Collectors;
@@ -177,8 +180,12 @@ public class Shader extends TrackedObject {
if (result != GL20C.GL_TRUE) {
GL20C.glDeleteShader(shader);
throw new RuntimeException("Shader compilation failed of type " + type.name() + ", see log for details");
try {
Files.writeString(Path.of("SHADER_DUMP.txt"), src);
} catch (IOException e) {
throw new RuntimeException(e);
}
throw new RuntimeException("Shader compilation failed of type " + type.name() + ", see log for details, dumped shader");
}
return shader;

View File

@@ -137,7 +137,7 @@ bool isCulledByHiz() {
miplevel = ceil(miplevel);
miplevel = clamp(miplevel, 0, 20);
if (miplevel >= 10f) {//Level 9 or 10// TODO: FIX THIS JANK SHIT
if (miplevel >= 10.0f) {//Level 9 or 10// TODO: FIX THIS JANK SHIT
return false;
}