English
Türkçe
Chapter 05
GPU Interface & Memory
The browser and shader meet at bindings, entry-point IO, and memory layout. WGSL describes the shader side of that agreement; WebGPU validation checks that the host side matches it.
Bindings are numbered slots
@group and @binding are not comments. They identify the resource slot the host must
populate for a pass.
struct Params {
scale : f32,
offset : f32,
};
@group(0) @binding(0)
var<uniform> params : Params;
@group(0) @binding(1)
var<storage, read_write> data : array<f32>;
Address spaces say where memory lives
uniform is read-only configuration, storage can hold large arrays and writable
output, and workgroup is shared scratch memory for one workgroup.
Entry-point IO is explicit
Compute entry points usually receive builtin invocation coordinates. Vertex and fragment entry points combine builtins and user locations. Reflection makes those edges visible so layout drift does not hide in JavaScript.