Adding in tracy profiler
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user