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 pipeline_statistics(&self) -> QueryPipelineStatisticFlags
pub fn pipeline_statistics(&self) -> QueryPipelineStatisticFlags
Returns the pipeline statistics flags of this query pool.
Sourcepub const fn result_len(&self, result_flags: QueryResultFlags) -> DeviceSize
pub const fn result_len(&self, result_flags: QueryResultFlags) -> DeviceSize
Returns the number of QueryResultElement
s that are needed to hold the result of a
single query of this type.
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
.
Sourcepub unsafe fn reset(
&self,
range: Range<u32>,
) -> Result<(), Box<ValidationError>>
pub unsafe fn reset( &self, range: Range<u32>, ) -> Result<(), Box<ValidationError>>
Resets a range of queries.
The host_query_reset
feature must be enabled on the device.
§Safety
For the queries indicated by range
:
- There must be no operations pending or executing on the device.
- There must be no calls to
reset*
orget_results*
executing concurrently on another thread.