Skip to content

Commit

Permalink
refactor: Rename ShaderPipeline to DeferredWorldRenderingPipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbot16 committed Mar 7, 2021
1 parent c138727 commit e1c87cd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/main/java/net/coderbot/iris/Iris.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.google.common.base.Throwables;
import com.mojang.blaze3d.platform.GlStateManager;
import net.coderbot.iris.config.IrisConfig;
import net.coderbot.iris.pipeline.ShaderPipeline;
import net.coderbot.iris.pipeline.DeferredWorldRenderingPipeline;
import net.coderbot.iris.pipeline.WorldRenderingPipeline;
import net.coderbot.iris.shaderpack.DimensionId;
import net.coderbot.iris.shaderpack.ShaderPack;
Expand Down Expand Up @@ -281,9 +281,9 @@ private static void destroyPipeline() {
// Destroy the old world rendering pipeline
//
// This destroys all loaded shader programs and all of the render targets.
if (pipeline instanceof ShaderPipeline) {
// TODO: Don't cast this to ShaderPipeline?
((ShaderPipeline) pipeline).destroy();
if (pipeline instanceof DeferredWorldRenderingPipeline) {
// TODO: Don't cast this to DeferredWorldRenderingPipeline?
((DeferredWorldRenderingPipeline) pipeline).destroy();
pipeline = null;
}
}
Expand Down Expand Up @@ -325,7 +325,7 @@ public static void checkDimension() {

public static WorldRenderingPipeline getPipeline() {
if (pipeline == null) {
pipeline = new ShaderPipeline(Objects.requireNonNull(currentPack).getProgramSet(lastDimension));
pipeline = new DeferredWorldRenderingPipeline(Objects.requireNonNull(currentPack).getProgramSet(lastDimension));
}

return pipeline;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import net.coderbot.iris.layer.GbufferProgram;
import net.coderbot.iris.layer.GbufferPrograms;
import net.coderbot.iris.pipeline.ShaderPipeline;
import net.coderbot.iris.pipeline.DeferredWorldRenderingPipeline;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -46,7 +46,7 @@ public class MixinParticleManager {
LightmapTextureManager lightmapTextureManager, Camera camera, float f,
CallbackInfo ci, Iterator<ParticleTextureSheet> sheets, ParticleTextureSheet sheet,
Iterable<Particle> particles, Tessellator tessellator) {
GbufferPrograms.push(ShaderPipeline.getProgramForSheet(sheet));
GbufferPrograms.push(DeferredWorldRenderingPipeline.getProgramForSheet(sheet));

if (lastSheet != null) {
throw new IllegalStateException("Particle rendering in weird state: lastSheet != null, lastSheet = " + lastSheet);
Expand All @@ -59,7 +59,7 @@ public class MixinParticleManager {
private void iris$postDrawParticleSheet(MatrixStack matrixStack, VertexConsumerProvider.Immediate immediate,
LightmapTextureManager lightmapTextureManager, Camera camera, float f,
CallbackInfo ci) {
GbufferPrograms.pop(ShaderPipeline.getProgramForSheet(Objects.requireNonNull(lastSheet)));
GbufferPrograms.pop(DeferredWorldRenderingPipeline.getProgramForSheet(Objects.requireNonNull(lastSheet)));
lastSheet = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* Encapsulates the compiled shader program objects for the currently loaded shaderpack.
*/
public class ShaderPipeline implements WorldRenderingPipeline {
public class DeferredWorldRenderingPipeline implements WorldRenderingPipeline {
private final RenderTargets renderTargets;
@Nullable
private final Pass basic;
Expand Down Expand Up @@ -79,7 +79,7 @@ public class ShaderPipeline implements WorldRenderingPipeline {
private static final List<GbufferProgram> programStack = new ArrayList<>();
private static final List<String> programStackLog = new ArrayList<>();

public ShaderPipeline(ProgramSet programs) {
public DeferredWorldRenderingPipeline(ProgramSet programs) {
Objects.requireNonNull(programs);

this.renderTargets = new RenderTargets(MinecraftClient.getInstance().getFramebuffer(), programs.getPackDirectives());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ private static void bindTexture(int textureUnit, int texture) {
RenderSystem.bindTexture(texture);
}

// TODO: Don't just copy this from ShaderPipeline
// TODO: Don't just copy this from DeferredWorldRenderingPipeline
private Pair<Program, ProgramDirectives> createProgram(ProgramSource source) {
// TODO: Properly handle empty shaders
Objects.requireNonNull(source.getVertexSource());
Expand Down

0 comments on commit e1c87cd

Please sign in to comment.