pub struct SamplesPassedQuery { /* private fields */ }
Expand description
A query that allows you to know the number of samples written to the output during the draw operations where this query was active.
If you just want to know whether or not some samples have been written, you should use
a AnySamplesPassedQuery
query instead.
Implementations§
Source§impl SamplesPassedQuery
impl SamplesPassedQuery
Sourcepub fn new<F>(facade: &F) -> Result<SamplesPassedQuery, QueryCreationError>
pub fn new<F>(facade: &F) -> Result<SamplesPassedQuery, QueryCreationError>
Builds a new query.
Source§impl SamplesPassedQuery
impl SamplesPassedQuery
Sourcepub fn get(self) -> u32
pub fn get(self) -> u32
Returns the value of the query. Blocks until it is available.
This function doesn’t block if is_ready
would return true.
Note that you are strongly discouraged from calling this in the middle of the rendering process, as it may block for a long time.
Queries should either have their result written into a buffer, be used for conditional rendering, or stored and checked during the next frame.
Sourcepub fn to_buffer_u32(
&self,
target: BufferSlice<'_, u32>,
) -> Result<(), ToBufferError>
pub fn to_buffer_u32( &self, target: BufferSlice<'_, u32>, ) -> Result<(), ToBufferError>
Writes the result of the query to a buffer when it is available.
This function doesn’t block. Instead it submits a commands to the GPU’s commands queue and orders the GPU to write the result of the query to a buffer.
This operation is not necessarily supported everywhere.
Trait Implementations§
Source§impl Debug for SamplesPassedQuery
impl Debug for SamplesPassedQuery
Source§impl<'a> From<&'a SamplesPassedQuery> for SamplesQueryParam<'a>
impl<'a> From<&'a SamplesPassedQuery> for SamplesQueryParam<'a>
Source§fn from(r: &'a SamplesPassedQuery) -> SamplesQueryParam<'a>
fn from(r: &'a SamplesPassedQuery) -> SamplesQueryParam<'a>
Auto Trait Implementations§
impl !Freeze for SamplesPassedQuery
impl !RefUnwindSafe for SamplesPassedQuery
impl !Send for SamplesPassedQuery
impl !Sync for SamplesPassedQuery
impl Unpin for SamplesPassedQuery
impl !UnwindSafe for SamplesPassedQuery
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.