From f35ee09e4eaf9ca6d12762f812c0179db08e441b Mon Sep 17 00:00:00 2001 From: Razakhel Date: Sat, 16 Mar 2024 11:19:15 +0100 Subject: [PATCH] [Render/RenderPass] Added GPU zones for render passes - They are given the passes' name if there is one - Added a specific zone for the geometry pass --- src/RaZ/Render/RenderGraph.cpp | 3 +++ src/RaZ/Render/RenderPass.cpp | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/RaZ/Render/RenderGraph.cpp b/src/RaZ/Render/RenderGraph.cpp index 8a9c0bb2..315bcadb 100644 --- a/src/RaZ/Render/RenderGraph.cpp +++ b/src/RaZ/Render/RenderGraph.cpp @@ -5,6 +5,8 @@ #include "RaZ/Render/RenderSystem.hpp" #include "tracy/Tracy.hpp" +#include "GL/glew.h" // Needed by TracyOpenGL.hpp +#include "tracy/TracyOpenGL.hpp" namespace Raz { @@ -60,6 +62,7 @@ void RenderGraph::execute(RenderSystem& renderSystem) { void RenderGraph::executeGeometryPass(RenderSystem& renderSystem) const { ZoneScopedN("RenderGraph::executeGeometryPass"); + TracyGpuZone("Geometry pass") #if !defined(USE_OPENGL_ES) m_geometryPass.m_timer.start(); diff --git a/src/RaZ/Render/RenderPass.cpp b/src/RaZ/Render/RenderPass.cpp index 6d844dc3..239494f6 100644 --- a/src/RaZ/Render/RenderPass.cpp +++ b/src/RaZ/Render/RenderPass.cpp @@ -3,6 +3,8 @@ #include "RaZ/Render/Texture.hpp" #include "tracy/Tracy.hpp" +#include "GL/glew.h" // Needed by TracyOpenGL.hpp +#include "tracy/TracyOpenGL.hpp" namespace Raz { @@ -42,13 +44,15 @@ void RenderPass::execute() const { if (!m_enabled) return; -#if !defined(USE_OPENGL_ES) - m_timer.start(); + TracyGpuZoneTransient(_, (m_name.empty() ? "[Unnamed pass]" : m_name.c_str()), true) +#if !defined(USE_OPENGL_ES) #if defined(RAZ_CONFIG_DEBUG) if (Renderer::checkVersion(4, 3) && !m_name.empty()) Renderer::pushDebugGroup(m_name); #endif + + m_timer.start(); #endif // Binding the program's textures marks it as used