Commit: f6d1edb4001a7f81f71f1c6b7b5a8b2436e06cc0
Parent: 496fbce8d1966ad4cc434913767a5a3df6fb111d
Author: Randy Palamar
Date:   Fri, 22 Aug 2025 11:07:33 -0600
core: attempt to coerce multi-gpu systems to use discrete device
Diffstat:
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/static.c b/static.c
@@ -1,4 +1,9 @@
 /* See LICENSE for license details. */
+
+/* NOTE(rnp): magic variables to force discrete GPU usage on laptops with multiple devices */
+EXPORT i32 NvOptimusEnablement = 1;
+EXPORT i32 AmdPowerXpressRequestHighPerformance = 1;
+
 #ifndef _DEBUG
 
 #include "beamformer.c"
diff --git a/util.h b/util.h
@@ -15,9 +15,15 @@
 #define typeof __typeof__
 #endif
 
+#if OS_WINDOWS
+  #define EXPORT __declspec(dllexport)
+#else
+  #define EXPORT
+#endif
+
 #ifdef _DEBUG
+  #define DEBUG_EXPORT EXPORT
   #if OS_WINDOWS
-    #define DEBUG_EXPORT __declspec(dllexport)
     #ifdef _BEAMFORMER_DLL
       #define DEBUG_IMPORT __declspec(dllimport)
     #else
@@ -29,7 +35,6 @@
     #else
       #define DEBUG_IMPORT
     #endif
-    #define DEBUG_EXPORT
   #endif
   #define DEBUG_DECL(a) a
   #define assert(c) do { if (!(c)) debugbreak(); } while (0)