pub struct Interface {
pub stage: Stage,
pub inputs: Vec<Varying>,
pub outputs: Vec<Varying>,
pub resources: Vec<Resource>,
pub facts: StageFacts,
}Expand description
What a program exposes: its stage, the varyings it takes and gives, and the resources it binds.
Fields§
§stage: StageThe stage the program runs in.
inputs: Vec<Varying>The varyings the program reads, one per label.
outputs: Vec<Varying>The varyings the program writes, one per label.
resources: Vec<Resource>The resources the program binds, each with a different id.
facts: StageFactsFacts the stage adds; Interface::verify checks that they fit the stage.
Implementations§
Source§impl Interface
impl Interface
Sourcepub fn resource(&self, id: ResourceId) -> Option<&Resource>
pub fn resource(&self, id: ResourceId) -> Option<&Resource>
The resource with this id.
Sourcepub fn verify(&self) -> Result<(), String>
pub fn verify(&self) -> Result<(), String>
The interface’s own invariants: one varying per label in each direction, values of 1 to 4 lanes, a colour
output Target(n) of a pixel stage with n of 0 to 7 and no such input, resource ids unique, every resource
spanning at least one binding with a buffer stride (a multiple of 4, up to 2048) or element width that means
something, every constant of a buffer (or of a tbuffer view’s layout) inside it with a layout that does not
overflow, a hidden counter that belongs to a storage resource and has no binding of its own, a D3D register
class that fits the resource’s kind, and no two resources on one register of one class and space.