Skip to content

Commit

Permalink
More minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Mar 9, 2024
1 parent 5faebd9 commit c38ee6e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "iris"
rootProject.name = "Iris"

pluginManagement {
repositories {
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/net/irisshaders/iris/compat/dh/DHCompat.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.irisshaders.iris.compat.dh;

import net.irisshaders.iris.Iris;
import net.irisshaders.iris.gl.shader.ShaderCompileException;
import net.irisshaders.iris.pipeline.IrisRenderingPipeline;
import net.irisshaders.iris.uniforms.CapturedRenderingState;
import net.fabricmc.loader.api.FabricLoader;
Expand Down Expand Up @@ -32,7 +33,11 @@ public DHCompat(IrisRenderingPipeline pipeline, boolean renderDHShadow) {
}
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException |
ClassNotFoundException e) {
throw new RuntimeException(e);
if (e.getCause() instanceof ShaderCompileException sce) {
throw sce;
} else {
throw new RuntimeException(e);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ private static void setupSetDeferredBeforeRenderingEvent() {
public void beforeRender(DhApiCancelableEventParam<DhApiRenderParam> event) {

DhApi.Delayed.renderProxy.setDeferTransparentRendering(IrisApi.getInstance().isShaderPackInUse());
DhApi.Delayed.configs.graphics().fog().drawMode().setValue(getInstance().shouldOverride ? EFogDrawMode.FOG_DISABLED : EFogDrawMode.FOG_ENABLED);
}
};

Expand Down Expand Up @@ -208,6 +209,10 @@ private static void setupBeforeRenderFrameBufferBinding() {
public void beforeSetup(DhApiEventParam<DhApiRenderParam> event) {
DHCompatInternal instance = getInstance();

OverrideInjector.INSTANCE.unbind(IDhApiShadowCullingFrustum.class, (IDhApiOverrideable) ShadowRenderer.FRUSTUM);
OverrideInjector.INSTANCE.unbind(IDhApiFramebuffer.class, instance.getShadowFBWrapper());
OverrideInjector.INSTANCE.unbind(IDhApiFramebuffer.class, instance.getSolidFBWrapper());

if (instance.shouldOverride) {
if (ShadowRenderingState.areShadowsCurrentlyBeingRendered() && instance.shouldOverrideShadow) {
OverrideInjector.INSTANCE.bind(IDhApiFramebuffer.class, instance.getShadowFBWrapper());
Expand Down

0 comments on commit c38ee6e

Please sign in to comment.