BaseGpuTexture .java

com.mojang.renderpearl.backend.common.BaseGpuTexture (class, 71 lines): members: getDepthOrLayers, getMipLevels, mipLevels, getFormat, getLabel, usage.

com.mojang.renderpearl.backend.commonclass71 linesclient1.4 KB

Implements

API Surface (6)

int getWidth(final int mipLevel)
int getHeight(final int mipLevel)
int getDepthOrLayers()
int getMipLevels()
GpuFormat getFormat()
String getLabel()

Fields & Constants (7)

format
width
height
depthOrLayers
mipLevels
usage
label

Code Graph: Dependencies (2)

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

Full Source

BaseGpuTexture.java71 lines · Minecraft 26.3 · verbatim
1
package com.mojang.renderpearl.backend.common;
2
3
import com.mojang.renderpearl.api.GpuFormat;
4
import com.mojang.renderpearl.api.textures.GpuTexture;
5
import net.fabricmc.api.EnvType;
6
import net.fabricmc.api.Environment;
7
8
@Environment(EnvType.CLIENT)
9
public abstract class BaseGpuTexture implements GpuTexture {
10
	private final GpuFormat format;
11
	private final int width;
12
	private final int height;
13
	private final int depthOrLayers;
14
	private final int mipLevels;
15
	private final @GpuTexture.Usage int usage;
16
	private final String label;
17
18
	public BaseGpuTexture(
19
		final @GpuTexture.Usage int usage,
20
		final String label,
21
		final GpuFormat format,
22
		final int width,
23
		final int height,
24
		final int depthOrLayers,
25
		final int mipLevels
26
	) {
27
		this.usage = usage;
28
		this.label = label;
29
		this.format = format;
30
		this.width = width;
31
		this.height = height;
32
		this.depthOrLayers = depthOrLayers;
33
		this.mipLevels = mipLevels;
34
	}
35
36
	@Override
37
	public int getWidth(final int mipLevel) {
38
		return this.width >> mipLevel;
39
	}
40
41
	@Override
42
	public int getHeight(final int mipLevel) {
43
		return this.height >> mipLevel;
44
	}
45
46
	@Override
47
	public int getDepthOrLayers() {
48
		return this.depthOrLayers;
49
	}
50
51
	@Override
52
	public int getMipLevels() {
53
		return this.mipLevels;
54
	}
55
56
	@Override
57
	public GpuFormat getFormat() {
58
		return this.format;
59
	}
60
61
	@Override
62
	public @GpuTexture.Usage int usage() {
63
		return this.usage;
64
	}
65
66
	@Override
67
	public String getLabel() {
68
		return this.label;
69
	}
70
}
71

Decompiled Minecraft 26.3 source of BaseGpuTexture (com/mojang/renderpearl/backend/common/BaseGpuTexture.java) with Mojang official mappings, stored verbatim on the site.