SDL: Removed the preferLowPower parameter from SDL_CreateGPUDevice()

From 62f6e6b701b4a09298140a96cd0e21ff45ff22a1 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 29 Aug 2024 16:35:28 -0700
Subject: [PATCH] Removed the preferLowPower parameter from
 SDL_CreateGPUDevice()

---
 include/SDL3/SDL_gpu.h        | 3 ---
 src/dynapi/SDL_dynapi_procs.h | 2 +-
 src/gpu/SDL_gpu.c             | 4 +---
 test/testgpu_spinning_cube.c  | 3 +--
 4 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/include/SDL3/SDL_gpu.h b/include/SDL3/SDL_gpu.h
index 8e82ffd04accc..5f7f77d3b7aef 100644
--- a/include/SDL3/SDL_gpu.h
+++ b/include/SDL3/SDL_gpu.h
@@ -926,8 +926,6 @@ typedef struct SDL_GPUStorageTextureWriteOnlyBinding
  * \param formatFlags a bitflag indicating which shader formats the app is
  *                    able to provide.
  * \param debugMode enable debug mode properties and validations.
- * \param preferLowPower set this to SDL_TRUE if your app prefers energy
- *                       efficiency over maximum GPU performance.
  * \param name the preferred GPU driver, or NULL to let SDL pick the optimal
  *             driver.
  * \returns a GPU context on success or NULL on failure.
@@ -940,7 +938,6 @@ typedef struct SDL_GPUStorageTextureWriteOnlyBinding
 extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice(
     SDL_GPUShaderFormat formatFlags,
     SDL_bool debugMode,
-    SDL_bool preferLowPower,
     const char *name);
 
 /**
diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h
index c7cc12a9039b4..d1573cdc37c6d 100644
--- a/src/dynapi/SDL_dynapi_procs.h
+++ b/src/dynapi/SDL_dynapi_procs.h
@@ -1091,7 +1091,7 @@ SDL_DYNAPI_PROC(size_t,SDL_wcsnlen,(const wchar_t *a, size_t b),(a,b),return)
 SDL_DYNAPI_PROC(wchar_t*,SDL_wcsnstr,(const wchar_t *a, const wchar_t *b, size_t c),(a,b,c),return)
 SDL_DYNAPI_PROC(wchar_t*,SDL_wcsstr,(const wchar_t *a, const wchar_t *b),(a,b),return)
 SDL_DYNAPI_PROC(long,SDL_wcstol,(const wchar_t *a, wchar_t **b, int c),(a,b,c),return)
-SDL_DYNAPI_PROC(SDL_GPUDevice*,SDL_CreateGPUDevice,(SDL_GPUShaderFormat a, SDL_bool b, SDL_bool c, const char *d),(a,b,c,d),return)
+SDL_DYNAPI_PROC(SDL_GPUDevice*,SDL_CreateGPUDevice,(SDL_GPUShaderFormat a, SDL_bool b, const char *c),(a,b,c),return)
 SDL_DYNAPI_PROC(SDL_GPUDevice*,SDL_CreateGPUDeviceWithProperties,(SDL_PropertiesID a),(a),return)
 SDL_DYNAPI_PROC(void,SDL_DestroyGPUDevice,(SDL_GPUDevice *a),(a),)
 SDL_DYNAPI_PROC(SDL_GPUDriver,SDL_GetGPUDriver,(SDL_GPUDevice *a),(a),return)
diff --git a/src/gpu/SDL_gpu.c b/src/gpu/SDL_gpu.c
index ed498fe7ae851..12a5ebe8e7a91 100644
--- a/src/gpu/SDL_gpu.c
+++ b/src/gpu/SDL_gpu.c
@@ -394,7 +394,6 @@ static SDL_GPUDriver SDL_GPUSelectBackend(
 SDL_GPUDevice *SDL_CreateGPUDevice(
     SDL_GPUShaderFormat formatFlags,
     SDL_bool debugMode,
-    SDL_bool preferLowPower,
     const char *name)
 {
     SDL_GPUDevice *result;
@@ -418,7 +417,6 @@ SDL_GPUDevice *SDL_CreateGPUDevice(
         SDL_SetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL, SDL_TRUE);
     }
     SDL_SetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL, debugMode);
-    SDL_SetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL, preferLowPower);
     SDL_SetStringProperty(props, SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING, name);
     result = SDL_CreateGPUDeviceWithProperties(props);
     SDL_DestroyProperties(props);
@@ -462,7 +460,7 @@ SDL_GPUDevice *SDL_CreateGPUDeviceWithProperties(SDL_PropertiesID props)
     }
 
     debugMode = SDL_GetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL, SDL_TRUE);
-    preferLowPower = SDL_GetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL, SDL_TRUE);
+    preferLowPower = SDL_GetBooleanProperty(props, SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL, SDL_FALSE);
 
     gpudriver = SDL_GetHint(SDL_HINT_GPU_DRIVER);
     if (gpudriver == NULL) {
diff --git a/test/testgpu_spinning_cube.c b/test/testgpu_spinning_cube.c
index f5c462d208c7a..eb4b5491e442e 100644
--- a/test/testgpu_spinning_cube.c
+++ b/test/testgpu_spinning_cube.c
@@ -469,8 +469,7 @@ init_render_state(int msaa)
 
     gpu_device = SDL_CreateGPUDevice(
         TESTGPU_SUPPORTED_FORMATS,
-        1,
-        0,
+        SDL_TRUE,
         NULL
     );
     CHECK_CREATE(gpu_device, "GPU device");