Adding in tracy profiler

This commit is contained in:
2026-09-30 02:04:59 -07:00
parent 97ff85ea8a
commit 812d50127e
13 changed files with 50 additions and 4 deletions
+9 -2
View File
@@ -4,6 +4,7 @@
#include <sophia/util/assert.hpp>
#include <sophia/util/logger.hpp>
#include <stdexcept>
#include <tracy/Tracy.hpp>
#include "vulkan/access.hpp"
@@ -18,14 +19,19 @@ RenderContext::RenderContext(Window& window, Device& device)
RenderContext::~RenderContext() { this->device.waitIdle(); }
vk::CommandBuffer RenderContext::beginFrame() {
ZoneScoped;
SOPHIA_ASSERT(!this->isFrameStarted,
"Can't call beginFrame while already in progress");
FrameData& frame = this->frames[this->currentFrameIndex];
vk::Fence inFlightFence = frame.inFlight.get();
vk::Result fenceResult = this->device.get()->waitForFences(
inFlightFence, vk::True, std::numeric_limits<u64>::max());
vk::Result fenceResult;
{
ZoneScopedN("wait for frame fence");
fenceResult = this->device.get()->waitForFences(
inFlightFence, vk::True, std::numeric_limits<u64>::max());
}
if (fenceResult != vk::Result::eSuccess) {
log::error("failed to wait for fence: " + vk::to_string(fenceResult));
@@ -73,6 +79,7 @@ vk::CommandBuffer RenderContext::beginFrame() {
}
void RenderContext::endFrame() {
ZoneScoped;
SOPHIA_ASSERT(this->isFrameStarted,
"Can't call endFrame while no frame is in progress");