pub struct Views {
pub views: BTreeMap<u32, View>,
pub samplers: BTreeMap<u32, ViewSampler>,
pub absent: Absent,
}Expand description
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).
Fields§
§views: BTreeMap<u32, View>The views by bind slot (t<n> or u<n>).
samplers: BTreeMap<u32, ViewSampler>The sampler states by bind slot (s<n>).
absent: AbsentWhat a read does where nothing is bound or addressed.
Implementations§
Trait Implementations§
Source§impl Sampler for &Views
impl Sampler for &Views
Source§fn sample(&mut self, r: Sample) -> Result<[f32; 4], String>
fn sample(&mut self, r: Sample) -> Result<[f32; 4], String>
Answer a 2D
Sample with the texel’s four lanes as floats, or an error that stops the evaluation.Source§fn sample_image(&mut self, r: ImageSample<u32>) -> Result<[f32; 4], String>
fn sample_image(&mut self, r: ImageSample<u32>) -> Result<[f32; 4], String>
A sample of any texture: 1D, 3D or cube, with a texel offset, a gather or a comparison. A plain 2D sample
(or a 2D array’s layer) goes to
Sampler::sample; anything else is refused unless the sampler answers it.Source§fn load(&mut self, r: Load) -> Result<[u32; 4], String>
fn load(&mut self, r: Load) -> Result<[u32; 4], String>
The texel’s four lanes as its view returns them: f32 bits for a float view, the integers for a uint or sint
one.
Source§fn load_image(&mut self, r: ImageLoad<u32>) -> Result<[u32; 4], String>
fn load_image(&mut self, r: ImageLoad<u32>) -> Result<[u32; 4], String>
A texel load of any texture. A 2D or 3D one (or a 2D array’s layer) goes to
Sampler::load.Source§fn structured(
&mut self,
slot: u32,
element: u32,
offset: u32,
) -> Result<u32, String>
fn structured( &mut self, slot: u32, element: u32, offset: u32, ) -> Result<u32, String>
The 32-bit word at byte
offset of element element of the structured buffer at t<slot>.Source§fn buffer_elements(&mut self, slot: u32) -> Option<u32>
fn buffer_elements(&mut self, slot: u32) -> Option<u32>
How many elements the buffer view at bind slot
slot has, where the sampler knows. A program that reads past the
end gets zeros (D3D’s rule) when this is stated; when it is not, no read is taken for out of range.Source§fn query_image(&mut self, r: ImageQuery<u32>) -> Result<[u32; 4], String>
fn query_image(&mut self, r: ImageQuery<u32>) -> Result<[u32; 4], String>
A texture’s size, level count, layer count or sample count.
Source§fn store(&mut self, request: Store) -> Result<(), String>
fn store(&mut self, request: Store) -> Result<(), String>
A store to an unordered-access view (
Store): the lanes mask marks of value, at the address the program
gives (a structured view’s lanes the consecutive words from the byte offset). Its effect is the caller’s: it
reaches none of this evaluation’s outputs.Source§fn atomic_add(&mut self, request: AtomicAdd) -> Result<u32, String>
fn atomic_add(&mut self, request: AtomicAdd) -> Result<u32, String>
An atomic add (
AtomicAdd); its result the word as it was before. The add itself is the caller’s effect.Source§fn atomic_image(&mut self, request: ImageAtomic<u32>) -> Result<u32, String>
fn atomic_image(&mut self, request: ImageAtomic<u32>) -> Result<u32, String>
An atomic operation on a texel of a single-channel 32-bit unordered-access texture; its result is the word as it
was before.
Source§fn store_image(&mut self, request: ImageStore<u32>) -> Result<(), String>
fn store_image(&mut self, request: ImageStore<u32>) -> Result<(), String>
A write to an unordered-access texture; the plain form is
Sampler::store.Auto Trait Implementations§
impl !RefUnwindSafe for Views
impl !UnwindSafe for Views
impl Freeze for Views
impl Send for Views
impl Sync for Views
impl Unpin for Views
impl UnsafeUnpin for Views
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more