Fix some GLSM bypasses (#2099)

This commit is contained in:
Jason Mitchell authored and GitHub committed 2026-09-14 14:22:19 -07:00
1 parent 81b82748ce
commit a07cecb879
39 files changed
+2176 -247

No files matched your search

@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.rendering.voxelization;
import com.gtnewhorizons.angelica.glsm.GLStateManager;
import com.gtnewhorizons.angelica.glsm.backend.BackendManager;
import com.gtnewhorizons.angelica.glsm.backend.RenderBackend;
import net.coderbot.iris.pipeline.transform.RwImageStoreExtractor;
@@ -8,6 +9,7 @@ import org.embeddedt.embeddium.impl.gl.buffer.GlBuffer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.embeddedt.embeddium.impl.render.chunk.region.RenderRegion;
import org.lwjgl.opengl.GL43;
public final class SdlShadowVoxelizationSink implements ShadowVoxelizer.Sink {
@@ -47,7 +49,8 @@ public final class SdlShadowVoxelizationSink implements ShadowVoxelizer.Sink {
@Override
public boolean range(int vertexOffset, int vertexCount) {
if (pendingVertexBuffer != 0) {
if (!sdl().bindVoxelizationRegion(SSBO_BINDING, pendingVertexBuffer, pass, pendingX, pendingY, pendingZ)) {
GLStateManager.glBindBufferBase(GL43.GL_SHADER_STORAGE_BUFFER, SSBO_BINDING, pendingVertexBuffer);
if (!sdl().bindVoxelizationRegion(SSBO_BINDING, pass, pendingX, pendingY, pendingZ)) {
if (!warnedBindFailure) {
warnedBindFailure = true;
LOG.warn("shadow voxelization: could not bind region vertex buffer {} at SSBO slot {}", pendingVertexBuffer, SSBO_BINDING);
@@ -85,11 +85,15 @@ public class BlendModeStorage {
}
public static void deferBlendModeToggle(boolean enabled) {
if (enabled == vanillaBlendEnable) return;
vanillaBlendEnable = enabled;
hasDeferredChanges = true;
}
public static void deferBlendFunc(int srcRgb, int dstRgb, int srcAlpha, int dstAlpha) {
if (vanillaBlend.getSrcRgb() == srcRgb && vanillaBlend.getDstRgb() == dstRgb && vanillaBlend.getSrcAlpha() == srcAlpha && vanillaBlend.getDstAlpha() == dstAlpha) {
return;
}
vanillaBlend.setAll(srcRgb, dstRgb, srcAlpha, dstAlpha);
hasDeferredChanges = true;
}