Hey all, I'm fairly new to Vulkan and may have a fundamental misunderstanding. I'm developing on MacOS on a super beefy Mac Studio, so my question may be biased by performance or compatibility issues since we have to use MoltenVK.
Here's the rust/ash repo I'm working on https://github.com/wizebin/ash-base
And here's the file with the code below in it https://github.com/wizebin/ash-base/blob/3fa3747cd9773ff53342035a51fbb88ff6bc42df/src/main.rs
Here's the constant defining how many quads to create and render https://github.com/wizebin/ash-base/blob/3fa3747cd9773ff53342035a51fbb88ff6bc42df/src/main.rs#L529
I'm following several samples, primarily the main sample from the vulkan ash crate https://github.com/ash-rs/ash/tree/master/ash-examples/src and having some terrible performance.
With just 200 quads, this function (found https://github.com/wizebin/ash-base/blob/3fa3747cd9773ff53342035a51fbb88ff6bc42df/src/main.rs#L617) takes about 80ms to run, quite far beyond the needed 16ms for 60fps
record_submit_commandbuffer(
// SNIPPED FOR DISCORD MESSAGE LENGTH
device.cmd_end_render_pass(draw_command_buffer);
},
);
This ends up making the scene quite jittery, I am able to render significantly more quads with the same content using the cpu and rending with SDL so it absolutely must be an issue with the way I'm using Vulkan. The process of updating quads and resending data to the gpu is incredibly fast, but the render itself is taking ages.
I attached a flamegraph of the execution with the function above highlighted in blue
Can somebody give me a few pointers about possible issues so I can get started with resolving these performance issues?