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.