LWJGL / lwjgl3-demos

Demo suite for LWJGL 3
BSD 3-Clause "New" or "Revised" License
351 stars 89 forks source link

Vulkan ClearScreenDemo has a bug WRT maxImageCount #58

Open janitza-mage opened 1 month ago

janitza-mage commented 1 month ago

In createSwapchain(), The line

int imageCount = min(max(pSurfaceCapabilities.minImageCount(), 2), pSurfaceCapabilities.maxImageCount());

does not handle the fact that maxImageCount() may return 0 to indicate "no limit", setting imageCount to 0 and creating a zero-image swapchain. The application subsequently crashes with "Index 0 out of bounds for length 0".