Skip to content

Commit

Permalink
Merge branch 'multiloader-new' into 1.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Oct 25, 2024
2 parents 761fcc6 + 9c9fb8a commit 610c023
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private static OptionImpl<Options, SupportedGraphicsMode> createLimitedVideoSett
new Component[]{Component.translatable("options.graphics.fast"), Component.translatable("options.graphics.fancy")}))
.setBinding(
(opts, value) -> opts.graphicsMode().set(value.toVanilla()),
opts -> SupportedGraphicsMode.fromVanilla(opts.graphicsMode().get()))
opts -> SupportedGraphicsMode.fromVanilla(opts.graphicsMode()))
.setImpact(OptionImpact.HIGH)
.setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD)
.build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package net.irisshaders.iris.fantastic;

import net.irisshaders.iris.Iris;
import net.minecraft.client.GraphicsStatus;
import net.minecraft.client.OptionInstance;

public enum SupportedGraphicsMode {
FAST,
FANCY;

public static SupportedGraphicsMode fromVanilla(GraphicsStatus status) {
return switch (status) {
public static SupportedGraphicsMode fromVanilla(OptionInstance<GraphicsStatus> status) {
return switch (status.get()) {
case FAST -> FAST;
case FANCY -> FANCY;
case FABULOUS -> throw new IllegalStateException("Fabulous graphics mode is not supported by Iris");
case FABULOUS -> {
Iris.logger.warn("Detected Fabulous Graphics being used somehow, changing to Fancy!");
status.set(GraphicsStatus.FANCY);
yield FANCY;
}
};
}

Expand Down
4 changes: 3 additions & 1 deletion common/src/main/java/net/irisshaders/iris/gl/GlVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ public enum GlVersion {
GL_11,
GL_12,
GL_30,
GL_31
GL_31,
GL_33,
GL_41
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.lwjgl.opengl.GL11C;
import org.lwjgl.opengl.GL30C;
import org.lwjgl.opengl.GL31C;
import org.lwjgl.opengl.GL33C;
import org.lwjgl.opengl.GL41C;

import java.util.Locale;
import java.util.Optional;
Expand Down Expand Up @@ -72,10 +74,16 @@ public enum InternalTextureFormat {
RG32UI(GL30C.GL_RG32UI, GlVersion.GL_30, PixelFormat.RG_INTEGER),
RGB32UI(GL30C.GL_RGB32UI, GlVersion.GL_30, PixelFormat.RGB_INTEGER),
RGBA32UI(GL30C.GL_RGBA32UI, GlVersion.GL_30, PixelFormat.RGBA_INTEGER),
// 2-bit normalized
RGBA2(GL11C.GL_RGBA2, GlVersion.GL_11, PixelFormat.RGBA),
// 4-bit normalized
RGBA4(GL11C.GL_RGBA4, GlVersion.GL_11, PixelFormat.RGBA),
// Mixed
R3_G3_B2(GL11C.GL_R3_G3_B2, GlVersion.GL_11, PixelFormat.RGB),
RGB5_A1(GL11C.GL_RGB5_A1, GlVersion.GL_11, PixelFormat.RGBA),
RGB565(GL41C.GL_RGB565, GlVersion.GL_41, PixelFormat.RGB),
RGB10_A2(GL11C.GL_RGB10_A2, GlVersion.GL_11, PixelFormat.RGBA),
RGB10_A2UI(GL33C.GL_RGB10_A2UI, GlVersion.GL_33, PixelFormat.RGBA),
R11F_G11F_B10F(GL30C.GL_R11F_G11F_B10F, GlVersion.GL_30, PixelFormat.RGB),
RGB9_E5(GL30C.GL_RGB9_E5, GlVersion.GL_30, PixelFormat.RGB);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ public enum PixelType {
UNSIGNED_INT_8_8_8_8(4, GL12C.GL_UNSIGNED_INT_8_8_8_8, GlVersion.GL_12),
UNSIGNED_INT_8_8_8_8_REV(4, GL12C.GL_UNSIGNED_INT_8_8_8_8_REV, GlVersion.GL_12),
UNSIGNED_INT_10_10_10_2(4, GL12C.GL_UNSIGNED_INT_10_10_10_2, GlVersion.GL_12),
UNSIGNED_INT_2_10_10_10_REV(4, GL12C.GL_UNSIGNED_INT_2_10_10_10_REV, GlVersion.GL_12);
UNSIGNED_INT_2_10_10_10_REV(4, GL12C.GL_UNSIGNED_INT_2_10_10_10_REV, GlVersion.GL_12),
UNSIGNED_INT_10F_11F_11F_REV(4, GL30C.GL_UNSIGNED_INT_10F_11F_11F_REV, GlVersion.GL_30),
UNSIGNED_INT_5_9_9_9_REV(4, GL30C.GL_UNSIGNED_INT_5_9_9_9_REV, GlVersion.GL_30);

private final int byteSize;
private final int glFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private static void acceptColorMipmapSettings(DirectiveHolder directives, Int2Ob
directives.acceptConstBooleanDirective("generateShadowColorMipmap", mipmap -> samplers.forEach((i, sampler) -> sampler.setMipmap(mipmap)));

// Find any per-sampler overrides for the shadow depth mipmap setting
for (int i = 0; i < samplers.size(); i++) {
for (int i = 0; i < PackShadowDirectives.MAX_SHADOW_COLOR_BUFFERS_IRIS; i++) {
String name = "shadowcolor" + i + "Mipmap";
directives.acceptConstBooleanDirective(name, samplers.computeIfAbsent(i, sa -> new SamplingSettings())::setMipmap);

Expand All @@ -197,7 +197,7 @@ private static void acceptDepthFilteringSettings(DirectiveHolder directives, Imm
}

private static void acceptColorFilteringSettings(DirectiveHolder directives, Int2ObjectMap<SamplingSettings> samplers) {
for (int i = 0; i < samplers.size(); i++) {
for (int i = 0; i < PackShadowDirectives.MAX_SHADOW_COLOR_BUFFERS_IRIS; i++) {
String name = "shadowcolor" + i + "Nearest";

directives.acceptConstBooleanDirective(name, samplers.computeIfAbsent(i, sa -> new SamplingSettings())::setNearest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,15 @@ public void renderAll() {
ProgramUniforms.clearActiveUniforms();
GlStateManager._glUseProgram(0);

// TODO IMS: Apparantly we are not supposed to do this for shadowcomp...
/*
for (int i = 0; i < renderTargets.getRenderTargetCount(); i++) {
// Reset mipmapping states at the end of the frame.
if (renderTargets.get(i) != null) {
resetRenderTarget(renderTargets.get(i));
}
}
*/

RenderSystem.activeTexture(GL15C.GL_TEXTURE0);
}
Expand Down
4 changes: 3 additions & 1 deletion common/src/main/resources/assets/iris/lang/et_ee.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
"iris.shaders.debug.disabled": "Silumine on nüüd keelatud.",
"iris.shaders.debug.failure": "Silumist ei saa lubada, sinu arvuti ei toeta silumisfunktsioone.",
"iris.shaders.debug.restart": "Sul puudub silumiskontekst, silumiseks palun taaskäivita.",
"iris.shaders.debug.restartNoDebug": "Varjutajate silumine on lubatud; OpenGL silumine ei ole NeoForges toetatud.",
"iris.load.failure.shader": "Varjutajapaki laadimine ebaõnnestus! Palun teata sellest veast varjutajapaki arendajale. ",
"iris.load.failure.generic": "Irisel tekkis varjutaja laadimisel viga, palun teata sellest Irise arendajatele. ",
"iris.shaders.ssbofailure": "Varjutaja taotles konkreetset funktsiooni (SSBO), mis ei ole sinu videokaardi poolt toetatud, see ei pruugi korrektselt töötada.",
"iris.keybind.reload": "Laadi varjutajad uuesti",
"iris.keybind.shaderPackSelection": "Varjutajapaki valikukuva",
"iris.keybind.wireframe": "Traatraam (ainult üksikmäng)",
"iris.keybind.toggleShaders": "Lülita varjutajad sisse/välja",
"iris.keybinds": "Iris",
"iris.shaders.reloaded.failure": "Varjutajate taaslaadimine ebaõnnestus! Põhjus: %s",
Expand All @@ -26,7 +28,7 @@
"iris.unsupported.pc": "sinu arvuti",
"iris.unsupported.pack": "Varjutajapakk ühildumatu!",
"iris.unsupported.pack.description": "Varjutajapakk, mida proovid laadida, sisaldab funktsioone, mida %s ei toeta. Palun proovi teist pakki. Loetelu %s",
"iris.unsupported.pack.macos": "\nmacOSil on teadaolevalt probleeme paljude varjutajapakkidega.",
"iris.unsupported.pack.macos": "\nmacOSil on teadaolevalt paljude varjutajapakkidega probleeme.",
"options.iris.apply": "Rakenda",
"options.iris.refresh": "Värskenda",
"options.iris.openShaderPackFolder": "Ava varjutajapakkide kaust...",
Expand Down

0 comments on commit 610c023

Please sign in to comment.