From 3239ba18797b1aa098056aa0c2a70e250a27a06c Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 24 Oct 2021 13:24:13 +0800 Subject: * port shader --- Runtime/Profiling/FrameStats.cpp | 12 ++++++++++++ Runtime/Profiling/FrameStats.h | 29 +++++++++++++++++++++++++++++ Runtime/Profiling/Profiler.h | 0 3 files changed, 41 insertions(+) create mode 100644 Runtime/Profiling/FrameStats.cpp create mode 100644 Runtime/Profiling/FrameStats.h create mode 100644 Runtime/Profiling/Profiler.h (limited to 'Runtime/Profiling') diff --git a/Runtime/Profiling/FrameStats.cpp b/Runtime/Profiling/FrameStats.cpp new file mode 100644 index 0000000..a89ef4a --- /dev/null +++ b/Runtime/Profiling/FrameStats.cpp @@ -0,0 +1,12 @@ +#pragma once +#include "FrameStats.h" + +void FrameStats::AddDrawCall(uint n) +{ + +} + +void FrameStats::AddTrianglesCount(uint n) +{ + +} \ No newline at end of file diff --git a/Runtime/Profiling/FrameStats.h b/Runtime/Profiling/FrameStats.h new file mode 100644 index 0000000..b3073d5 --- /dev/null +++ b/Runtime/Profiling/FrameStats.h @@ -0,0 +1,29 @@ +#ifndef FRAME_STATS_H +#define FRAME_STATS_H + +#include "../Utilities/Singleton.h" +#include "../Utilities/UtilMacros.h" +#include "../Utilities/Type.h" + +class FrameStats : public Singleton +{ +public: + void OnBeginFrame(); + void OnEndFrame(); + + void AddDrawCall(uint n = 1); + void AddTrianglesCount(uint n = 1); + + GET(uint, DrawCall, m_DrawCall); + GET(uint, TrianglesCount, m_TrianglesCount); + +private: + + uint m_DrawCall; + uint m_TrianglesCount; + +}; + +#define g_FrameStats (*FrameStats::Instance()) + +#endif \ No newline at end of file diff --git a/Runtime/Profiling/Profiler.h b/Runtime/Profiling/Profiler.h new file mode 100644 index 0000000..e69de29 -- cgit v1.1-26-g67d0