debug: timing things

This commit is contained in:
Janis 2025-01-14 23:10:10 +01:00
parent 7640cf053b
commit 9802bec8b0
2 changed files with 73 additions and 61 deletions

View file

@ -1851,6 +1851,8 @@ impl EguiState {
const TEXTURE_BINDING: u32 = 0;
const UNIFORM_BINDING: u32 = 1;
fn new(device: Device) -> Result<Self> {
let (descriptor_pool, descriptor_layout, sets) =
util::timed("Create Descriptor Set", || {
let descriptor_pool = pipeline::DescriptorPool::new(
device.clone(),
pipeline::DescriptorPoolDesc {
@ -1902,6 +1904,9 @@ impl EguiState {
layout: &descriptor_layout,
}])?;
Result::Ok((descriptor_pool, descriptor_layout, sets))
})?;
let pipeline_layout = pipeline::PipelineLayout::new(
device.clone(),
pipeline::PipelineLayoutDesc {

View file

@ -426,6 +426,7 @@ impl RenderGraph {
.iter()
.map(|(rid, access)| (*rid, *access))
.collect::<Vec<_>>();
self.add_pass(PassDesc {
reads: output_reads,
writes: vec![],
@ -444,6 +445,7 @@ impl RenderGraph {
});
// create internal resources:
util::timed("Create internal RenderGraph resources:", || {
for (i, res) in self.resources.iter_mut().enumerate() {
match res {
GraphResource::ImageDesc(image_desc) => {
@ -455,11 +457,16 @@ impl RenderGraph {
}
GraphResource::BufferDesc(buffer_desc) => {
tracing::trace!("creating resource #{i:?} with {buffer_desc:?}");
*res = GraphResource::Buffer(Buffer::new(device.clone(), buffer_desc.clone())?);
*res = GraphResource::Buffer(Buffer::new(
device.clone(),
buffer_desc.clone(),
)?);
}
_ => {}
}
}
ash::prelude::VkResult::Ok(())
})?;
let pool =
commands::SingleUseCommandPool::new(device.clone(), device.graphics_queue().clone())?;