API

Interface RenderShaderOptions

Options for createRenderShader. The source contains complete WGSL declarations and both entry points.

interface RenderShaderOptions {
    bindings?: readonly ComputeBindingDecl[];
    depth?: RenderShaderDepthOptions;
    fragmentEntryPoint?: string;
    name?: string;
    primitive?: GPUPrimitiveState;
    renderSource: string;
    target?: RenderShaderTargetOptions;
    vertexBuffers?: readonly GPUVertexBufferLayout[];
    vertexEntryPoint?: string;
}
Index
bindings?: readonly ComputeBindingDecl[]

Resource declarations, created with the same helpers as compute (computeUniformBufferBinding, computeStorageBufferBinding, computeTextureBinding, computeSamplerBinding, ...). Read-only resources are visible to both stages; writable storage is fragment-only, as WebGPU requires.

fragmentEntryPoint?: string
name?: string
primitive?: GPUPrimitiveState
renderSource: string

Color-target state; one entry for the single color attachment of a render target.

vertexBuffers?: readonly GPUVertexBufferLayout[]

Vertex-buffer layouts. Each draw supplies one StorageBuffer created with vertex: true per layout.

vertexEntryPoint?: string