Expand description
Resource views bound by slot (Views), answering a program’s requests. Where nothing is bound or an address falls
outside a view, they answer as their policy states (Absent): as Direct3D answers (Absent::Zero, the rules
below), or by refusing, naming the slot or address (Absent::Refuse: an evaluation runs on no value it was not given).
The rules are the D3D11.3 functional specification’s, stated here once:
- Nothing bound. A sample from a slot with no texture bound returns 0 in all components (7.18.17), and so does a
load (“Fetching from t# that has nothing bound to it returns 0 for all components”, 22.4.6), a structured read
(22.4.12) and a size query (22.4.14,
resinfo). A buffer at an empty slot has no elements. - Out of range. A load whose address or level is outside the view returns 0 in all components (22.4.6’s out-of-bounds behaviour; every view here has all four components, so no missing-component default arises), a typed buffer’s element past its end too, and a structured read of an element past the end returns 0 (22.4.12). A structured read whose byte offset is past its element is undefined there (22.4.12) and refused here.
- Sampling. A view holds one level, so every level of detail reads it; a sample is filtered as its sampler slot
states (
ViewSampler): the texel it falls in, or linear between the texels about it (four in 2D, eight in a volume), each axis addressed (a border reads the slot’s border colour; a border with none is refused). A sampler slot nothing states is refused, never assumed. An image the caller samples itself (View::Image) is sampled by its own policy at the level of detail the program states.
What a view is not asked for is refused by name: a gather, a comparison, a texel offset, a cube or 1D texture, a layer other than 0 of a 2D view (any layer of a caller’s image), a multisample or unordered-access load, a store or an atomic (their effect is the caller’s).
Structs§
- View
Sampler - A sampler slot’s state: its filter, the addressing along u, v and w, and the colour a border reads.
- Views
- The views and sampler states bound by slot, and what a request reads where they hold nothing (see the module
documentation). A program reads them through
&Views(the views are only read, so one table serves every thread).
Enums§
- Absent
- What a request reads where the views hold nothing for it: a slot nothing is bound to, or an address or level outside its view (a structured read’s byte offset past its element is refused either way).
- View
- One bound view.
- View
Filter - How a sampler slot filters a view.
Traits§
- Image
- A texture the caller samples itself (its footprint, addressing, filtering and transfer are its own policy), by the
level of detail the program states (
crate::Lod).