diff --git a/piet-gpu/bin/android.rs b/piet-gpu/bin/android.rs index 25fcaed..968405e 100644 --- a/piet-gpu/bin/android.rs +++ b/piet-gpu/bin/android.rs @@ -110,7 +110,7 @@ impl GfxState { .map(|_| session.create_semaphore()) .collect::, Error>>()?; let query_pools = (0..NUM_FRAMES) - .map(|_| session.create_query_pool(12)) + .map(|_| session.create_query_pool(Renderer::QUERY_POOL_SIZE)) .collect::, Error>>()?; let submitted = Default::default(); let cmd_bufs = Default::default(); diff --git a/piet-gpu/bin/winit.rs b/piet-gpu/bin/winit.rs index 1642026..3341d3a 100644 --- a/piet-gpu/bin/winit.rs +++ b/piet-gpu/bin/winit.rs @@ -70,7 +70,7 @@ fn main() -> Result<(), Error> { .map(|_| session.create_semaphore()) .collect::, Error>>()?; let query_pools = (0..NUM_FRAMES) - .map(|_| session.create_query_pool(12)) + .map(|_| session.create_query_pool(Renderer::QUERY_POOL_SIZE)) .collect::, Error>>()?; let mut cmd_bufs: [Option; NUM_FRAMES] = Default::default(); let mut submitted: [Option; NUM_FRAMES] = Default::default(); diff --git a/piet-gpu/src/lib.rs b/piet-gpu/src/lib.rs index d32a9c5..f5e91d5 100644 --- a/piet-gpu/src/lib.rs +++ b/piet-gpu/src/lib.rs @@ -143,6 +143,9 @@ impl RenderConfig { } impl Renderer { + /// The number of query pool entries needed to run the renderer. + pub const QUERY_POOL_SIZE: u32 = 12; + pub unsafe fn new( session: &Session, width: usize,