Documentation
¶
Overview ¶
Package entrypoint selects the entry point a backend writes, the meaning of every backend's Options.EntryPoint (backend.EntryPointSelector).
Index ¶
Constants ¶
const All = -1
All is the index Index returns for a nil selector in an output that holds every entry point.
Variables ¶
This section is empty.
Functions ¶
func Index ¶
Index returns the index in m.EntryPoints of the entry point sel names, or All when sel is nil. single is set for an output that holds one entry point (GLSL, a DXIL container): there nil is accepted only for a module with exactly one entry point, and Index returns 0. The errors wrap backend.ErrEntryPointNotFound.
A text backend writes the selected entry point but names identifiers over the whole module, as Rust naga does, so the output for one entry point does not depend on which others the module holds.
func Select ¶
Select returns m with only the entry point sel names, or m itself when sel is nil, with Index's rules for single. The copy shares everything with m but its EntryPoints. It suits a backend whose output does not depend on the names of other entry points (DXIL); a text backend uses Index.
Types ¶
type Filter ¶
type Filter struct {
// Globals[h] is set when the entry point references global h.
Globals []bool
// Functions[h] is set when function h is written.
Functions []bool
}
Filter is what an output holding one entry point writes of the module: the globals that entry point uses and the functions that can serve it. It is Rust naga's SPIR-V writer with PipelineOptions (back/spv/writer.rs write_logical_layout):
- a global the entry point and its callees never reference is left out;
- a function that references a global the entry point does not, or that is unavailable in a stage the entry point is available in (Rust's FunctionInfo::available_stages), is left out.
Rust compares global uses as flag sets (read, write, query, atomic); Filter compares whether a global is referenced at all. The two differ only for a function the entry point does not call that uses a global the entry point uses, with more flags: Filter keeps it, Rust leaves it out. The output is valid either way.