pub struct AnsweredBuffers<S, F> {
pub images: S,
pub answer: F,
pub reads: Vec<(BufferRead, u32)>,
pub queries: Vec<(u32, Option<u32>)>,
/* private fields */
}Expand description
A read-only sampler combining image answers (for example super::AnsweredReads) with finite structured views.
Successful structured reads retain both request and answer; failed reads stop with the request and reason.
Image reads are delegated unchanged. Stores and atomics are refused, even if images could answer them.
Buffer lengths come only from extents, never from an image sampler’s absent-view policy.
An undeclared structured view is an error. An element beyond a declared extent reads zero, D3D’s stated view
rule, without calling answer. An invalid offset within an element is always refused. The executor may use
Sampler::buffer_elements to resolve an out-of-range read before calling structured; queries records those
extent requests, while reads records only the structured calls actually made, not a complete instruction trace.
Lifted bounds guards can also read a valid element before masking its value away; the caller must answer every
requested in-range word, not only the element it expects the final output to use.
Fields§
§images: SThe sampler that answers image reads.
answer: FThe function that answers each structured read.
reads: Vec<(BufferRead, u32)>The structured reads made, each with the word answered.
queries: Vec<(u32, Option<u32>)>The extent requests made: the slot and the element count answered, None for an undeclared view.
Implementations§
Source§impl<S, F> AnsweredBuffers<S, F>
impl<S, F> AnsweredBuffers<S, F>
Trait Implementations§
Source§impl<S: Sampler, F: FnMut(BufferRead) -> Result<u32, String>> Sampler for AnsweredBuffers<S, F>
impl<S: Sampler, F: FnMut(BufferRead) -> Result<u32, String>> Sampler for AnsweredBuffers<S, F>
Source§fn sample(&mut self, request: Sample) -> Result<[f32; 4], String>
fn sample(&mut self, request: Sample) -> Result<[f32; 4], String>
Sample with the texel’s four lanes as floats, or an error that stops the evaluation.Source§fn load(&mut self, request: Load) -> Result<[u32; 4], String>
fn load(&mut self, request: Load) -> Result<[u32; 4], String>
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>
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>
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>
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>
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>
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 store(&mut self, request: Store) -> Result<(), String>
fn store(&mut self, request: Store) -> Result<(), String>
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>
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>
Source§fn store_image(&mut self, request: ImageStore<u32>) -> Result<(), String>
fn store_image(&mut self, request: ImageStore<u32>) -> Result<(), String>
Sampler::store.