Cell rendering in WGSL
Every glyph, every cursor blink, every scroll update passes through a single wgpu pipeline. WGSL shaders handle the cell grid across Vulkan, Metal, DX12 and GLES with one shader set.
// renderer/pipeline.wgsl
@vertex
fn vs_cell(
@location(0) pos: vec2<f32>,
@location(1) cell: vec4<u32>,
) -> VSOut {
var out: VSOut;
out.clip = cell;
out.pos = vec4<f32>(pos, 0.0, 1.0);
return out;
}
@fragment
fn fs_cell(in: VSOut) -> @location(0) vec4<f32> {
return sample_atlas(in.clip);
}