-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- editor telemetry panel - performance telemetry collection logic - enabled faceculling
- Loading branch information
1 parent
971bd85
commit 289d04f
Showing
18 changed files
with
195 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
#include "Profiler.h" | ||
|
||
namespace elv { | ||
void ProfileTelemetry::Update(const std::string& name, const float value) | ||
{ | ||
m_telemetry[name] = value; | ||
} | ||
} // namespace elv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include "ProfileTelemetryPanel.h" | ||
|
||
#include "Core/Application.h" | ||
#include "Core/Profiler.h" | ||
#include "Renderer/Renderer2D.h" | ||
|
||
#include <imgui.h> | ||
#include <imgui_internal.h> | ||
|
||
namespace elv::editor { | ||
void ProfileTelemetryPanel::OnImGuiRender() | ||
{ | ||
ImGui::Begin("Telemetry"); | ||
|
||
const ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags_DefaultOpen | ||
| ImGuiTreeNodeFlags_Framed | ||
| ImGuiTreeNodeFlags_SpanAvailWidth | ||
| ImGuiTreeNodeFlags_AllowItemOverlap | ||
| ImGuiTreeNodeFlags_FramePadding; | ||
|
||
{ | ||
const bool opened = ImGui::TreeNodeEx("Performance", flags); | ||
|
||
if (opened) { | ||
|
||
ImGui::Text("FPS: %.1f", Application::GetTelemetry().fps); | ||
ImGui::Text("Frame time %.3f ms", Application::GetTelemetry().frameTime); | ||
|
||
ImGui::Separator(); | ||
|
||
const auto& telemetry = ProfileTelemetry::GetInstance().GetTelemetry(); | ||
|
||
for (const auto& info : telemetry) { | ||
ImGui::Text("%s: %.3f ms", info.first.c_str(), info.second); | ||
} | ||
|
||
ImGui::TreePop(); | ||
} | ||
} | ||
|
||
{ | ||
const bool opened = ImGui::TreeNodeEx("2D Renderer", flags); | ||
if (opened) { | ||
ImGui::Text(" draw calls: %i", Renderer2D::GetTelemetry().drawCalls); | ||
ImGui::TreePop(); | ||
} | ||
} | ||
|
||
ImGui::End(); | ||
} | ||
} // namespace elv::editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
namespace elv::editor { | ||
|
||
class ProfileTelemetryPanel { | ||
public: | ||
void OnImGuiRender(); | ||
}; | ||
} // namespace elv::editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.