Documentation
¶
Index ¶
Constants ¶
const ( FillEntry = "Fill" FillCountWord = 0 FillValueWord = 1 FillBaseWord = 2 FillConstants = 3 FillWorkgroup = 64 )
The DX12 backend's fill kernel, which runs a fill: a compute list has no buffer fill command, and a UAV clear needs descriptor heaps the backend does not keep. The kernel is the backend's own, not a compute package entry, and the generator compiles it into the backend shader set under FillEntry. The device binds the buffer at the fill's first byte as the one root UAV and pushes the root constants at the positions below: the words to write, the value, and the first word of a piece of a split dispatch, since the device issues a fill wider than one dispatch in pieces as it does an index grid. FillLayout is the root signature the source declares.
const ( RowThreadsWord = 5 ThreadBaseWord = 6 FixedWords = 7 )
The root constants of every entry, a contract between the shell and the dx12 device alone: the dispatch record's five words, then two words the device fills for itself, then the module's length words. RowThreadsWord is a group entry's row thread count, which no built-in supplies (d_rowthreads). ThreadBaseWord is the first thread of a piece of a split index or span dispatch, zero for an unsplit one (d_base). FixedWords is the count of the words ahead of the lengths.
const FillSource = `` /* 339-byte string literal not displayed */
FillSource is the fill kernel.
const GroupWorkgroup = 128
GroupWorkgroup is a group entry's numthreads width, the unit the DX12 backend widens a group row in (GroupThreads).
const RootDwords = 64
RootDwords is the root signature's size limit in 32-bit words: a root descriptor costs two and a root constant one. No entry declares more constants than this, so a device's constant block of this size holds every entry's.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EntryPoint ¶
EntryPoint describes one emitted entry point: the entry's index, the entry's Go function name, which names its compiled blob, the source holding every function and this entry's shell, the root signature layout the shell declares, which carries the workgroup the host dispatches with. The shell's kernel function is named main in every source, so one compiler command serves every file.
type Layout ¶
type Layout struct {
Buffers int
Constants int
Lengths bool // the entry binds a variable-length buffer, so the host fills the length words
Dynamic uint32 // the variable-length bindings, by bit
Group bool // a group entry, so the host fills RowThreadsWord and never splits the grid
Workgroup [2]int
}
Layout is an entry's root signature as the shell declares it and the device binds it: one root UAV descriptor per buffer, the data buffers in binding order then the params buffer when the entry takes one, and after them the 32-bit root constants, the FixedWords followed by the module's length words. Every entry of a module declares the same constant count, so the device pushes one block for every dispatch. The workgroup is the shell's numthreads, which the device rounds the grid to, so the blob and the device take it from this one rule.
func EntryLayout ¶
EntryLayout is entry i's layout.
func FillLayout ¶
func FillLayout() Layout
FillLayout is the fill kernel's root signature as the device binds it: one root UAV and the FillConstants, at the fill's workgroup.
func (Layout) RootSignature ¶
RootSignature prints the layout in the root signature language: the descriptors at u0 upward, then the constants at b0.