summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2023-09-29 00:50:05 +0000
committerOmar Rizwan <omar@omar.website>2023-09-29 00:51:13 +0000
commit96c865eecb7e5aa0481cd7cf2fdfdb7c42801830 (patch)
treef4e271aaffd354fbff8d43bb4ff631c20f38f041
parentlanguage: Backport fully lexical fn (diff)
downloadfolk-96c865eecb7e5aa0481cd7cf2fdfdb7c42801830.tar.gz
folk-96c865eecb7e5aa0481cd7cf2fdfdb7c42801830.zip
Gpu: Die if we exceed max images
-rw-r--r--pi/Gpu.tcl4
1 files changed, 4 insertions, 0 deletions
diff --git a/pi/Gpu.tcl b/pi/Gpu.tcl
index a4da2d53..8c7a51bc 100644
--- a/pi/Gpu.tcl
+++ b/pi/Gpu.tcl
@@ -1351,6 +1351,10 @@ namespace eval ::Gpu {
static int nextImageId = 0;
static bool didInitializeDescriptors = false;
int imageId = nextImageId++;
+ if (imageId >= $GPU_MAX_IMAGES) {
+ fprintf(stderr, "Gpu: Exceeded GPU_MAX_IMAGES\n");
+ exit(22);
+ }
{
VkDescriptorImageInfo imageInfo = {0};
imageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;