Skip to content

Commit

Permalink
[Render/MeshRenderer] Added GPU zones for drawing functions
Browse files Browse the repository at this point in the history
- Added a global zone for RenderSystem::update()
  • Loading branch information
Razakhel committed Mar 22, 2024
1 parent f35ee09 commit 6ff19dc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/RaZ/Render/Cubemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "RaZ/Utils/Logger.hpp"

#include "tracy/Tracy.hpp"
#include "GL/glew.h" // Needed by TracyOpenGL.hpp
#include "tracy/TracyOpenGL.hpp"

namespace Raz {

Expand Down Expand Up @@ -227,6 +229,7 @@ void Cubemap::unbind() const {

void Cubemap::draw() const {
ZoneScopedN("Cubemap::draw");
TracyGpuZone("Cubemap::draw")

Renderer::setDepthFunction(DepthStencilFunction::LESS_EQUAL);

Expand Down
3 changes: 3 additions & 0 deletions src/RaZ/Render/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "RaZ/Utils/Logger.hpp"

#include "tracy/Tracy.hpp"
#include "GL/glew.h" // Needed by TracyOpenGL.hpp
#include "tracy/TracyOpenGL.hpp"

namespace Raz {

Expand Down Expand Up @@ -179,6 +181,7 @@ void Framebuffer::unbind() const {

void Framebuffer::display() const {
ZoneScopedN("Framebuffer::display");
TracyGpuZone("Framebuffer::display")

Renderer::clear(MaskType::COLOR);
drawDisplaySurface();
Expand Down
3 changes: 3 additions & 0 deletions src/RaZ/Render/MeshRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "RaZ/Utils/Logger.hpp"

#include "tracy/Tracy.hpp"
#include "GL/glew.h" // Needed by TracyOpenGL.hpp
#include "tracy/TracyOpenGL.hpp"

namespace Raz {

Expand Down Expand Up @@ -97,6 +99,7 @@ void MeshRenderer::loadMaterials() const {

void MeshRenderer::draw() const {
ZoneScopedN("MeshRenderer::draw");
TracyGpuZone("MeshRenderer::draw")

for (const SubmeshRenderer& submeshRenderer : m_submeshRenderers) {
if (submeshRenderer.getMaterialIndex() != std::numeric_limits<std::size_t>::max()) {
Expand Down
3 changes: 3 additions & 0 deletions src/RaZ/Render/RenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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 All @@ -33,6 +35,7 @@ void RenderSystem::resizeViewport(unsigned int width, unsigned int height) {

bool RenderSystem::update(const FrameTimeInfo& timeInfo) {
ZoneScopedN("RenderSystem::update");
TracyGpuZone("RenderSystem::update")

m_cameraUbo.bindBase(0);
m_lightsUbo.bindBase(1);
Expand Down
3 changes: 3 additions & 0 deletions src/RaZ/Render/SubmeshRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "RaZ/Utils/Logger.hpp"

#include "tracy/Tracy.hpp"
#include "GL/glew.h" // Needed by TracyOpenGL.hpp
#include "tracy/TracyOpenGL.hpp"

namespace Raz {

Expand Down Expand Up @@ -64,6 +66,7 @@ void SubmeshRenderer::load(const Submesh& submesh, RenderMode renderMode) {

void SubmeshRenderer::draw() const {
ZoneScopedN("SubmeshRenderer::draw");
TracyGpuZone("SubmeshRenderer::draw")

m_vao.bind();
m_ibo.bind();
Expand Down

0 comments on commit 6ff19dc

Please sign in to comment.