ColorTargetState .java

com.mojang.renderpearl.api.pipeline.ColorTargetState (record): members: blendFunction, format, writeMask, MAX_COLOR_TARGETS, WRITE_ALPHA, WRITE_COLOR.

com.mojang.renderpearl.api.pipelinerecord50 linesclient1.5 KB

API Surface (5)

record ColorTargetState(Optional<BlendFunction> blendFunction, GpuFormat format, @ColorTargetState.WriteMask int writeMask)
boolean writeRed()
boolean writeGreen()
boolean writeBlue()
boolean writeAlpha()

Fields & Constants (9)

WRITE_RED
WRITE_GREEN
WRITE_BLUE
WRITE_ALPHA
WRITE_COLOR
WRITE_ALL
WRITE_NONE
DEFAULT
MAX_COLOR_TARGETS

Code Graph: Dependencies (2)

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

Full Source

ColorTargetState.java50 lines · Minecraft 26.3 · verbatim
1
package com.mojang.renderpearl.api.pipeline;
2
3
import com.mojang.renderpearl.api.GpuFormat;
4
import java.lang.annotation.ElementType;
5
import java.lang.annotation.Retention;
6
import java.lang.annotation.RetentionPolicy;
7
import java.lang.annotation.Target;
8
import java.util.Optional;
9
import net.fabricmc.api.EnvType;
10
import net.fabricmc.api.Environment;
11
12
@Environment(EnvType.CLIENT)
13
public record ColorTargetState(Optional<BlendFunction> blendFunction, GpuFormat format, @ColorTargetState.WriteMask int writeMask) {
14
	public static final int WRITE_RED = 1;
15
	public static final int WRITE_GREEN = 2;
16
	public static final int WRITE_BLUE = 4;
17
	public static final int WRITE_ALPHA = 8;
18
	public static final @ColorTargetState.WriteMask int WRITE_COLOR = 7;
19
	public static final @ColorTargetState.WriteMask int WRITE_ALL = 15;
20
	public static final int WRITE_NONE = 0;
21
	public static final ColorTargetState DEFAULT = new ColorTargetState(Optional.empty(), GpuFormat.RGBA8_UNORM, 15);
22
	public static final int MAX_COLOR_TARGETS = 8;
23
24
	public ColorTargetState(final BlendFunction blendFunction) {
25
		this(Optional.of(blendFunction), GpuFormat.RGBA8_UNORM, 15);
26
	}
27
28
	public boolean writeRed() {
29
		return (this.writeMask & 1) != 0;
30
	}
31
32
	public boolean writeGreen() {
33
		return (this.writeMask & 2) != 0;
34
	}
35
36
	public boolean writeBlue() {
37
		return (this.writeMask & 4) != 0;
38
	}
39
40
	public boolean writeAlpha() {
41
		return (this.writeMask & 8) != 0;
42
	}
43
44
	@Retention(RetentionPolicy.CLASS)
45
	@Target(ElementType.TYPE_USE)
46
	@Environment(EnvType.CLIENT)
47
	public @interface WriteMask {
48
	}
49
}
50

Decompiled Minecraft 26.3 source of ColorTargetState (com/mojang/renderpearl/api/pipeline/ColorTargetState.java) with Mojang official mappings, stored verbatim on the site.