Measuring performance in Vulkan with timestamp queries
Measuring the performance of CPU and GPU workloads side by side is invaluable. The Tracy profiler allows you to do just that in a cross-platform way with minimal intrusion. And it’s easy to use, all within a small C++ library.
In this recipe, you will learn how to integrate Tracy Profiler into your app and instrument it to collect GPU performance information.
Getting ready
The first thing to do is to download Tracy from https://github.com/wolfpld/tracy and include it in your project. You should also download the Tracy client/server to collect and inspect the data.
How to do it…
Instrumenting your code to use with Tracy is easy and requires only a few steps. To be able to collect data about the GPU performance, you will need a Tracy/Vulkan context along with a dedicated command buffer for it to calibrate the timestamps. After that, instrumenting your code is straightforward:
- First, include the...