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 | |
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')
-rw-r--r-- | src/rw/RwHelper.cpp | 31 | ||||
-rw-r--r-- | src/rw/RwHelper.h | 1 | ||||
-rw-r--r-- | src/rw/VisibilityPlugins.cpp | 2 |
3 files changed, 34 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) { diff --git a/src/rw/RwHelper.h b/src/rw/RwHelper.h index 9352d1fd..a3a1928c 100644 --- a/src/rw/RwHelper.h +++ b/src/rw/RwHelper.h @@ -1,5 +1,6 @@ #pragma once +extern bool bDebugRenderGroups; extern bool gPS2alphaTest; extern bool gBackfaceCulling; diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp index 69e30c1b..eebbb93b 100644 --- a/src/rw/VisibilityPlugins.cpp +++ b/src/rw/VisibilityPlugins.cpp @@ -233,7 +233,9 @@ CVisibilityPlugins::RenderFadingEntities(CLinkList<AlphaObjectInfo> &list) DeActivateDirectional(); SetAmbientColours(); e->bImBeingRendered = true; + PUSH_RENDERGROUP(mi->GetModelName()); RenderFadingAtomic((RpAtomic*)e->m_rwObject, node->item.sort); + POP_RENDERGROUP(); e->bImBeingRendered = false; }else CRenderer::RenderOneNonRoad(e); |