Prechádzať zdrojové kódy

Fixed Remotery integration.

Branimir Karadžić 10 rokov pred
rodič
commit
f64c050460
3 zmenil súbory, kde vykonal 17 pridanie a 4 odobranie
  1. 4 2
      3rdparty/remotery/lib/Remotery.c
  2. 9 2
      src/bgfx.cpp
  3. 4 0
      src/config.h

+ 4 - 2
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;

+ 9 - 2
src/bgfx.cpp

@@ -3,13 +3,20 @@
  * License: http://www.opensource.org/licenses/BSD-2-Clause
  */
 
+#include <bx/bx.h>
+#if BX_PLATFORM_WINDOWS
+// BK - Remotery needs WinSock, but on VS2015/Win10 build
+//      fails if WinSock2 is included after Windows.h?!
+#	include <WinSock2.h>
+#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 <remotery/lib/Remotery.c>
-#endif
+#endif // BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB
 
 namespace bgfx
 {

+ 4 - 0
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