mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 12:41:30 +11:00
Wait on query results
This shouldn't be necessary, but was causing NOT_READY errors.
This commit is contained in:
parent
6039916631
commit
a3d3f39fbd
|
@ -708,12 +708,16 @@ impl crate::backend::Device for VkDevice {
|
||||||
unsafe fn fetch_query_pool(&self, pool: &Self::QueryPool) -> Result<Vec<f64>, Error> {
|
unsafe fn fetch_query_pool(&self, pool: &Self::QueryPool) -> Result<Vec<f64>, Error> {
|
||||||
let device = &self.device.device;
|
let device = &self.device.device;
|
||||||
let mut buf = vec![0u64; pool.n_queries as usize];
|
let mut buf = vec![0u64; pool.n_queries as usize];
|
||||||
|
// It's unclear to me why WAIT is needed here, as the wait on the command buffer's
|
||||||
|
// fence should make the query available, but otherwise we get sporadic NOT_READY
|
||||||
|
// results (Windows 10, AMD 5700 XT).
|
||||||
|
let flags = vk::QueryResultFlags::TYPE_64 | vk::QueryResultFlags::WAIT;
|
||||||
device.get_query_pool_results(
|
device.get_query_pool_results(
|
||||||
pool.pool,
|
pool.pool,
|
||||||
0,
|
0,
|
||||||
pool.n_queries,
|
pool.n_queries,
|
||||||
&mut buf,
|
&mut buf,
|
||||||
vk::QueryResultFlags::TYPE_64,
|
flags,
|
||||||
)?;
|
)?;
|
||||||
let ts0 = buf[0];
|
let ts0 = buf[0];
|
||||||
let tsp = self.timestamp_period as f64 * 1e-9;
|
let tsp = self.timestamp_period as f64 * 1e-9;
|
||||||
|
|
Loading…
Reference in a new issue