From f64c0504600a554662ab1f5659f0fa21d509518a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 16 Nov 2015 11:02:41 -0800 Subject: [PATCH] Fixed Remotery integration. --- 3rdparty/remotery/lib/Remotery.c | 6 ++++-- src/bgfx.cpp | 11 +++++++++-- src/config.h | 4 ++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/3rdparty/remotery/lib/Remotery.c b/3rdparty/remotery/lib/Remotery.c index 0653029f4..4b705b390 100644 --- a/3rdparty/remotery/lib/Remotery.c +++ b/3rdparty/remotery/lib/Remotery.c @@ -2901,6 +2901,8 @@ static void MessageQueue_CommitMessage(MessageQueue* queue, Message* message, Me // Setting the message ID signals to the consumer that the message is ready assert(message->id == MsgID_NotReady); message->id = id; + + RMT_UNREFERENCED_PARAMETER(queue); } @@ -5122,7 +5124,7 @@ RMT_API void _rmt_UnbindD3D11(void) d3d11->context = NULL; // Flush the main queue of allocated D3D timestamps - while (1) + for (;;) { Msg_SampleTree* sample_tree; Sample* sample; @@ -5249,7 +5251,7 @@ static void UpdateD3D11Frame(void) rmt_BeginCPUSample(rmt_UpdateD3D11Frame); // Process all messages in the D3D queue - while (1) + for (;;) { Msg_SampleTree* sample_tree; Sample* sample; diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 6e96c6ff1..7cc9badd0 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -3,13 +3,20 @@ * License: http://www.opensource.org/licenses/BSD-2-Clause */ +#include +#if BX_PLATFORM_WINDOWS +// BK - Remotery needs WinSock, but on VS2015/Win10 build +// fails if WinSock2 is included after Windows.h?! +# include +#endif // BX_PLATFORM_WINDOWS + #include "bgfx_p.h" -#if BGFX_CONFIG_PROFILER_REMOTERY +#if BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB # define RMT_USE_D3D11 BGFX_CONFIG_RENDERER_DIRECT3D11 # define RMT_USE_OPENGL 0 # include -#endif +#endif // BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB namespace bgfx { diff --git a/src/config.h b/src/config.h index 4f94ae137..9640a19a5 100644 --- a/src/config.h +++ b/src/config.h @@ -308,4 +308,8 @@ # define BGFX_CONFIG_PROFILER_REMOTERY 0 #endif // BGFX_CONFIG_PROFILER_REMOTERY +#ifndef BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB +# define BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB BGFX_CONFIG_PROFILER_REMOTERY +#endif // BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB + #endif // BGFX_CONFIG_H_HEADER_GUARD