|
|
@@ -49,6 +49,18 @@
|
|
|
, _handleAlloc.getMaxHandles() \
|
|
|
)
|
|
|
|
|
|
+#ifndef BGFX_PROFILER_SCOPE
|
|
|
+# if BGFX_CONFIG_PROFILER_MICROPROFILE
|
|
|
+# include <microprofile.h>
|
|
|
+# define BGFX_PROFILER_SCOPE(_group, _name, _color) MICROPROFILE_SCOPEI(_group, _name, _color)
|
|
|
+# elif BGFX_CONFIG_PROFILER_REMOTERY
|
|
|
+# include <remotery.h>
|
|
|
+# define BGFX_PROFILER_SCOPE(_group, _name, _color) rmt_ScopedCPUSample(_name)
|
|
|
+# else
|
|
|
+# define BGFX_PROFILER_SCOPE(_group, _name, _color) BX_NOOP()
|
|
|
+# endif // BGFX_CONFIG_PROFILER_*
|
|
|
+#endif // BGFX_PROFILER_SCOPE
|
|
|
+
|
|
|
namespace bgfx
|
|
|
{
|
|
|
#if BX_COMPILER_CLANG_ANALYZER
|
|
|
@@ -3783,6 +3795,7 @@ namespace bgfx
|
|
|
{
|
|
|
if (!m_singleThreaded)
|
|
|
{
|
|
|
+ BGFX_PROFILER_SCOPE("bgfx", "main thread wait", 0xff2040ff)
|
|
|
int64_t start = bx::getHPCounter();
|
|
|
bool ok = m_gameSem.wait();
|
|
|
BX_CHECK(ok, "Semaphore wait failed."); BX_UNUSED(ok);
|
|
|
@@ -3802,6 +3815,7 @@ namespace bgfx
|
|
|
{
|
|
|
if (!m_singleThreaded)
|
|
|
{
|
|
|
+ BGFX_PROFILER_SCOPE("bgfx", "render thread wait", 0xff2040ff)
|
|
|
int64_t start = bx::getHPCounter();
|
|
|
bool ok = m_renderSem.wait();
|
|
|
BX_CHECK(ok, "Semaphore wait failed."); BX_UNUSED(ok);
|