Skip to content

Commit

Permalink
Merge pull request #9 from nznaza/main
Browse files Browse the repository at this point in the history
Oculus Shader workaroud
  • Loading branch information
LatvianModder authored Aug 3, 2024
2 parents 860c799 + 202d800 commit b9700fe
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.coderbot.iris.Iris;
import net.coderbot.iris.pipeline.WorldRenderingPhase;
import net.coderbot.iris.pipeline.WorldRenderingPipeline;
import net.irisshaders.iris.api.v0.IrisApi;
import net.minecraft.client.renderer.LevelRenderer;
import org.slf4j.Logger;

Expand Down Expand Up @@ -31,8 +32,8 @@ public static void preRender(LevelRenderer renderer) {
try {
final WorldRenderingPipeline pipeline = Iris.getPipelineManager().preparePipeline(Iris.getCurrentDimension());
PIPELINE.set(renderer, pipeline);
pipeline.beginLevelRendering();
pipeline.setPhase(WorldRenderingPhase.NONE);
//pipeline.beginLevelRendering();
pipeline.setOverridePhase(WorldRenderingPhase.NONE);
} catch (ReflectiveOperationException e) {
LOGGER.error("Exception in preRender", e);
}
Expand All @@ -42,10 +43,14 @@ public static void postRender(LevelRenderer renderer) {
if (PIPELINE == null) return;
try {
final WorldRenderingPipeline pipeline = (WorldRenderingPipeline)PIPELINE.get(renderer);
pipeline.finalizeLevelRendering();
//pipeline.finalizeLevelRendering();
PIPELINE.set(renderer, null);
} catch (ReflectiveOperationException e) {
LOGGER.error("Exception in postRender", e);
}
}

public static boolean shadersEnabled() {
return IrisApi.getInstance().isShaderPackInUse();
}
}

0 comments on commit b9700fe

Please sign in to comment.