Browse Source

GPU: Return early in SDL_WaitForGPUFences if num_fences is 0

zanadoman 1 month ago
parent
commit
d7b1255484
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/gpu/SDL_gpu.c

+ 5 - 1
src/gpu/SDL_gpu.c

@@ -3468,7 +3468,11 @@ bool SDL_WaitForGPUFences(
 {
     CHECK_DEVICE_MAGIC(device, false);
 
-    CHECK_PARAM(fences == NULL && num_fences > 0) {
+    if (!num_fences) {
+        return true;
+    }
+
+    CHECK_PARAM(fences == NULL) {
         SDL_InvalidParamError("fences");
         return false;
     }