Browse Source

vulkan: Fix assert if only one surface format is supported

rdb 2 years ago
parent
commit
45b5d406ec
1 changed files with 3 additions and 2 deletions
  1. 3 2
      panda/src/vulkandisplay/vulkanGraphicsWindow.cxx

+ 3 - 2
panda/src/vulkandisplay/vulkanGraphicsWindow.cxx

@@ -537,9 +537,10 @@ open_window() {
       _surface_format.format = VK_FORMAT_B8G8R8A8_UNORM;
       _surface_format.format = VK_FORMAT_B8G8R8A8_UNORM;
     }
     }
     _surface_format.colorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR;
     _surface_format.colorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR;
-  } else {
+  }
+  else {
     // Find a format that meets the requirements.
     // Find a format that meets the requirements.
-    nassertr(num_formats > 1, false);
+    nassertr(num_formats > 0, false);
     _surface_format = formats[0];
     _surface_format = formats[0];
 
 
     if (_fb_properties.get_srgb_color()) {
     if (_fb_properties.get_srgb_color()) {