diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-02-26 11:07:32 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-02-26 11:07:32 +0200 |
commit | f6910d35f702e7767e6b52d5e7b3edd80fe85f96 (patch) | |
tree | 3968c943b721813f6880765e11a8ae2ade07da23 /src/rw/RwHelper.cpp | |
parent | 82322293fe65682c32ee18a82296e8727f42d788 (diff) | |
parent | b01d6be3f4fe4f0555fd98393b13297b267f860a (diff) |
Merge branch 'miami' into lcs
# Conflicts:
# README.md
# premake5.lua
# src/audio/MusicManager.cpp
# src/core/main.cpp
# src/core/re3.cpp
# src/extras/postfx.cpp
# src/render/Font.cpp
Diffstat (limited to 'src/rw/RwHelper.cpp')
-rw-r--r-- | src/rw/RwHelper.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index 186ed870..12816c29 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -9,6 +9,7 @@ #endif #ifndef FINAL RtCharset *debugCharset; +bool bDebugRenderGroups; #endif #ifdef PS2_ALPHA_TEST @@ -102,6 +103,36 @@ SetCullMode(uint32 mode) RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE); } +#ifndef FINAL +void +PushRendergroup(const char *name) +{ + if(!bDebugRenderGroups) + return; +#if defined(RW_OPENGL) + if(GLAD_GL_KHR_debug) + glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, name); +#elif defined(RW_D3D9) + static WCHAR tmp[256]; + MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, tmp, sizeof(tmp)); + D3DPERF_BeginEvent(0xFFFFFFFF, tmp); +#endif +} + +void +PopRendergroup(void) +{ + if(!bDebugRenderGroups) + return; +#if defined(RW_OPENGL) + if(GLAD_GL_KHR_debug) + glPopDebugGroup(); +#elif defined(RW_D3D9) + D3DPERF_EndEvent(); +#endif +} +#endif + RwFrame* GetFirstFrameCallback(RwFrame *child, void *data) { |