Skip to content

Commit

Permalink
Fix Sildur's Enhanced Default not compiling in the nether/end
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Jan 18, 2022
1 parent 14cc4b9 commit ab0d2bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public DeferredWorldRenderingPipeline(ProgramSet programs) {
ImmutableSet<Integer> flippedBeforeShadow = ImmutableSet.of();

createShadowMapRenderer = () -> {
shadowMapRenderer = new ShadowRenderer((CoreWorldRenderingPipeline) this, programs.getShadow().orElse(null),
shadowMapRenderer = new ShadowRenderer((CoreWorldRenderingPipeline) this, programs,
programs.getPackDirectives(), renderTargets);
createShadowMapRenderer = () -> {};
};
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/net/coderbot/iris/pipeline/ShadowRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import net.coderbot.iris.shaderpack.OptionalBoolean;
import net.coderbot.iris.shaderpack.PackDirectives;
import net.coderbot.iris.shaderpack.PackShadowDirectives;
import net.coderbot.iris.shaderpack.ProgramSet;
import net.coderbot.iris.shaderpack.ProgramSource;
import net.coderbot.iris.shadow.ShadowMatrices;
import net.coderbot.iris.shadows.CullingDataCache;
Expand Down Expand Up @@ -86,7 +87,7 @@ public class ShadowRenderer implements ShadowMapRenderer {
private int renderedShadowEntities = 0;
private int renderedShadowBlockEntities = 0;

public ShadowRenderer(CoreWorldRenderingPipeline pipeline, ProgramSource shadow, PackDirectives directives, RenderTargets gbufferRenderTargets) {
public ShadowRenderer(CoreWorldRenderingPipeline pipeline, ProgramSet set, PackDirectives directives, RenderTargets gbufferRenderTargets) {
this.pipeline = pipeline;

final PackShadowDirectives shadowDirectives = directives.getShadowDirectives();
Expand Down Expand Up @@ -126,17 +127,17 @@ public ShadowRenderer(CoreWorldRenderingPipeline pipeline, ProgramSource shadow,
// - https://github.com/IrisShaders/Iris/issues/483
// - https://github.com/IrisShaders/Iris/issues/987

if (shadow != null) {
if (set.getShadow().isPresent()) {
// Assume that the shader pack is doing voxelization if a geometry shader is detected.
// Also assume voxelization if image load / store is detected (set elsewhere)
this.packHasVoxelization = shadow.getGeometrySource().isPresent();
this.packHasVoxelization = set.getShadow().get().getGeometrySource().isPresent();
this.packCullingState = shadowDirectives.getCullingState();
} else {
this.packHasVoxelization = false;
this.packCullingState = OptionalBoolean.DEFAULT;
}

ProgramSource[] composite = shadow.getParent().getComposite();
ProgramSource[] composite = set.getComposite();

if (composite.length > 0) {
String fsh = composite[0].getFragmentSource().orElse("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public NewWorldRenderingPipeline(ProgramSet programSet) throws IOException {
ImmutableSet<Integer> flippedBeforeShadow = ImmutableSet.of();

createShadowMapRenderer = () -> {
shadowMapRenderer = new ShadowRenderer(this, programSet.getShadow().orElse(null),
shadowMapRenderer = new ShadowRenderer(this, programSet,
programSet.getPackDirectives(), renderTargets);
createShadowMapRenderer = () -> {
};
Expand Down

0 comments on commit ab0d2bd

Please sign in to comment.