pub struct QueryPool { /* private fields */ }
Expand description
A collection of one or more queries of a particular type.
Implementations§
source§impl QueryPool
impl QueryPool
sourcepub fn new(
device: Arc<Device>,
create_info: QueryPoolCreateInfo
) -> Result<Arc<QueryPool>, Validated<VulkanError>>
pub fn new( device: Arc<Device>, create_info: QueryPoolCreateInfo ) -> Result<Arc<QueryPool>, Validated<VulkanError>>
Creates a new QueryPool
.
sourcepub unsafe fn from_handle(
device: Arc<Device>,
handle: QueryPool,
create_info: QueryPoolCreateInfo
) -> Arc<QueryPool>
pub unsafe fn from_handle( device: Arc<Device>, handle: QueryPool, create_info: QueryPoolCreateInfo ) -> Arc<QueryPool>
Creates a new QueryPool
from a raw object handle.
Safety
handle
must be a valid Vulkan object handle created fromdevice
.create_info
must match the info used to create the object.
sourcepub fn query_type(&self) -> &QueryType
pub fn query_type(&self) -> &QueryType
Returns the query type of the pool.
sourcepub fn query_count(&self) -> u32
pub fn query_count(&self) -> u32
Returns the number of query slots of this query pool.
sourcepub fn get_results<T>(
&self,
range: Range<u32>,
destination: &mut [T],
flags: QueryResultFlags
) -> Result<bool, Validated<VulkanError>>where
T: QueryResultElement,
pub fn get_results<T>( &self, range: Range<u32>, destination: &mut [T], flags: QueryResultFlags ) -> Result<bool, Validated<VulkanError>>where T: QueryResultElement,
Copies the results of a range of queries to a buffer on the CPU.
self.ty().result_len()
will be written for each query in the range, plus 1 extra
element per query if WITH_AVAILABILITY
is enabled. The provided buffer must be large
enough to hold the data.
true
is returned if every result was available and written to the buffer. false
is returned if some results were not yet available; these will not be written to the buffer.
See also copy_query_pool_results
.
Trait Implementations§
source§impl DeviceOwned for QueryPool
impl DeviceOwned for QueryPool
source§impl PartialEq for QueryPool
impl PartialEq for QueryPool
source§impl VulkanObject for QueryPool
impl VulkanObject for QueryPool
impl Eq for QueryPool
Auto Trait Implementations§
impl !RefUnwindSafe for QueryPool
impl Send for QueryPool
impl Sync for QueryPool
impl Unpin for QueryPool
impl !UnwindSafe for QueryPool
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
source§impl<T> DeviceOwnedVulkanObject for Twhere
T: DeviceOwned + VulkanObject,
impl<T> DeviceOwnedVulkanObject for Twhere T: DeviceOwned + VulkanObject,
source§fn set_debug_utils_object_name(
&self,
object_name: Option<&str>
) -> Result<(), VulkanError>
fn set_debug_utils_object_name( &self, object_name: Option<&str> ) -> Result<(), VulkanError>
Assigns a human-readable name to the object for debugging purposes. Read more