Browse Source

GPU: Return early in SDL_WaitForGPUFences if num_fences is 0

(cherry picked from commit d7b12554840d602517223ab7d7bdeaa10ea4ae14)
zanadoman 4 tháng trước cách đây
mục cha
commit
a21c31aea1
1 tập tin đã thay đổi với 5 bổ sung và 1 xóa
  1. 5 1
      src/gpu/SDL_gpu.c

+ 5 - 1
src/gpu/SDL_gpu.c

@@ -3449,7 +3449,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;
     }