Skip to content

Commit

Permalink
Merge branch 'iris-1.18.2' into 1.18.x/transform-patcher
Browse files Browse the repository at this point in the history
  • Loading branch information
douira committed Dec 20, 2022
2 parents 5798ef4 + 82ff39a commit 496328c
Show file tree
Hide file tree
Showing 65 changed files with 1,040 additions and 598 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ jobs:
with:
modrinth-id: YL57xq9U
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-featured: true
modrinth-unfeature-mode: subset
modrinth-featured: false

curseforge-id: 455508
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion buildscript/src/main/java/Buildscript.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public MappingTree createMappings() {

@Override
public FabricLoader getLoader() {
return new FabricLoader(FabricMaven.URL, FabricMaven.loader("0.13.3"));
return new FabricLoader(FabricMaven.URL, FabricMaven.loader("0.14.10"));
}

@Override
Expand Down
46 changes: 46 additions & 0 deletions docs/changelogs/1.4.3/full.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Iris 1.4.3 Changelog (full)

Iris 1.4.3 is now available for download for 1.16.5, 1.18.2, 1.19.2, and very soon 1.19.3, fixing multiple issues and improving stability.
This release also adds some debug features.

This release was developed by coderbot and IMS.

## Features

- Updated to 1.19.3. (IMS)

- New debug screen accessible when a shader compile fails. (IMS)
- Debug mode is accessible with CTRL-D in the shaderpack selection screen.
- This is a 1.19.3 only feature.
- Added `shadow.enabled` property for force-enabling/disabling shadows. (IMS)
- Added a warning when using Not Enough Crashes. (IMS)
- Added some basic world info uniforms. (IMS)
- integer: bedrockLevel, heightLimit
- float: ambientLight
- bool: hasCeiling, hasSkyLight

## Bug fixes and mod compatibility improvements

- Fixed multiple depth of field shader issues. (IMS)
- Fixed NaN values accidentally mixing.
- Fixed GL3 R32 codepath on 1.16.5.
- Fixed normals in the shadow pass. (IMS)
- Added workaround for waving water disconnecting in Sildur's Vibrant. (coderbot)
- Workaround incorrect lightmap scaling in Continuum 2.0.5. (coderbot)
- Check for linear filtering on integer textures. (IMS & coderbot)
- Temporary fix: Always mark advanced frustum bounds as intersecting.
- This reduces performance, but prevents a bug that would skyrocket chunk count therefore reducing performance even more.
- Improve robustness of IdMapUniforms. (coderbot)
- Do not modify normal matrix in view bobbing. (IMS)
- Apply eye translucency fix only with shaders enabled. (maximum)
- Don't apply compatibility patches to `gl_` prefixes. (douira)

## Translations

- [Updated German translation](https://github.com/IrisShaders/Iris/pull/1701) (isuewo)
- [Updated Japanese translation](https://github.com/IrisShaders/Iris/pull/1704) (KabanFriends)
- [Updated Portuguese translation](https://github.com/IrisShaders/Iris/pull/1720) (FITFC)
- [Updated Chinese translation](https://github.com/IrisShaders/Iris/pull/1734) (GodGun968)
- [Updated Taiwanese translation](https://github.com/IrisShaders/Iris/pull/1754) (HJ-zhtw)
- [Updated Russian translation](https://github.com/IrisShaders/Iris/pull/1741) (Felix14-v2)
- [Updated Ukrainian translation](https://github.com/IrisShaders/Iris/pull/1742) (Altegar)
11 changes: 11 additions & 0 deletions docs/changelogs/1.4.3/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Iris 1.4.3 Changelog (trimmed)

Iris 1.4.3 is now available for download for 1.16.5, 1.18.2, 1.19.2, and very soon 1.19.3, fixing multiple issues and improving stability.
This release also adds some debug features.

**This will be the last 1.16.5 release.**

**⬇ Download the release here: https://irisshaders.net/download.html**

A more detailed changelog is available for those interested: <https://github.com/IrisShaders/Iris/blob/trunk/docs/changelogs/1.4.3/full.md>

2 changes: 1 addition & 1 deletion docs/supportedshaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ The paid versions are not supported, but Continuum 2.0.4 works decently.
* [XorDev's shaders](https://github.com/XorDev/Minecraft-Shaderpacks)
* [Stereo's Default+](https://www.curseforge.com/minecraft/customization/stereos-default-plus)
* [maple's retro extravaganza](https://github.com/Lana-chan/maples-retro-extravaganza)
* [Voyager Shaders](https://www.curseforge.com/minecraft/customization/voyager-shader-2-0)

# Shaders that do not work on Iris

Expand All @@ -91,7 +92,6 @@ This is not a complete list, but is just for people trying to control-F their fa
- SoftVoxels
- UShader
- VanillaPlus
- Voyager Shaders
- All shaders made by DrDesten
- DrDestens MinecraftShaders
- Stracciatella
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/net/coderbot/iris/Iris.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public class Iris {
private static ShaderPack currentPack;
private static String currentPackName;
private static boolean sodiumInvalid;
private static boolean hasNEC;
private static boolean sodiumInstalled;
private static boolean initialized;

Expand All @@ -91,7 +92,7 @@ public class Iris {
private static UpdateChecker updateChecker;
private static boolean fallback;

/**
/**
* Called very early on in Minecraft initialization. At this point we *cannot* safely access OpenGL, but we can do
* some very basic setup, config loading, and environment checks.
*
Expand All @@ -114,6 +115,8 @@ public void onEarlyInitialize() {
}
);

hasNEC = FabricLoader.getInstance().isModLoaded("notenoughcrashes");

ModContainer iris = FabricLoader.getInstance().getModContainer(MODID)
.orElseThrow(() -> new IllegalStateException("Couldn't find the mod container for Iris"));

Expand Down Expand Up @@ -721,6 +724,10 @@ public static boolean isSodiumInstalled() {
return sodiumInstalled;
}

public static boolean hasNotEnoughCrashes() {
return hasNEC;
}

public static Path getShaderpacksDirectory() {
if (shaderpacksDirectory == null) {
shaderpacksDirectory = FabricLoader.getInstance().getGameDir().resolve("shaderpacks");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/coderbot/iris/UpdateChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public Optional<String> getUpdateLink() {
}
}

class UpdateInfo {
static class UpdateInfo {
public String semanticVersion;
public Map<String, String> updateInfo;
public String modHost;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/net/coderbot/iris/features/FeatureFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
import net.minecraft.client.resources.language.I18n;
import org.apache.commons.lang3.text.WordUtils;

import java.util.Arrays;
import java.util.List;
import java.util.function.BooleanSupplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public enum FeatureFlags {
SEPARATE_HARDWARE_SAMPLERS(() -> true, () -> true),
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/net/coderbot/iris/gl/IrisRenderSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ public void copyTexSubImage2D(int destTexture, int target, int i, int i1, int i2
@Override
public void bindTextureToUnit(int unit, int texture) {
ARBDirectStateAccess.glBindTextureUnit(unit, texture);

// Manually fix GLStateManager bindings...
GlStateManagerAccessor.getTEXTURES()[unit].binding = texture;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ private static UniformType getExpectedType(int type) {
} else if (type == GL20C.GL_INT_VEC4) {
return UniformType.VEC4I;
} else if (type == GL20C.GL_FLOAT_MAT3) {
return null;
return UniformType.MAT3;
} else if (type == GL20C.GL_FLOAT_VEC3) {
return UniformType.VEC3;
} else if (type == GL20C.GL_INT_VEC3) {
Expand Down
32 changes: 19 additions & 13 deletions src/main/java/net/coderbot/iris/gl/texture/PixelFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@
import java.util.Optional;

public enum PixelFormat {
RED(GL11C.GL_RED, GlVersion.GL_11),
RG(GL30C.GL_RG, GlVersion.GL_30),
RGB(GL11C.GL_RGB, GlVersion.GL_11),
BGR(GL12C.GL_BGR, GlVersion.GL_12),
RGBA(GL11C.GL_RGBA, GlVersion.GL_11),
BGRA(GL12C.GL_BGRA, GlVersion.GL_12),
RED_INTEGER(GL30C.GL_RED_INTEGER, GlVersion.GL_30),
RG_INTEGER(GL30C.GL_RG_INTEGER, GlVersion.GL_30),
RGB_INTEGER(GL30C.GL_RGB_INTEGER, GlVersion.GL_30),
BGR_INTEGER(GL30C.GL_BGR_INTEGER, GlVersion.GL_30),
RGBA_INTEGER(GL30C.GL_RGBA_INTEGER, GlVersion.GL_30),
BGRA_INTEGER(GL30C.GL_BGRA_INTEGER, GlVersion.GL_30);
RED(GL11C.GL_RED, GlVersion.GL_11, false),
RG(GL30C.GL_RG, GlVersion.GL_30, false),
RGB(GL11C.GL_RGB, GlVersion.GL_11, false),
BGR(GL12C.GL_BGR, GlVersion.GL_12, false),
RGBA(GL11C.GL_RGBA, GlVersion.GL_11, false),
BGRA(GL12C.GL_BGRA, GlVersion.GL_12, false),
RED_INTEGER(GL30C.GL_RED_INTEGER, GlVersion.GL_30, true),
RG_INTEGER(GL30C.GL_RG_INTEGER, GlVersion.GL_30, true),
RGB_INTEGER(GL30C.GL_RGB_INTEGER, GlVersion.GL_30, true),
BGR_INTEGER(GL30C.GL_BGR_INTEGER, GlVersion.GL_30, true),
RGBA_INTEGER(GL30C.GL_RGBA_INTEGER, GlVersion.GL_30, true),
BGRA_INTEGER(GL30C.GL_BGRA_INTEGER, GlVersion.GL_30, true);

private final int glFormat;
private final GlVersion minimumGlVersion;
private final boolean isInteger;

PixelFormat(int glFormat, GlVersion minimumGlVersion) {
PixelFormat(int glFormat, GlVersion minimumGlVersion, boolean isInteger) {
this.glFormat = glFormat;
this.minimumGlVersion = minimumGlVersion;
this.isInteger = isInteger;
}

public static Optional<PixelFormat> fromString(String name) {
Expand All @@ -44,4 +46,8 @@ public int getGlFormat() {
public GlVersion getMinimumGlVersion() {
return minimumGlVersion;
}

public boolean isInteger() {
return isInteger;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
public enum UniformType {
INT,
FLOAT,
MAT3,
MAT4,
VEC2,
VEC2I,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package net.coderbot.iris.gl.uniform;

import com.mojang.math.Vector3f;
import net.coderbot.iris.gl.IrisRenderSystem;
import net.coderbot.iris.vendored.joml.Vector3f;

import java.util.function.Supplier;

public class VanillaVector3Uniform extends Uniform {
private final Vector3f cachedValue;
private final Supplier<com.mojang.math.Vector3f> value;
private final Supplier<Vector3f> value;

VanillaVector3Uniform(int location, Supplier<com.mojang.math.Vector3f> value) {
VanillaVector3Uniform(int location, Supplier<Vector3f> value) {
super(location);

this.cachedValue = new Vector3f();
Expand All @@ -18,7 +18,7 @@ public class VanillaVector3Uniform extends Uniform {

@Override
public void update() {
com.mojang.math.Vector3f newValue = value.get();
Vector3f newValue = value.get();

if (!newValue.equals(cachedValue)) {
cachedValue.set(newValue.x(), newValue.y(), newValue.z());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ public OuterWrappedRenderType(String name, RenderType wrapped, RenderStateShard
this.wrapped = wrapped;
}

public static OuterWrappedRenderType wrapExactlyOnce(String name, RenderType wrapped, RenderStateShard extra) {
if (wrapped instanceof OuterWrappedRenderType) {
wrapped = ((OuterWrappedRenderType) wrapped).unwrap();
}

return new OuterWrappedRenderType(name, wrapped, extra);
}

@Override
public void setupRenderState() {
extra.setupRenderState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@ public class MixinModelViewBobbing {
@Unique
private Matrix4f bobbingEffectsModel;

@Unique
private Matrix3f bobbingEffectsNormal;

@ModifyArg(method = "renderLevel", index = 0,
at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/renderer/GameRenderer;bobHurt(Lcom/mojang/blaze3d/vertex/PoseStack;F)V"))
private PoseStack iris$separateViewBobbing(PoseStack stack) {
stack.pushPose();
stack.last().pose().setIdentity();
stack.last().normal().setIdentity();

return stack;
}
Expand All @@ -47,7 +43,6 @@ public class MixinModelViewBobbing {
target = "Lnet/minecraft/client/renderer/GameRenderer;bobHurt(Lcom/mojang/blaze3d/vertex/PoseStack;F)V"), to = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GameRenderer;resetProjectionMatrix(Lcom/mojang/math/Matrix4f;)V")))
private PoseStack.Pose iris$saveBobbing(PoseStack stack) {
bobbingEffectsModel = stack.last().pose().copy();
bobbingEffectsNormal = stack.last().normal().copy();

stack.popPose();

Expand All @@ -59,9 +54,7 @@ public class MixinModelViewBobbing {
target = "Lnet/minecraft/client/renderer/GameRenderer;resetProjectionMatrix(Lcom/mojang/math/Matrix4f;)V"))
private void iris$applyBobbingToModelView(float tickDelta, long limitTime, PoseStack matrix, CallbackInfo ci) {
matrix.last().pose().multiply(bobbingEffectsModel);
matrix.last().normal().mul(bobbingEffectsNormal);

bobbingEffectsModel = null;
bobbingEffectsNormal = null;
}
}
45 changes: 0 additions & 45 deletions src/main/java/net/coderbot/iris/mixin/MixinShaderInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,54 +33,9 @@ public abstract class MixinShaderInstance implements ShaderInstanceInterface {
@Shadow
public abstract int getId();

@Unique
private String lastSamplerName;

@Unique
private static final ImmutableSet<String> ATTRIBUTE_LIST = ImmutableSet.of("Position", "Color", "Normal", "UV0", "UV1", "UV2");

@Inject(method = "apply",
at = @At(value = "INVOKE", target = "com/mojang/blaze3d/systems/RenderSystem.bindTexture (I)V",
remap = false),
locals = LocalCapture.CAPTURE_FAILHARD)
private void iris$beforeBindTexture(CallbackInfo ci, int lastActiveTexture, int textureUnit, String samplerName) {
// Need to do this here since the LVT changes after the bindTexture call.
lastSamplerName = samplerName;
}

@Inject(method = "apply",
at = @At(value = "INVOKE", target = "com/mojang/blaze3d/systems/RenderSystem.bindTexture (I)V",
remap = false, shift = At.Shift.AFTER))
private void iris$afterBindTexture(CallbackInfo ci) {
final String samplerName = Objects.requireNonNull(lastSamplerName);
lastSamplerName = null;

if (!(((Object) this) instanceof ExtendedShader)) {
return;
}

if (!((ExtendedShader) (Object) this).isIntensitySwizzle()) {
return;
}

// TODO: Don't hardcode this list of samplers bound to texture unit 0
if (samplerName.equals("Sampler0") || samplerName.equals("tex") || samplerName.equals("texture")
|| samplerName.equals("gtexture")) {
// Mimic the texture(..., ...).rrrr swizzle behavior that the text_intensity shader (the shader used for
// TTF fonts) needs outside of shader code to avoid having to do complex shader patching.
//
// In 1.16.5 and below, shaders worked out of the box with TTF fonts, since Minecraft was able to use the
// deprecated GL_INTENSITY image format. Using a Swizzle Mask allows us to replicate the functionality of
// this format on the core profile using GL_RED:
//
// https://www.khronos.org/opengl/wiki/Image_Format#Legacy_Image_Formats
// https://www.khronos.org/opengl/wiki/Texture#Swizzle_mask

IrisRenderSystem.texParameterivDirect(GL20C.GL_TEXTURE_2D, ARBTextureSwizzle.GL_TEXTURE_SWIZZLE_RGBA,
new int[] { GL30C.GL_RED, GL30C.GL_RED, GL30C.GL_RED, GL30C.GL_RED });
}
}

@Redirect(method = "updateLocations",
at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", remap = false))
private void iris$redirectLogSpam(Logger logger, String message, Object arg1, Object arg2) {
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/net/coderbot/iris/mixin/MixinSystemReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,13 @@ private void fillSystemDetails(CallbackInfo ci) {
});
return sb.toString();
});

this.setDetail("NEC status", () -> {
if (Iris.hasNotEnoughCrashes()) {
return "Has NEC: INVALID";
} else {
return "No NEC detected";
}
});
}
}
Loading

0 comments on commit 496328c

Please sign in to comment.