Skip to content

Commit

Permalink
Remove *a lot* of TODO's
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Oct 4, 2023
1 parent 8696a75 commit c98ce70
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/net/coderbot/iris/gl/shader/ProgramCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/net/coderbot/iris/mixin/MixinGameRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ public class MixinGameRenderer {
@Inject(method = "getNewEntityShader", at = @At("HEAD"), cancellable = true)
private static void iris$overrideNewEntityShader(CallbackInfoReturnable<ShaderInstance> 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);
Expand Down Expand Up @@ -185,7 +184,6 @@ public class MixinGameRenderer {
}, at = @At("HEAD"), cancellable = true)
private static void iris$overrideTranslucentShader(CallbackInfoReturnable<ShaderInstance> cir) {
if (ShadowRenderer.ACTIVE) {
// TODO: Wrong program
override(ShaderKey.SHADOW_TERRAIN_CUTOUT, cir);
} else if (isBlockEntities() || isEntities()) {
override(ShaderKey.MOVING_BLOCK, cir);
Expand All @@ -204,7 +202,6 @@ public class MixinGameRenderer {
}, at = @At("HEAD"), cancellable = true)
private static void iris$overrideEntityCutoutShader(CallbackInfoReturnable<ShaderInstance> 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);
Expand Down Expand Up @@ -239,7 +236,6 @@ public class MixinGameRenderer {
}, at = @At("HEAD"), cancellable = true)
private static void iris$overrideEnergySwirlShadowShader(CallbackInfoReturnable<ShaderInstance> 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);
Expand Down Expand Up @@ -270,7 +266,6 @@ public class MixinGameRenderer {
}, at = @At("HEAD"), cancellable = true)
private static void iris$overrideEntitySolidDiffuseShader(CallbackInfoReturnable<ShaderInstance> 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);
Expand All @@ -286,7 +281,6 @@ public class MixinGameRenderer {
}, at = @At("HEAD"), cancellable = true)
private static void iris$overrideEntitySolidShader(CallbackInfoReturnable<ShaderInstance> 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);
Expand Down Expand Up @@ -319,7 +313,6 @@ public class MixinGameRenderer {
}, at = @At("HEAD"), cancellable = true)
private static void iris$overrideEntityEyesShader(CallbackInfoReturnable<ShaderInstance> cir) {
if (ShadowRenderer.ACTIVE) {
// TODO: Wrong program
override(ShaderKey.SHADOW_ENTITIES_CUTOUT, cir);
} else if (isBlockEntities()) {
override(ShaderKey.BLOCK_ENTITY, cir);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/net/coderbot/iris/mixin/gui/MixinGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c98ce70

Please sign in to comment.