summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-02-18 13:08:29 +0100
committeraap <aap@papnet.eu>2021-02-18 13:08:29 +0100
commit3457ff48ce2ca0cb7bcda1e8a585e120843095c8 (patch)
tree884c0d8ceb6b051a2fdac774fad5db4ce8bcdf2a /src
parentfix last commit (diff)
downloadre3-3457ff48ce2ca0cb7bcda1e8a585e120843095c8.tar
re3-3457ff48ce2ca0cb7bcda1e8a585e120843095c8.tar.gz
re3-3457ff48ce2ca0cb7bcda1e8a585e120843095c8.tar.bz2
re3-3457ff48ce2ca0cb7bcda1e8a585e120843095c8.tar.lz
re3-3457ff48ce2ca0cb7bcda1e8a585e120843095c8.tar.xz
re3-3457ff48ce2ca0cb7bcda1e8a585e120843095c8.tar.zst
re3-3457ff48ce2ca0cb7bcda1e8a585e120843095c8.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/main.h9
-rw-r--r--src/rw/RwHelper.cpp24
2 files changed, 30 insertions, 3 deletions
diff --git a/src/core/main.h b/src/core/main.h
index 60ccc116..311c0302 100644
--- a/src/core/main.h
+++ b/src/core/main.h
@@ -1,8 +1,11 @@
#pragma once
-#if defined(RW_OPENGL)
-#define PUSH_RENDERGROUP(str) glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, str)
-#define POP_RENDERGROUP() glPopDebugGroup()
+#ifndef FINAL
+// defined in RwHelpder.cpp
+void PushRendergroup(const char *name);
+void PopRendergroup(void);
+#define PUSH_RENDERGROUP(str) PushRendergroup(str)
+#define POP_RENDERGROUP() PopRendergroup()
#else
#define PUSH_RENDERGROUP(str)
#define POP_RENDERGROUP()
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp
index 609dd79b..35617808 100644
--- a/src/rw/RwHelper.cpp
+++ b/src/rw/RwHelper.cpp
@@ -102,6 +102,30 @@ SetCullMode(uint32 mode)
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
}
+#ifndef FINAL
+void
+PushRendergroup(const char *name)
+{
+#if defined(RW_OPENGL)
+ 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 defined(RW_OPENGL)
+ glPopDebugGroup();
+#elif defined(RW_D3D9)
+ D3DPERF_EndEvent();
+#endif
+}
+#endif
+
RwFrame*
GetFirstFrameCallback(RwFrame *child, void *data)
{