Skip to content

Commit

Permalink
[Render/RenderPass] Added GPU zones for render passes
Browse files Browse the repository at this point in the history
- They are given the passes' name if there is one

- Added a specific zone for the geometry pass
  • Loading branch information
Razakhel committed Mar 22, 2024
1 parent c588fb0 commit f35ee09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/RaZ/Render/RenderGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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();
Expand Down
8 changes: 6 additions & 2 deletions src/RaZ/Render/RenderPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f35ee09

Please sign in to comment.