pub struct AnsweredReads<R, A> {
pub answer: A,
pub samples: Vec<ImageSample<R>>,
pub loads: Vec<ImageLoad<R>>,
pub queries: Vec<ImageQuery<R>>,
}Expand description
A run’s texture reads, each answered by answer and recorded in the order the program made them (a read the answer
refuses is not recorded; the run fails with its reason). As a Sampler (R a bind slot) it is a pixel program’s
textures; stores, atomics and structured buffers are refused, as a sampler that gives none refuses them.
Fields§
§answer: AHow the reads are answered.
samples: Vec<ImageSample<R>>The samples answered, in order.
loads: Vec<ImageLoad<R>>The loads answered, in order.
queries: Vec<ImageQuery<R>>The queries answered, in order.
Implementations§
Source§impl<R, A: Answer<R>> AnsweredReads<R, A>
impl<R, A: Answer<R>> AnsweredReads<R, A>
Sourcepub fn sample(&mut self, request: ImageSample<R>) -> Result<[f32; 4], String>
pub fn sample(&mut self, request: ImageSample<R>) -> Result<[f32; 4], String>
Answer a sample and record it; a refused one is not recorded.
Sourcepub fn load(&mut self, request: ImageLoad<R>) -> Result<[u32; 4], String>
pub fn load(&mut self, request: ImageLoad<R>) -> Result<[u32; 4], String>
Answer a load and record it; a refused one is not recorded.
Sourcepub fn query(&mut self, request: ImageQuery<R>) -> Result<[u32; 4], String>
pub fn query(&mut self, request: ImageQuery<R>) -> Result<[u32; 4], String>
Answer a query and record it; a refused one is not recorded.
Sourcepub fn counts(&self) -> TextureUse
pub fn counts(&self) -> TextureUse
How many reads of each kind were answered.
Trait Implementations§
Source§impl<A: Answer<u32>> Sampler for AnsweredReads<u32, A>
impl<A: Answer<u32>> Sampler for AnsweredReads<u32, A>
Source§fn sample(&mut self, request: Sample) -> Result<[f32; 4], String>
fn sample(&mut self, request: Sample) -> Result<[f32; 4], String>
A plain 2D sample, answered as the image sample it is.
Source§fn sample_image(
&mut self,
request: ImageSample<u32>,
) -> Result<[f32; 4], String>
fn sample_image( &mut self, request: 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_image(&mut self, request: ImageLoad<u32>) -> Result<[u32; 4], String>
fn load_image(&mut self, request: 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 query_image(&mut self, request: ImageQuery<u32>) -> Result<[u32; 4], String>
fn query_image(&mut self, request: ImageQuery<u32>) -> Result<[u32; 4], String>
A texture’s size, level count, layer count or sample count.
Source§fn load(&mut self, request: Load) -> Result<[u32; 4], String>
fn load(&mut self, request: 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 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 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 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<R, A> Freeze for AnsweredReads<R, A>where
A: Freeze,
Vec<ImageSample<R>>: Freeze,
Vec<ImageLoad<R>>: Freeze,
Vec<ImageQuery<R>>: Freeze,
impl<R, A> RefUnwindSafe for AnsweredReads<R, A>where
A: RefUnwindSafe,
Vec<ImageSample<R>>: RefUnwindSafe,
Vec<ImageLoad<R>>: RefUnwindSafe,
Vec<ImageQuery<R>>: RefUnwindSafe,
impl<R, A> Send for AnsweredReads<R, A>
impl<R, A> Sync for AnsweredReads<R, A>
impl<R, A> Unpin for AnsweredReads<R, A>
impl<R, A> UnsafeUnpin for AnsweredReads<R, A>where
A: UnsafeUnpin,
Vec<ImageSample<R>>: UnsafeUnpin,
Vec<ImageLoad<R>>: UnsafeUnpin,
Vec<ImageQuery<R>>: UnsafeUnpin,
impl<R, A> UnwindSafe for AnsweredReads<R, A>where
A: UnwindSafe,
Vec<ImageSample<R>>: UnwindSafe,
Vec<ImageLoad<R>>: UnwindSafe,
Vec<ImageQuery<R>>: UnwindSafe,
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