mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 12:41:30 +11:00
Make query pool size an associated constant
This commit is contained in:
parent
ee6694729b
commit
693ecd69e1
|
@ -110,7 +110,7 @@ impl GfxState {
|
||||||
.map(|_| session.create_semaphore())
|
.map(|_| session.create_semaphore())
|
||||||
.collect::<Result<Vec<_>, Error>>()?;
|
.collect::<Result<Vec<_>, Error>>()?;
|
||||||
let query_pools = (0..NUM_FRAMES)
|
let query_pools = (0..NUM_FRAMES)
|
||||||
.map(|_| session.create_query_pool(12))
|
.map(|_| session.create_query_pool(Renderer::QUERY_POOL_SIZE))
|
||||||
.collect::<Result<Vec<_>, Error>>()?;
|
.collect::<Result<Vec<_>, Error>>()?;
|
||||||
let submitted = Default::default();
|
let submitted = Default::default();
|
||||||
let cmd_bufs = Default::default();
|
let cmd_bufs = Default::default();
|
||||||
|
|
|
@ -70,7 +70,7 @@ fn main() -> Result<(), Error> {
|
||||||
.map(|_| session.create_semaphore())
|
.map(|_| session.create_semaphore())
|
||||||
.collect::<Result<Vec<_>, Error>>()?;
|
.collect::<Result<Vec<_>, Error>>()?;
|
||||||
let query_pools = (0..NUM_FRAMES)
|
let query_pools = (0..NUM_FRAMES)
|
||||||
.map(|_| session.create_query_pool(12))
|
.map(|_| session.create_query_pool(Renderer::QUERY_POOL_SIZE))
|
||||||
.collect::<Result<Vec<_>, Error>>()?;
|
.collect::<Result<Vec<_>, Error>>()?;
|
||||||
let mut cmd_bufs: [Option<CmdBuf>; NUM_FRAMES] = Default::default();
|
let mut cmd_bufs: [Option<CmdBuf>; NUM_FRAMES] = Default::default();
|
||||||
let mut submitted: [Option<SubmittedCmdBuf>; NUM_FRAMES] = Default::default();
|
let mut submitted: [Option<SubmittedCmdBuf>; NUM_FRAMES] = Default::default();
|
||||||
|
|
|
@ -143,6 +143,9 @@ impl RenderConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Renderer {
|
impl Renderer {
|
||||||
|
/// The number of query pool entries needed to run the renderer.
|
||||||
|
pub const QUERY_POOL_SIZE: u32 = 12;
|
||||||
|
|
||||||
pub unsafe fn new(
|
pub unsafe fn new(
|
||||||
session: &Session,
|
session: &Session,
|
||||||
width: usize,
|
width: usize,
|
||||||
|
|
Loading…
Reference in a new issue