more-shader-refactors #11

Merged
embeddedt merged 9 commits from mitchej123/celeritas:more-shader-refactors into stonecutter 2025-04-26 16:37:18 -04:00
2 changed files with 13 additions and 13 deletions
Showing only changes of commit 7ee35e3c00 - Show all commits

No files matched your search

@@ -2,11 +2,11 @@ package net.irisshaders.iris.targets.backed;
import com.mojang.blaze3d.platform.NativeImage;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.util.FastColor;
import org.embeddedt.embeddium.api.util.ColorABGR;
public class NativeImageBackedSingleColorTexture extends DynamicTexture {
public NativeImageBackedSingleColorTexture(int red, int green, int blue, int alpha) {
super(create(FastColor.ABGR32.color(alpha, blue, green, red)));
super(create(ColorABGR.pack(alpha, blue, green, red)));
mitchej123 marked this conversation as resolved Outdated
Outdated
Review

Have you tested any of the code paths where ColorABGR has been introduced? The order of the color components is not the same as FastColor, so this should look very wrong...

Have you tested any of the code paths where `ColorABGR` has been introduced? The order of the color components is not the same as `FastColor`, so this should look very wrong...
Outdated
Review

haha whoops

haha whoops
}
public NativeImageBackedSingleColorTexture(int rgba) {
@@ -1,7 +1,7 @@
package net.irisshaders.iris.texture.util;
import com.mojang.blaze3d.platform.NativeImage;
import net.minecraft.util.FastColor;
import org.embeddedt.embeddium.api.util.ColorABGR;
public class ImageManipulationUtil {
public static NativeImage scaleNearestNeighbor(NativeImage image, int newWidth, int newHeight) {
@@ -95,11 +95,11 @@ public class ImageManipulationUtil {
}
private static int blendColor(int c0, int c1, int c2, int c3, float w0, float w1, float w2, float w3) {
return FastColor.ABGR32.color(
blendChannel(FastColor.ABGR32.alpha(c0), FastColor.ABGR32.alpha(c1), FastColor.ABGR32.alpha(c2), FastColor.ABGR32.alpha(c3), w0, w1, w2, w3),
blendChannel(FastColor.ABGR32.blue(c0), FastColor.ABGR32.blue(c1), FastColor.ABGR32.blue(c2), FastColor.ABGR32.blue(c3), w0, w1, w2, w3),
blendChannel(FastColor.ABGR32.green(c0), FastColor.ABGR32.green(c1), FastColor.ABGR32.green(c2), FastColor.ABGR32.green(c3), w0, w1, w2, w3),
blendChannel(FastColor.ABGR32.red(c0), FastColor.ABGR32.red(c1), FastColor.ABGR32.red(c2), FastColor.ABGR32.red(c3), w0, w1, w2, w3)
return ColorABGR.pack(
blendChannel(ColorABGR.unpackAlpha(c0), ColorABGR.unpackAlpha(c1), ColorABGR.unpackAlpha(c2), ColorABGR.unpackAlpha(c3), w0, w1, w2, w3),
blendChannel(ColorABGR.unpackBlue(c0), ColorABGR.unpackBlue(c1), ColorABGR.unpackBlue(c2), ColorABGR.unpackBlue(c3), w0, w1, w2, w3),
blendChannel(ColorABGR.unpackGreen(c0), ColorABGR.unpackGreen(c1), ColorABGR.unpackGreen(c2), ColorABGR.unpackGreen(c3), w0, w1, w2, w3),
blendChannel(ColorABGR.unpackRed(c0), ColorABGR.unpackRed(c1), ColorABGR.unpackRed(c2), ColorABGR.unpackRed(c3), w0, w1, w2, w3)
);
}
@@ -108,11 +108,11 @@ public class ImageManipulationUtil {
}
private static int blendColor(int c0, int c1, float w0, float w1) {
return FastColor.ABGR32.color(
blendChannel(FastColor.ABGR32.alpha(c0), FastColor.ABGR32.alpha(c1), w0, w1),
blendChannel(FastColor.ABGR32.blue(c0), FastColor.ABGR32.blue(c1), w0, w1),
blendChannel(FastColor.ABGR32.green(c0), FastColor.ABGR32.green(c1), w0, w1),
blendChannel(FastColor.ABGR32.red(c0), FastColor.ABGR32.red(c1), w0, w1)
return ColorABGR.pack(
blendChannel(ColorABGR.unpackAlpha(c0), ColorABGR.unpackAlpha(c1), w0, w1),
blendChannel(ColorABGR.unpackBlue(c0), ColorABGR.unpackBlue(c1), w0, w1),
blendChannel(ColorABGR.unpackGreen(c0), ColorABGR.unpackGreen(c1), w0, w1),
blendChannel(ColorABGR.unpackRed(c0), ColorABGR.unpackRed(c1), w0, w1)
);
}