Expand description
Evaluate a pixel shader over a UV grid, to bake a procedural material to textures. The caller states everything the program reads (constant layout and values, a texture per sampled slot, a value per used input) and which output registers it wants; the evaluator has no game names and no policy, and refuses what it is not given.
Structs§
- Constants
- Constant-buffer words of one layout, zero until set.
- Evaluation
- What
evaluatereturns: the requested outputs of every pixel of the grid as floats, and the counts of the run. - Field
- Where a named constant lives, in 32-bit words.
- Grid
- Pixel (x, y) of a size x size grid is evaluated at U = (x + 0.5) / size *
period[0], V likewise with y andperiod[1], in f32. The grid is the screen: an input lane taking U steps byperiod[0]/ size along x (its d/dx) and not along y; V likewise along y; other lanes are constant. - Layout
- The constant buffers a program reads and where each named constant lives. Built from the program’s interface
(
Layout::of) or by the caller from a game’s own records when the bytecode carries none. - Raw
- Every requested output of every pixel, as the program wrote it.
Enums§
- Input
- A used input’s value. Lane k is the element’s k-th component, wherever the signature places the element in its
register (
TEXCOORD1packed into.zwreceives lanes 0 and 1 there); lanes past its components are unused. - Invocation
- How
evaluate_rawruns the program over the grid. - Lane
- One component of an input.
Functions§
- evaluate
- Evaluate
shaderonce per grid pixel (Invocation::Scalar).texturesare asevaluate_rawtakes them.inputsare by (semantic, index), compared case-insensitively; a used input without one is an error.targetsare (output register, required component mask); a target written at some pixels only is an error. - evaluate_
raw - Evaluate
shaderover the grid asinvocationsays, keeping each requested output’s bits and written lanes per pixel (Raw).texturesare the views by bind slot (t<n>); where they refuse what they do not hold (Absent::Refuse), a slot the program samples without one is an error.inputsare by (semantic, index), compared case-insensitively; a used input without one is an error.targetsare (output register, component mask). - evaluate_
raw_ with evaluate_rawonthreadsthreads: the grid’s rows (of quads, forInvocation::Quads) worked one per thread at a time, each with its own sampler, the pixels and counts gathered in row order: the sameRawon any count. The first failing row’s error, as the serial run’s.- evaluate_
with evaluateonthreadsthreads (evaluate_raw_with, a row of the grid each at a time): the same evaluation on any count.