bindDepthAlphaMask method
Binds the mask texture and MaskInfo parameters consumed by the masked
depth fragment shaders; shader is the masked variant the pass drew
with. Called only when depthAlphaMasked is true.
Implementation
@override
void bindDepthAlphaMask(
gpu.RenderPass pass,
gpu.Shader shader,
TransientWriter transientsBuffer,
) {
// Mirrors the coverage the color pass tests in Surface():
// texture.a * weighted vertex-color alpha * baseColorFactor alpha.
final params = Float32List(4)
..[0] = alphaCutoff
..[1] = baseColorFactor.a
..[2] = vertexColorWeight;
pass.bindUniform(
shader.getUniformSlot('MaskInfo'),
transientsBuffer.emplace(ByteData.sublistView(params)),
);
pass.bindTexture(
shader.getUniformSlot('mask_texture'),
Material.whitePlaceholder(resolveTextureSource(baseColorTexture)),
sampler: textureSourceSampler(baseColorTexture) ?? _repeatSampler,
);
}