vkEnumerateLayers: Update to match upstream
The upstream vulkan.h header removed maxLayerCount parameter
from vkEnumerateLayers. This patch implements that change
for the sample driver and layers.
diff --git a/tests/init.cpp b/tests/init.cpp
index d2402a5..0b87ad1 100644
--- a/tests/init.cpp
+++ b/tests/init.cpp
@@ -145,7 +145,7 @@
VkResult err;
vk_testing::PhysicalGpu *gpu;
char *layers[16];
- size_t layer_count;
+ size_t layer_count = 16; /* accept 16 layer names to be returned */
char layer_buf[16][256];
VkInstanceCreateInfo inst_info = {};
inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
@@ -173,7 +173,7 @@
for (int i = 0; i < 16; i++)
layers[i] = &layer_buf[i][0];
- err = vkEnumerateLayers(objs[0], 16, 256, &layer_count, (char * const *) layers, NULL);
+ err = vkEnumerateLayers(objs[0], 256, &layer_count, (char * const *) layers, NULL);
ASSERT_VK_SUCCESS(err);
for (int i = 0; i < layer_count; i++) {
printf("Enumerated layers: %s ", layers[i]);
diff --git a/tests/vktestbinding.cpp b/tests/vktestbinding.cpp
index 4ec41ea..1368bd3 100644
--- a/tests/vktestbinding.cpp
+++ b/tests/vktestbinding.cpp
@@ -147,8 +147,8 @@
layers.push_back(&buf[0] + max_string_size * i);
char * const *out = const_cast<char * const *>(&layers[0]);
- size_t count;
- if (!EXPECT(vkEnumerateLayers(gpu_, max_layer_count, max_string_size, &count, out, NULL) == VK_SUCCESS))
+ size_t count = max_layer_count; /* allow up to 16 layer names to be returned */
+ if (!EXPECT(vkEnumerateLayers(gpu_, max_string_size, &count, out, NULL) == VK_SUCCESS))
count = 0;
layers.resize(count);