Skip to main content

Module surface

Module surface 

Source
Expand description

What every backend compiles for a world Shader. What a world Shader compiles to, on every backend.

A world Shader defines two hooks, transform and shade, and the engine’s own main-pass entries call them. So a world shader compiles as the engine’s main-pass programs do, from main_bindless.slang, with the world’s files spliced at the hook markers in place of the engine’s defaults. The cook iterates this table to compile a Shader ahead of time and each renderer iterates it to find what the cook left.

Structs§

Program
One entry point of one main-pass file.
Sources
The world’s two files, as text.

Enums§

Stage
Whether an entry runs at the vertex or the fragment stage.

Constants§

ALL
Every entry a world Shader compiles: the bindless pair, on every host.
FRAGMENT_MARKER
The marker the world’s fragment file is spliced at.
VERTEX_MARKER
The marker the world’s vertex file is spliced at.

Functions§

defines
The variant defines for one entry on one host. pool_size and probe_count are the bindless texture-pool length and the probe cube array length the Vulkan host declares; the cook bakes the ceilings and a device that cannot seat them recompiles, exactly as the engine’s own bindless programs do. Metal and DirectX bind fixed counts.
groups
How a host’s entries group into artifacts. Metal takes the pair as one library: slangc emits one MSL translation unit and the runtime wants one library to pull both functions out of. The other two hosts take one artifact per entry.
program
The entry named entry.
programs
The entries a host compiles for a world Shader.
source
The same source from the embedded templates alone.
source_with
The exact source text one entry compiles for one host with the world’s files spliced in. resolve lets a hot-reload build prefer the checkout’s copy of the templates over the embedded ones.