summaryrefslogtreecommitdiffstats
path: root/validation.c
diff options
context:
space:
mode:
Diffstat (limited to 'validation.c')
-rw-r--r--validation.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/validation.c b/validation.c
index c9d2f9f..cfe258a 100644
--- a/validation.c
+++ b/validation.c
@@ -1,12 +1,15 @@
+#ifndef WITH_VALIDATION
+#define WITH_VALIDATION
+#endif
+
+#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <vulkan/vulkan.h>
-
#include "eprintf.h"
#include "nelem.h"
-#define WITH_VALIDATION
#include "validation.h"
static const char *vlayers[] = {
@@ -43,7 +46,7 @@ static bool havelayers(void)
instlrp = emalloc(ninstlrp * sizeof *instlrp);
vkEnumerateInstanceLayerProperties(&ninstlrp, instlrp);
- for (int vl = 0; vl < NELEM(vlayers); vl++) {
+ for (size_t vl = 0; vl < NELEM(vlayers); vl++) {
for (uint32_t il = 0; il < ninstlrp; il++)
if (strcmp(vlayers[vl], instlrp[il].layerName) == 0)
goto next;
@@ -95,6 +98,8 @@ void validation_destroycb(VkInstance inst, void *_cb)
PFN_vkDestroyDebugReportCallbackEXT func;
VkDebugReportCallbackEXT *cb = _cb;
+ assert(cb != NULL);
+
func = (PFN_vkDestroyDebugReportCallbackEXT)
vkGetInstanceProcAddr(inst, "vkDestroyDebugReportCallbackEXT");
if (func == NULL)