Skip to main content

Views

Struct Views 

Source
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: Absent

What a read does where nothing is bound or addressed.

Implementations§

Source§

impl Views

Source

pub fn refusing(views: BTreeMap<u32, View>) -> Self

views with no sampler states, refusing what they hold nothing for (Absent::Refuse): a grid evaluation’s table.

Trait Implementations§

Source§

impl Clone for Views

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Views

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Views

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Sampler for &Views

Source§

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>

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>

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>

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>

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>

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>

A texture’s size, level count, layer count or sample count.
Source§

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>

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>

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>

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 Forget 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.