summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/window.cpp2
-rw-r--r--src/window.hpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 47b328c..d8328b5 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -415,6 +415,8 @@ void CreateSwapchain() {
VkSurfaceCapabilitiesKHR surfaceCapabilities;
vkGetPhysicalDeviceSurfaceCapabilitiesKHR(vkPhysicalDevice, vkSurfaceKHR, &surfaceCapabilities);
+ assert(MAX_FRAMES_IN_FLIGHT >= surfaceCapabilities.minImageCount);
+ assert(surfaceCapabilities.maxImageCount == 0 || MAX_FRAMES_IN_FLIGHT <= surfaceCapabilities.maxImageCount);
if (selectedSurfaceIndex == -1u) {
unsigned int surfaceFormatCounts;
diff --git a/src/window.hpp b/src/window.hpp
index a2cb264..ed13e0f 100644
--- a/src/window.hpp
+++ b/src/window.hpp
@@ -16,7 +16,8 @@
#include <GLFW/glfw3.h>
#include <vulkan/vulkan.h>
-const unsigned int MAX_FRAMES_IN_FLIGHT = 2;
+// TODO replace me with something more elegant
+const unsigned int MAX_FRAMES_IN_FLIGHT = 3;
extern GLFWwindow *window;
extern VkInstance vkInstance;