From c98ce70eba6315094ec1050bb1956acee854a254 Mon Sep 17 00:00:00 2001 From: IMS212 Date: Wed, 4 Oct 2023 08:41:58 -0700 Subject: [PATCH] Remove *a lot* of TODO's --- .../java/net/coderbot/iris/gl/program/ComputeProgram.java | 1 - .../java/net/coderbot/iris/gl/program/ProgramUniforms.java | 3 +-- .../java/net/coderbot/iris/gl/shader/ProgramCreator.java | 3 --- .../net/coderbot/iris/gui/option/IrisVideoSettings.java | 1 - .../java/net/coderbot/iris/mixin/MixinGameRenderer.java | 7 ------- src/main/java/net/coderbot/iris/mixin/gui/MixinGui.java | 1 - .../coderbot/iris/mixin/shadows/MixinLevelRenderer.java | 2 -- .../vertices/block_rendering/MixinChunkRebuildTask.java | 1 - .../net/coderbot/iris/pipeline/CustomTextureManager.java | 1 - .../iris/pipeline/newshader/NewWorldRenderingPipeline.java | 2 -- .../pipeline/newshader/fallback/ShaderSynthesizer.java | 2 +- .../coderbot/iris/pipeline/transform/TransformPatcher.java | 1 - .../frustum/advanced/AdvancedShadowCullingFrustum.java | 1 - .../net/coderbot/iris/texture/pbr/PBRTextureManager.java | 1 - 14 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/main/java/net/coderbot/iris/gl/program/ComputeProgram.java b/src/main/java/net/coderbot/iris/gl/program/ComputeProgram.java index 74b8e1f1dd..e77cbf2ce1 100644 --- a/src/main/java/net/coderbot/iris/gl/program/ComputeProgram.java +++ b/src/main/java/net/coderbot/iris/gl/program/ComputeProgram.java @@ -44,7 +44,6 @@ public Vector3i getWorkGroups(float width, float height) { if (this.absoluteWorkGroups != null) { this.cachedWorkGroups = this.absoluteWorkGroups; } else if (relativeWorkGroups != null) { - // TODO: This is my best guess at what Optifine does. Can this be confirmed? // Do not use actual localSize here, apparently that's not what we want. this.cachedWorkGroups = new Vector3i((int) Math.ceil(Math.ceil((width * relativeWorkGroups.x)) / localSize[0]), (int) Math.ceil(Math.ceil((height * relativeWorkGroups.y)) / localSize[1]), 1); } else { diff --git a/src/main/java/net/coderbot/iris/gl/program/ProgramUniforms.java b/src/main/java/net/coderbot/iris/gl/program/ProgramUniforms.java index b425788961..c9800238c1 100644 --- a/src/main/java/net/coderbot/iris/gl/program/ProgramUniforms.java +++ b/src/main/java/net/coderbot/iris/gl/program/ProgramUniforms.java @@ -168,8 +168,7 @@ public OptionalInt location(String name, UniformType type) { return OptionalInt.empty(); } - // TODO: Temporary hack until custom uniforms are merged. - if ((!locations.containsKey(id) && !uniformNames.containsKey(name)) || name.equals("framemod8")) { + if ((!locations.containsKey(id) && !uniformNames.containsKey(name))) { locations.put(id, name); uniformNames.put(name, type); } else { diff --git a/src/main/java/net/coderbot/iris/gl/shader/ProgramCreator.java b/src/main/java/net/coderbot/iris/gl/shader/ProgramCreator.java index 54d06fc1ae..5a18b09465 100644 --- a/src/main/java/net/coderbot/iris/gl/shader/ProgramCreator.java +++ b/src/main/java/net/coderbot/iris/gl/shader/ProgramCreator.java @@ -16,15 +16,12 @@ public class ProgramCreator { public static int create(String name, GlShader... shaders) { int program = GlStateManager.glCreateProgram(); - // TODO: This is *really* hardcoded, we need to refactor this to support external calls - // to glBindAttribLocation GlStateManager._glBindAttribLocation(program, 11, "iris_Entity"); GlStateManager._glBindAttribLocation(program, 11, "mc_Entity"); GlStateManager._glBindAttribLocation(program, 12, "mc_midTexCoord"); GlStateManager._glBindAttribLocation(program, 13, "at_tangent"); GlStateManager._glBindAttribLocation(program, 14, "at_midBlock"); - // TODO: more hardcoding for 1.17 GlStateManager._glBindAttribLocation(program, 0, "Position"); GlStateManager._glBindAttribLocation(program, 1, "UV0"); diff --git a/src/main/java/net/coderbot/iris/gui/option/IrisVideoSettings.java b/src/main/java/net/coderbot/iris/gui/option/IrisVideoSettings.java index 001be29864..ded44a6519 100644 --- a/src/main/java/net/coderbot/iris/gui/option/IrisVideoSettings.java +++ b/src/main/java/net/coderbot/iris/gui/option/IrisVideoSettings.java @@ -20,7 +20,6 @@ public class IrisVideoSettings { public static int shadowDistance = 32; - // TODO: Tell the user to check in the shader options once that's supported. private static final Tooltip DISABLED_TOOLTIP = Tooltip.create(Component.translatable("options.iris.shadowDistance.disabled")); private static final Tooltip ENABLED_TOOLTIP = Tooltip.create(Component.translatable("options.iris.shadowDistance.enabled")); public static ColorSpace colorSpace = ColorSpace.SRGB; diff --git a/src/main/java/net/coderbot/iris/mixin/MixinGameRenderer.java b/src/main/java/net/coderbot/iris/mixin/MixinGameRenderer.java index 2d5c1b2aa0..870bd34cd1 100644 --- a/src/main/java/net/coderbot/iris/mixin/MixinGameRenderer.java +++ b/src/main/java/net/coderbot/iris/mixin/MixinGameRenderer.java @@ -114,7 +114,6 @@ public class MixinGameRenderer { @Inject(method = "getNewEntityShader", at = @At("HEAD"), cancellable = true) private static void iris$overrideNewEntityShader(CallbackInfoReturnable cir) { if (ShadowRenderer.ACTIVE) { - // TODO: Wrong program override(ShaderKey.SHADOW_ENTITIES_CUTOUT, cir); } else if (HandRenderer.INSTANCE.isActive()) { override(HandRenderer.INSTANCE.isRenderingSolid() ? ShaderKey.HAND_CUTOUT_BRIGHT : ShaderKey.HAND_WATER_BRIGHT, cir); @@ -185,7 +184,6 @@ public class MixinGameRenderer { }, at = @At("HEAD"), cancellable = true) private static void iris$overrideTranslucentShader(CallbackInfoReturnable cir) { if (ShadowRenderer.ACTIVE) { - // TODO: Wrong program override(ShaderKey.SHADOW_TERRAIN_CUTOUT, cir); } else if (isBlockEntities() || isEntities()) { override(ShaderKey.MOVING_BLOCK, cir); @@ -204,7 +202,6 @@ public class MixinGameRenderer { }, at = @At("HEAD"), cancellable = true) private static void iris$overrideEntityCutoutShader(CallbackInfoReturnable cir) { if (ShadowRenderer.ACTIVE) { - // TODO: Wrong program override(ShaderKey.SHADOW_ENTITIES_CUTOUT, cir); } else if (HandRenderer.INSTANCE.isActive()) { override(HandRenderer.INSTANCE.isRenderingSolid() ? ShaderKey.HAND_CUTOUT_DIFFUSE : ShaderKey.HAND_WATER_DIFFUSE, cir); @@ -239,7 +236,6 @@ public class MixinGameRenderer { }, at = @At("HEAD"), cancellable = true) private static void iris$overrideEnergySwirlShadowShader(CallbackInfoReturnable cir) { if (ShadowRenderer.ACTIVE) { - // TODO: Wrong program override(ShaderKey.SHADOW_ENTITIES_CUTOUT, cir); } else if (HandRenderer.INSTANCE.isActive()) { override(HandRenderer.INSTANCE.isRenderingSolid() ? ShaderKey.HAND_CUTOUT : ShaderKey.HAND_TRANSLUCENT, cir); @@ -270,7 +266,6 @@ public class MixinGameRenderer { }, at = @At("HEAD"), cancellable = true) private static void iris$overrideEntitySolidDiffuseShader(CallbackInfoReturnable cir) { if (ShadowRenderer.ACTIVE) { - // TODO: Wrong program override(ShaderKey.SHADOW_ENTITIES_CUTOUT, cir); } else if (HandRenderer.INSTANCE.isActive()) { override(HandRenderer.INSTANCE.isRenderingSolid() ? ShaderKey.HAND_CUTOUT_DIFFUSE : ShaderKey.HAND_WATER_DIFFUSE, cir); @@ -286,7 +281,6 @@ public class MixinGameRenderer { }, at = @At("HEAD"), cancellable = true) private static void iris$overrideEntitySolidShader(CallbackInfoReturnable cir) { if (ShadowRenderer.ACTIVE) { - // TODO: Wrong program override(ShaderKey.SHADOW_ENTITIES_CUTOUT, cir); } else if (HandRenderer.INSTANCE.isActive()) { override(HandRenderer.INSTANCE.isRenderingSolid() ? ShaderKey.HAND_CUTOUT : ShaderKey.HAND_TRANSLUCENT, cir); @@ -319,7 +313,6 @@ public class MixinGameRenderer { }, at = @At("HEAD"), cancellable = true) private static void iris$overrideEntityEyesShader(CallbackInfoReturnable cir) { if (ShadowRenderer.ACTIVE) { - // TODO: Wrong program override(ShaderKey.SHADOW_ENTITIES_CUTOUT, cir); } else if (isBlockEntities()) { override(ShaderKey.BLOCK_ENTITY, cir); diff --git a/src/main/java/net/coderbot/iris/mixin/gui/MixinGui.java b/src/main/java/net/coderbot/iris/mixin/gui/MixinGui.java index bd8f73dad0..e3af51551c 100644 --- a/src/main/java/net/coderbot/iris/mixin/gui/MixinGui.java +++ b/src/main/java/net/coderbot/iris/mixin/gui/MixinGui.java @@ -35,7 +35,6 @@ public class MixinGui { } } - // TODO: Move this to a more appropriate mixin @Inject(method = "render", at = @At("RETURN")) public void iris$displayBigSodiumWarning(PoseStack poseStack, float tickDelta, CallbackInfo ci) { if (Iris.isSodiumInstalled() diff --git a/src/main/java/net/coderbot/iris/mixin/shadows/MixinLevelRenderer.java b/src/main/java/net/coderbot/iris/mixin/shadows/MixinLevelRenderer.java index 03e9529029..a86d09c7cb 100644 --- a/src/main/java/net/coderbot/iris/mixin/shadows/MixinLevelRenderer.java +++ b/src/main/java/net/coderbot/iris/mixin/shadows/MixinLevelRenderer.java @@ -71,8 +71,6 @@ private void swap() { renderChunksInFrustum = savedRenderChunks; savedRenderChunks = tmpList; - // TODO: If the normal chunks need a terrain update, these chunks probably do too... - // We probably should copy it over boolean tmpBool = needsFullRenderChunkUpdate; needsFullRenderChunkUpdate = savedNeedsTerrainUpdate; savedNeedsTerrainUpdate = tmpBool; diff --git a/src/main/java/net/coderbot/iris/mixin/vertices/block_rendering/MixinChunkRebuildTask.java b/src/main/java/net/coderbot/iris/mixin/vertices/block_rendering/MixinChunkRebuildTask.java index efaa9f2fb8..05c96297ae 100644 --- a/src/main/java/net/coderbot/iris/mixin/vertices/block_rendering/MixinChunkRebuildTask.java +++ b/src/main/java/net/coderbot/iris/mixin/vertices/block_rendering/MixinChunkRebuildTask.java @@ -64,7 +64,6 @@ private short resolveBlockId(BlockState state) { if (bufferBuilder2 instanceof BlockSensitiveBufferBuilder) { lastBufferBuilder = ((BlockSensitiveBufferBuilder) bufferBuilder2); // All fluids have a ShadersMod render type of 1, to match behavior of Minecraft 1.7 and earlier. - // TODO: We're using createLegacyBlock? That seems like something that Mojang wants to deprecate. lastBufferBuilder.beginBlock(resolveBlockId(fluidState.createLegacyBlock()), ExtendedDataHelper.FLUID_RENDER_TYPE, blockPos3.getX() & 0xF, blockPos3.getY() & 0xF, blockPos3.getZ() & 0xF); } } diff --git a/src/main/java/net/coderbot/iris/pipeline/CustomTextureManager.java b/src/main/java/net/coderbot/iris/pipeline/CustomTextureManager.java index 2453aad3fd..46b4a0695c 100644 --- a/src/main/java/net/coderbot/iris/pipeline/CustomTextureManager.java +++ b/src/main/java/net/coderbot/iris/pipeline/CustomTextureManager.java @@ -151,7 +151,6 @@ private TextureAccess createCustomTexture(CustomTextureData textureData) throws // and we could end up holding on to a deleted texture unless we added special code to handle resource // reloads. Re-fetching the texture from the TextureManager every time is the most robust approach for // now. - // TODO: Should we give something else if the texture isn't there? This will need some thought return new TextureWrapper(() -> { AbstractTexture texture = textureManager.getTexture(textureLocation); return texture != null ? texture.getId() : MissingTextureAtlasSprite.getTexture().getId(); diff --git a/src/main/java/net/coderbot/iris/pipeline/newshader/NewWorldRenderingPipeline.java b/src/main/java/net/coderbot/iris/pipeline/newshader/NewWorldRenderingPipeline.java index 373e6ffa8e..f0779857fd 100644 --- a/src/main/java/net/coderbot/iris/pipeline/newshader/NewWorldRenderingPipeline.java +++ b/src/main/java/net/coderbot/iris/pipeline/newshader/NewWorldRenderingPipeline.java @@ -485,8 +485,6 @@ public NewWorldRenderingPipeline(ProgramSet programSet) throws IOException { this.shadowRenderer = null; } - // TODO: Create fallback Sodium shaders if the pack doesn't provide terrain shaders - // Currently we use Sodium's shaders but they don't support EXP2 fog underwater. this.sodiumTerrainPipeline = new SodiumTerrainPipeline(this, programSet, createTerrainSamplers, shadowRenderTargets == null ? null : createShadowTerrainSamplers, createTerrainImages, createShadowTerrainImages, renderTargets, flippedAfterPrepare, flippedAfterTranslucent, shadowRenderTargets != null ? shadowRenderTargets.createShadowFramebuffer(ImmutableSet.of(), programSet.getShadow().filter(source -> !source.getDirectives().hasUnknownDrawBuffers()).map(source -> source.getDirectives().getDrawBuffers()).orElse(new int[]{0, 1})) : null, customUniforms); diff --git a/src/main/java/net/coderbot/iris/pipeline/newshader/fallback/ShaderSynthesizer.java b/src/main/java/net/coderbot/iris/pipeline/newshader/fallback/ShaderSynthesizer.java index 5f8577bed9..f350653fb8 100644 --- a/src/main/java/net/coderbot/iris/pipeline/newshader/fallback/ShaderSynthesizer.java +++ b/src/main/java/net/coderbot/iris/pipeline/newshader/fallback/ShaderSynthesizer.java @@ -80,7 +80,7 @@ public static String vsh(boolean hasChunkOffset, ShaderAttributeInputs inputs, F shader.append("uniform vec3 Light0_Direction;\n"); shader.append("uniform vec3 Light1_Direction;\n"); - // TODO: Copied from Mojang code. + // Copied from Mojang code. shader.append("vec4 minecraft_mix_light(vec3 lightDir0, vec3 lightDir1, vec3 normal, vec4 color) {\n" + " lightDir0 = normalize(lightDir0);\n" + " lightDir1 = normalize(lightDir1);\n" + diff --git a/src/main/java/net/coderbot/iris/pipeline/transform/TransformPatcher.java b/src/main/java/net/coderbot/iris/pipeline/transform/TransformPatcher.java index dd7df1b8b6..917ca496b9 100644 --- a/src/main/java/net/coderbot/iris/pipeline/transform/TransformPatcher.java +++ b/src/main/java/net/coderbot/iris/pipeline/transform/TransformPatcher.java @@ -224,7 +224,6 @@ public TranslationUnit parseTranslationUnit(Root rootInstance, String input) { CommonTransformer.transform(transformer, tree, root, parameters, true); break; default: - // TODO: Implement Optifine's special core profile mode // handling of Optifine's special core profile mode boolean isLine = (parameters.patch == Patch.VANILLA && ((VanillaParameters) parameters).isLines()); if (profile == Profile.CORE || version.number >= 150 && profile == null || isLine) { diff --git a/src/main/java/net/coderbot/iris/shadows/frustum/advanced/AdvancedShadowCullingFrustum.java b/src/main/java/net/coderbot/iris/shadows/frustum/advanced/AdvancedShadowCullingFrustum.java index 3b8256cc7b..2d096f6370 100644 --- a/src/main/java/net/coderbot/iris/shadows/frustum/advanced/AdvancedShadowCullingFrustum.java +++ b/src/main/java/net/coderbot/iris/shadows/frustum/advanced/AdvancedShadowCullingFrustum.java @@ -288,7 +288,6 @@ public boolean isVisible(AABB aabb) { } // For Sodium - // TODO: change this to respect intersections on 1.18+! public int fastAabbTest(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) { if (boxCuller != null && boxCuller.isCulled(minX, minY, minZ, maxX, maxY, maxZ)) { return 0; diff --git a/src/main/java/net/coderbot/iris/texture/pbr/PBRTextureManager.java b/src/main/java/net/coderbot/iris/texture/pbr/PBRTextureManager.java index b45ec523a9..9cc0b2d858 100644 --- a/src/main/java/net/coderbot/iris/texture/pbr/PBRTextureManager.java +++ b/src/main/java/net/coderbot/iris/texture/pbr/PBRTextureManager.java @@ -24,7 +24,6 @@ public class PBRTextureManager { public static final PBRTextureManager INSTANCE = new PBRTextureManager(); - // TODO: Figure out how to merge these two. private static Runnable normalTextureChangeListener; private static Runnable specularTextureChangeListener;