|
|
@@ -53,12 +53,15 @@
|
|
|
# if BGFX_CONFIG_PROFILER_MICROPROFILE
|
|
|
# include <microprofile.h>
|
|
|
# define BGFX_PROFILER_SCOPE(_group, _name, _color) MICROPROFILE_SCOPEI(#_group, #_name, _color)
|
|
|
+# define BGFX_PROFILER_SET_CURRENT_THREAD_NAME(_name) BX_NOOP()
|
|
|
# elif BGFX_CONFIG_PROFILER_REMOTERY
|
|
|
# define RMT_ENABLED BGFX_CONFIG_PROFILER_REMOTERY
|
|
|
# include <remotery/lib/Remotery.h>
|
|
|
# define BGFX_PROFILER_SCOPE(_group, _name, _color) rmt_ScopedCPUSample(_group##_##_name)
|
|
|
+# define BGFX_PROFILER_SET_CURRENT_THREAD_NAME(_name) rmt_SetCurrentThreadName(_name)
|
|
|
# else
|
|
|
# define BGFX_PROFILER_SCOPE(_group, _name, _color) BX_NOOP()
|
|
|
+# define BGFX_PROFILER_SET_CURRENT_THREAD_NAME(_name) BX_NOOP()
|
|
|
# endif // BGFX_CONFIG_PROFILER_*
|
|
|
#endif // BGFX_PROFILER_SCOPE
|
|
|
|
|
|
@@ -2028,6 +2031,7 @@ namespace bgfx
|
|
|
static int32_t renderThread(void* /*_userData*/)
|
|
|
{
|
|
|
BX_TRACE("render thread start");
|
|
|
+ BGFX_PROFILER_SET_CURRENT_THREAD_NAME("bgfx - Render Thread");
|
|
|
while (RenderFrame::Exiting != bgfx::renderFrame() ) {};
|
|
|
BX_TRACE("render thread exit");
|
|
|
return EXIT_SUCCESS;
|
|
|
@@ -3796,7 +3800,7 @@ namespace bgfx
|
|
|
{
|
|
|
if (!m_singleThreaded)
|
|
|
{
|
|
|
- BGFX_PROFILER_SCOPE(bgfx, main_thread_wait, 0xff2040ff)
|
|
|
+ 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);
|
|
|
@@ -3816,7 +3820,7 @@ namespace bgfx
|
|
|
{
|
|
|
if (!m_singleThreaded)
|
|
|
{
|
|
|
- BGFX_PROFILER_SCOPE(bgfx, render_thread_wait, 0xff2040ff)
|
|
|
+ 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);
|