Merge pull request #172 from linebender/query_pool_size

Fix query pool size
This commit is contained in:
Raph Levien 2022-05-19 15:39:31 -07:00 committed by GitHub
commit a4299c1f02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 3 deletions

View file

@ -110,7 +110,7 @@ impl GfxState {
.map(|_| session.create_semaphore())
.collect::<Result<Vec<_>, Error>>()?;
let query_pools = (0..NUM_FRAMES)
.map(|_| session.create_query_pool(8))
.map(|_| session.create_query_pool(Renderer::QUERY_POOL_SIZE))
.collect::<Result<Vec<_>, Error>>()?;
let submitted = Default::default();
let cmd_bufs = Default::default();

View file

@ -232,7 +232,7 @@ fn main() -> Result<(), Error> {
let session = Session::new(device);
let mut cmd_buf = session.cmd_buf()?;
let query_pool = session.create_query_pool(8)?;
let query_pool = session.create_query_pool(Renderer::QUERY_POOL_SIZE)?;
let mut ctx = PietGpuRenderContext::new();
if let Some(input) = matches.value_of("INPUT") {

View file

@ -70,7 +70,7 @@ fn main() -> Result<(), Error> {
.map(|_| session.create_semaphore())
.collect::<Result<Vec<_>, Error>>()?;
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>>()?;
let mut cmd_bufs: [Option<CmdBuf>; NUM_FRAMES] = Default::default();
let mut submitted: [Option<SubmittedCmdBuf>; NUM_FRAMES] = Default::default();

View file

@ -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,