Skip to content

Commit d5cf530

Browse files
authored
Fix F3 + L (default profiler) crash (#614)
1 parent f23855f commit d5cf530

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// In a new file, e.g., ClientMetricsSamplersProviderMixin.java
2+
package net.vulkanmod.mixin.profiling; // Or an appropriate package
3+
4+
import com.mojang.blaze3d.systems.TimerQuery;
5+
import net.minecraft.client.profiling.ClientMetricsSamplersProvider;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
import org.spongepowered.asm.mixin.injection.At;
8+
import org.spongepowered.asm.mixin.injection.Redirect;
9+
10+
import java.util.Optional;
11+
12+
@Mixin(ClientMetricsSamplersProvider.class)
13+
public class ClientMetricsSamplersProviderMixin {
14+
15+
@Redirect(method = "registerStaticSamplers", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/TimerQuery;getInstance()Ljava/util/Optional;"))
16+
private Optional<TimerQuery> preventTimerQuery() {
17+
return Optional.empty();
18+
}
19+
}

src/main/resources/vulkanmod.mixins.json

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,33 @@
77
"mixins": [
88
],
99
"client": [
10-
"window.WindowMixin",
11-
"window.WindowAccessor",
12-
13-
"chunk.ClientPacketListenerM",
1410
"chunk.ClientChunkCacheM",
11+
"chunk.ClientPacketListenerM",
1512
"chunk.DirectionMixin",
1613
"chunk.FrustumMixin",
1714
"chunk.LevelRendererMixin",
1815
"chunk.SectionBufferBuilderPoolM",
1916
"chunk.SectionRenderDispatcherM",
2017
"chunk.ViewAreaM",
2118
"chunk.VisibilitySetMixin",
22-
2319
"compatibility.EffectInstanceM",
20+
"compatibility.PostChainM",
21+
"compatibility.PostPassM",
2422
"compatibility.ProgramM",
2523
"compatibility.UniformM",
2624
"compatibility.gl.GL11M",
2725
"compatibility.gl.GL15M",
2826
"compatibility.gl.GL30M",
29-
30-
"debug.crash_report.SystemReportM",
3127
"debug.DebugScreenOverlayM",
3228
"debug.GlDebugInfoM",
3329
"debug.KeyboardHandlerM",
34-
30+
"debug.crash_report.SystemReportM",
3531
"matrix.Matrix4fM",
3632
"matrix.PoseAccessor",
37-
33+
"profiling.ClientMetricsSamplersProviderMixin",
3834
"profiling.GuiMixin",
3935
"profiling.KeyboardHandlerM",
4036
"profiling.LevelRendererMixin",
41-
4237
"render.BufferUploaderM",
4338
"render.GameRendererMixin",
4439
"render.GlProgramManagerMixin",
@@ -69,37 +64,28 @@
6964
"render.vertex.IndexTypeMixin",
7065
"render.vertex.VertexBufferM",
7166
"render.vertex.VertexFormatMixin",
72-
73-
"screen.ScreenM",
7467
"screen.OptionsScreenM",
75-
76-
"texture.mip.MipmapGeneratorM",
68+
"screen.ScreenM",
69+
"texture.MAbstractTexture",
70+
"texture.MTextureUtil",
7771
"texture.image.MNativeImage",
7872
"texture.image.NativeImageAccessor",
73+
"texture.mip.MipmapGeneratorM",
7974
"texture.update.GameRendererM",
8075
"texture.update.MLightTexture",
8176
"texture.update.MSpriteContents",
8277
"texture.update.MTextureManager",
83-
"texture.MAbstractTexture",
84-
"texture.MTextureUtil",
85-
8678
"util.ScreenshotRecorderM",
87-
8879
"vertex.EntityOutlineGeneratorM",
8980
"vertex.SpriteCoordinateExpanderM",
9081
"vertex.VertexMultiConsumersM$DoubleM",
9182
"vertex.VertexMultiConsumersM$MultipleM",
9283
"vertex.VertexMultiConsumersM$SheetDecalM",
93-
84+
"voxel.VoxelShapeMixin",
9485
"wayland.InputConstantsM",
9586
"wayland.MinecraftMixin",
96-
97-
"texture.mip.MipmapGeneratorM",
98-
99-
"compatibility.PostChainM",
100-
"compatibility.PostPassM",
101-
102-
"voxel.VoxelShapeMixin"
87+
"window.WindowAccessor",
88+
"window.WindowMixin"
10389
],
10490
"injectors": {
10591
"defaultRequire": 1

0 commit comments

Comments
 (0)