DebugEntryGpuUtilization .java

net.minecraft.client.gui.components.debug.DebugEntryGpuUtilization (class): members: isAllowed, serverOrClientLevel, displayer, clientChunk, display.

net.minecraft.client.gui.components.debugclass31 linesclient988 B

Implements

API Surface (2)

void display(final DebugScreenDisplayer displayer, final @Nullable Level serverOrClientLevel, final @Nullable LevelChunk clientChunk, final @Nullable LevelChunk serverChunk)
boolean isAllowed(final boolean reducedDebugInfo)

Fields & Constants (3)

displayer
serverOrClientLevel
clientChunk

String literals (1)

"GPU: "

Code Graph: Dependencies (6)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

DebugEntryGpuUtilization.java31 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.gui.components.debug;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
import net.minecraft.ChatFormatting;
6
import net.minecraft.client.Minecraft;
7
import net.minecraft.world.level.Level;
8
import net.minecraft.world.level.chunk.LevelChunk;
9
import org.jspecify.annotations.Nullable;
10
11
@Environment(EnvType.CLIENT)
12
public class DebugEntryGpuUtilization implements DebugScreenEntry {
13
	@Override
14
	public void display(
15
		final DebugScreenDisplayer displayer,
16
		final @Nullable Level serverOrClientLevel,
17
		final @Nullable LevelChunk clientChunk,
18
		final @Nullable LevelChunk serverChunk
19
	) {
20
		Minecraft minecraft = Minecraft.getInstance();
21
		String gpuUtilizationString = "GPU: "
22
			+ (minecraft.getGpuUtilization() > 100.0 ? ChatFormatting.RED + "100%" : Math.round(minecraft.getGpuUtilization()) + "%");
23
		displayer.addLine(gpuUtilizationString);
24
	}
25
26
	@Override
27
	public boolean isAllowed(final boolean reducedDebugInfo) {
28
		return true;
29
	}
30
}
31

Decompiled Minecraft 26.3 source of DebugEntryGpuUtilization (net/minecraft/client/gui/components/debug/DebugEntryGpuUtilization.java) with Mojang official mappings, stored verbatim on the site.