Skip to documentation
SLOP

tiny.gpu.RenderBlendMode

Reference tiny.gpu RenderBlendMode

Defined in contract.

How a fragment's color s combines with the target's color d.

API (4)

Fields and members

Public fields and members.

No direct callersNo direct callscontractRenderBlendMode
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/gpu/src/contract.zig:303

zig
/// How a fragment's color `s` combines with the target's color `d`. Each mode applies one equation/// per channel, with `as` the fragment's alpha:/// - `replace`: s./// - `alpha_premultiplied`: s + d·(1 − as), for color and alpha alike./// - `alpha_straight`: color s·as + d·(1 − as), alpha as + ad·(1 − as)./// - `additive`: s + d, for color and alpha alike.////// An 8-bit unorm target stores each result as a byte. A color k/255 written without blending/// lands on byte k on every backend, since interpolation, sampling and the conversion move it by/// far less than half a step. A blend's exact result can fall between two bytes, and Vulkan only/// recommends rounding to nearest when it converts, so a blended byte may differ between/// backends by one step. The CPU backend rounds to nearest.pub const RenderBlendMode = enum(u8) {    replace = 0,    alpha_premultiplied = 1,    alpha_straight = 2,    additive = 3,};

Source: lib/gpu/src/root.zig:61

zig
pub const RenderBlendMode = contract.RenderBlendMode;

Audit

Definitions1
Public names2
Members4
Version26.7.0
Revisiondaab053ee433