Browse Source

Turn off SDL GPU backend debug mode by default

The SDL property `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN` defaults to true if not specified.

Measured performance impact:
Benchmark active: 47 FPS to 103 FPS
Benchmark idle:  120 FPS to 800 FPS
Michael Ragazzon 4 months ago
parent
commit
7219fbfda9
1 changed files with 5 additions and 3 deletions
  1. 5 3
      Backends/RmlUi_Backend_SDL_GPU.cpp

+ 5 - 3
Backends/RmlUi_Backend_SDL_GPU.cpp

@@ -33,6 +33,10 @@
 #include <RmlUi/Core/Core.h>
 #include <RmlUi/Core/Log.h>
 
+#ifndef RMLUI_BACKEND_SDL_GPU_DEBUG
+	#define RMLUI_BACKEND_SDL_GPU_DEBUG false
+#endif
+
 /**
     Global data used by this backend.
 
@@ -83,9 +87,7 @@ bool Backend::Initialize(const char* window_name, int width, int height, bool al
 	SDL_SetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN, true);
 	SDL_SetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN, true);
 	SDL_SetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN, true);
-#ifdef RMLUI_DEBUG
-	SDL_SetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN, true);
-#endif
+	SDL_SetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN, RMLUI_BACKEND_SDL_GPU_DEBUG);
 	SDL_GPUDevice* device = SDL_CreateGPUDeviceWithProperties(props);
 	SDL_DestroyProperties(props);