This commit is contained in:
mcrcortex
2025-09-23 13:05:41 +10:00
parent 3f94bba49e
commit 7ca910e35a
2 changed files with 21 additions and 2 deletions

View File

@@ -176,6 +176,14 @@ public class IrisShaderPatch {
public float[] renderScale;
public boolean useViewportDims;
public boolean checkValid() {
if (this.blending != null) {
for (BlendState state : this.blending.values()) {
if (state.buffer != -1 && (state.buffer<0||this.translucentDrawBuffers.length<=state.buffer)) {
return false;
}
}
}
return this.opaqueDrawBuffers != null && this.translucentDrawBuffers != null && this.uniforms != null && this.opaquePatchData != null;
}
}
@@ -311,7 +319,7 @@ public class IrisShaderPatch {
}
patchData = GSON.fromJson(voxyPatchData, PatchGson.class);
if (patchData == null) {
return null;
throw new IllegalStateException("Voxy patch json returned null");
}
{//Inject data from the auxilery files if they are present

View File

@@ -8,6 +8,9 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import java.io.PrintWriter;
import java.io.StringWriter;
@Mixin(GlDebug.class)
public class MixinGlDebug {
@WrapOperation(method = "onDebugMessage", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;info(Ljava/lang/String;Ljava/lang/Object;)V", remap = false))
@@ -15,7 +18,7 @@ public class MixinGlDebug {
if (msgObj instanceof GlDebug.DebugMessage msg) {
var throwable = new Throwable(msg.toString());
if (isCausedByVoxy(throwable.getStackTrace())) {
original.call(instance, base, throwable);
original.call(instance, base+"\n"+getStackTraceAsString(throwable), throwable);
} else {
original.call(instance, base, msg);
}
@@ -24,6 +27,14 @@ public class MixinGlDebug {
}
}
@Unique
private static String getStackTraceAsString(Throwable throwable) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
throwable.printStackTrace(pw);
return sw.toString();
}
@Unique
private boolean isCausedByVoxy(StackTraceElement[] trace) {
for (var elem : trace) {