vkEnumerateLayers: Update to match upstream
authorCourtney Goeltzenleuchter <courtney@LunarG.com>
Mon, 20 Apr 2015 17:04:54 +0000 (11:04 -0600)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Wed, 22 Apr 2015 16:48:24 +0000 (10:48 -0600)
The upstream vulkan.h header removed maxLayerCount parameter
from vkEnumerateLayers. This patch implements that change
for the sample driver and layers.

13 files changed:
icd/nulldrv/nulldrv.c
include/vulkan.h
layers/basic.cpp
layers/draw_state.cpp
layers/glave_snapshot.c
layers/glsl_compiler.c [new file with mode: 0644]
layers/mem_tracker.cpp
layers/multi.cpp
layers/param_checker.cpp
layers/shader_checker.cpp
loader/loader.c
vk-layer-generate.py
vulkan.py

index 8edacd559f33c5fe7da2e4af03cd1657b28c5aa5..e9f0b76cbbb44f5792407dbb9dad955cb0559407 100644 (file)
@@ -1812,9 +1812,8 @@ ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
 
 ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
     VkPhysicalDevice                            gpu,
-    size_t                                      maxLayerCount,
     size_t                                      maxStringSize,
-    size_t*                                     pOutLayerCount,
+    size_t*                                     pLayerCount,
     char* const*                                pOutLayers,
     void*                                       pReserved)
 {
index b46fdc46bb1f68c91bd37265ee96318b821e80eb..28f15096e9c5744c526b2216532418b80d11b9ec 100644 (file)
@@ -2133,7 +2133,7 @@ typedef VkResult (VKAPI *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, co
 typedef VkResult (VKAPI *PFN_vkDestroyDevice)(VkDevice device);
 typedef VkResult (VKAPI *PFN_vkGetGlobalExtensionInfo)(VkExtensionInfoType infoType, uint32_t extensionIndex, size_t* pDataSize, void* pData);
 typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceExtensionInfo)(VkPhysicalDevice gpu, VkExtensionInfoType infoType, uint32_t extensionIndex, size_t* pDataSize, void* pData);
-typedef VkResult (VKAPI *PFN_vkEnumerateLayers)(VkPhysicalDevice physicalDevice, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved);
+typedef VkResult (VKAPI *PFN_vkEnumerateLayers)(VkPhysicalDevice physicalDevice, size_t maxStringSize, size_t* pLayerCount, char* const* pOutLayers, void* pReserved);
 typedef VkResult (VKAPI *PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, VkQueue* pQueue);
 typedef VkResult (VKAPI *PFN_vkQueueSubmit)(VkQueue queue, uint32_t cmdBufferCount, const VkCmdBuffer* pCmdBuffers, VkFence fence);
 typedef VkResult (VKAPI *PFN_vkQueueAddMemReferences)(VkQueue queue, uint32_t count, const VkDeviceMemory* pMems);
@@ -2296,7 +2296,6 @@ VkResult VKAPI vkGetPhysicalDeviceExtensionInfo(
 
 VkResult VKAPI vkEnumerateLayers(
     VkPhysicalDevice                            physicalDevice,
-    size_t                                      maxLayerCount,
     size_t                                      maxStringSize,
     size_t*                                     pLayerCount,
     char* const*                                pOutLayers,
index b7ad6b7c79ccd6e640df313920ba990208300c73..64964f340b44204af2ff516de3f25a85b23df837 100644 (file)
@@ -135,18 +135,18 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetFormatInfo(VkDevice device, VkFormat format,
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
+VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxStringSize, size_t* pLayerCount, char* const* pOutLayers, void* pReserved)
 {
     if (gpu != NULL)
     {
         VkLayerDispatchTable* pTable = initLayerTable((const VkBaseLayerObject *) gpu);
 
         printf("At start of wrapped vkEnumerateLayers() call w/ gpu: %p\n", gpu);
-        VkResult result = pTable->EnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved);
+        VkResult result = pTable->EnumerateLayers(gpu, maxStringSize, pLayerCount, pOutLayers, pReserved);
         return result;
     } else
     {
-        if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL || pReserved == NULL)
+        if (pLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL || pReserved == NULL)
             return VK_ERROR_INVALID_POINTER;
 
         // Example of a layer that is only compatible with Intel's GPUs
@@ -158,11 +158,11 @@ VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t ma
         fpGetGpuInfo((VkPhysicalDevice) gpuw->nextObject, VK_PHYSICAL_DEVICE_INFO_TYPE_PROPERTIES, &dataSize, &gpuProps);
         if (gpuProps.vendorId == 0x8086)
         {
-            *pOutLayerCount = 1;
+            *pLayerCount = 1;
             strncpy((char *) pOutLayers[0], "Basic", maxStringSize);
         } else
         {
-            *pOutLayerCount = 0;
+            *pLayerCount = 0;
         }
         return VK_SUCCESS;
     }
index aae865b824b1a6998435c466d28c55e196e95149..aad274510a1827c08c7c3b66c1ed4f5666444cbd 100644 (file)
@@ -1519,19 +1519,19 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
     return VK_SUCCESS;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
+VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxStringSize, size_t* pLayerCount, char* const* pOutLayers, void* pReserved)
 {
     if (gpu != NULL)
     {
         pCurObj = (VkBaseLayerObject *) gpu;
         loader_platform_thread_once(&g_initOnce, initDrawState);
-        VkResult result = nextTable.EnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved);
+        VkResult result = nextTable.EnumerateLayers(gpu, maxStringSize, pLayerCount, pOutLayers, pReserved);
         return result;
     } else {
-        if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)
+        if (pLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)
             return VK_ERROR_INVALID_POINTER;
         // This layer compatible with all GPUs
-        *pOutLayerCount = 1;
+        *pLayerCount = 1;
         strncpy((char *) pOutLayers[0], "DrawState", maxStringSize);
         return VK_SUCCESS;
     }
index 81a2b58891196c047cb47180fa745d84c580e4c7..e7afe57a63dc42e46e883798ab6805a81265506e 100644 (file)
@@ -542,22 +542,22 @@ VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice(VkDevice device)
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
+VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxStringSize, size_t* pLayerCount, char* const* pOutLayers, void* pReserved)
 {
     if (gpu != NULL) {
         VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu;
         loader_platform_thread_lock_mutex(&objLock);
-    ll_increment_use_count((void*)gpu, VK_OBJECT_TYPE_PHYSICAL_GPU);
-    loader_platform_thread_unlock_mutex(&objLock);
+        ll_increment_use_count((void*)gpu, VK_OBJECT_TYPE_PHYSICAL_GPU);
+        loader_platform_thread_unlock_mutex(&objLock);
         pCurObj = gpuw;
         loader_platform_thread_once(&tabOnce, initGlaveSnapshot);
-        VkResult result = nextTable.EnumerateLayers((VkPhysicalGpu)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved);
-            return result;
+        VkResult result = nextTable.EnumerateLayers((VkPhysicalGpu)gpuw->nextObject, maxStringSize, pLayerCount, pOutLayers, pReserved);
+        return result;
     } else {
-        if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)
+        if (pLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)
             return VK_ERROR_INVALID_POINTER;
         // This layer compatible with all GPUs
-        *pOutLayerCount = 1;
+        *pLayerCount = 1;
         strncpy((char *) pOutLayers[0], LAYER_NAME_STR, maxStringSize);
         return VK_SUCCESS;
     }
diff --git a/layers/glsl_compiler.c b/layers/glsl_compiler.c
new file mode 100644 (file)
index 0000000..e69de29
index 6f5eb39f60feb55e371f90be257d980f15dc6bd6..45bea6f597655de2fd478bfca52e8e078ec0eeff 100644 (file)
@@ -951,22 +951,22 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
     return VK_SUCCESS;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxLayerCount,
-    size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
+VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu,
+    size_t maxStringSize, size_t* pLayerCount, char* const* pOutLayers, void* pReserved)
 {
         if (gpu != NULL)
     {
         pCurObj = (VkBaseLayerObject *)  gpu;
         loader_platform_thread_once(&g_initOnce, initMemTracker);
-        VkResult result = nextTable.EnumerateLayers(gpu, maxLayerCount,
-            maxStringSize, pOutLayerCount, pOutLayers, pReserved);
+        VkResult result = nextTable.EnumerateLayers(gpu,
+            maxStringSize, pLayerCount, pOutLayers, pReserved);
         return result;
     } else
     {
-        if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)
+        if (pLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)
             return VK_ERROR_INVALID_POINTER;
         // This layer compatible with all GPUs
-        *pOutLayerCount = 1;
+        *pLayerCount = 1;
         strncpy((char *) pOutLayers[0], "MemTracker", maxStringSize);
         return VK_SUCCESS;
     }
index e70b6383fc97e053167ca3f1d307aa284e4b3317..1640dc6fb2e6ad35407d433a7d38c76aba5bb853 100644 (file)
@@ -97,16 +97,16 @@ VK_LAYER_EXPORT VkResult VKAPI multi1StorePipeline(VkDevice device, VkPipeline p
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI multi1EnumerateLayers(VkPhysicalDevice gpu, size_t maxLayerCount, size_t maxStringSize,
-                                                         size_t* pOutLayerCount, char* const* pOutLayers,
+VK_LAYER_EXPORT VkResult VKAPI multi1EnumerateLayers(VkPhysicalDevice gpu, size_t maxStringSize,
+                                                         size_t* pLayerCount, char* const* pOutLayers,
                                                          void* pReserved)
 {
     if (gpu == NULL)
-        return vkEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved);
+        return vkEnumerateLayers(gpu, maxStringSize, pLayerCount, pOutLayers, pReserved);
 
     VkLayerDispatchTable* pTable = tableMap1[gpu];
     printf("At start of multi1 layer vkEnumerateLayers()\n");
-    VkResult result = pTable->EnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved);
+    VkResult result = pTable->EnumerateLayers(gpu, maxStringSize, pLayerCount, pOutLayers, pReserved);
     printf("Completed multi1 layer vkEnumerateLayers()\n");
     return result;
 }
@@ -194,17 +194,17 @@ VK_LAYER_EXPORT VkResult VKAPI multi2BeginCommandBuffer(VkCmdBuffer cmdBuffer, c
 
 }
 
-VK_LAYER_EXPORT VkResult VKAPI multi2EnumerateLayers(VkPhysicalDevice gpu, size_t maxLayerCount, size_t maxStringSize,
-                                                         size_t* pOutLayerCount, char* const* pOutLayers,
+VK_LAYER_EXPORT VkResult VKAPI multi2EnumerateLayers(VkPhysicalDevice gpu, size_t maxStringSize,
+                                                         size_t* pLayerCount, char* const* pOutLayers,
                                                          void* pReserved)
 {
     if (gpu == NULL)
-        return vkEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved);
+        return vkEnumerateLayers(gpu, maxStringSize, pLayerCount, pOutLayers, pReserved);
 
     VkLayerDispatchTable* pTable = tableMap2[gpu];
 
     printf("At start of multi2 layer vkEnumerateLayers()\n");
-    VkResult result = pTable->EnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved);
+    VkResult result = pTable->EnumerateLayers(gpu, maxStringSize, pLayerCount, pOutLayers, pReserved);
     printf("Completed multi2 layer vkEnumerateLayers()\n");
     return result;
 }
@@ -234,16 +234,16 @@ VK_LAYER_EXPORT void * VKAPI multi2GetProcAddr(VkPhysicalDevice gpu, const char*
 }
 
 /********************************* Common functions ********************************/
-VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxLayerCount, size_t maxStringSize,
-                                                      size_t* pOutLayerCount, char* const* pOutLayers,
-                                                      void* pReserved)
+VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxStringSize,
+                                                 size_t* pLayerCount, char* const* pOutLayers,
+                                                 void* pReserved)
 {
-    if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL || pOutLayers[1] == NULL || pReserved == NULL)
+    if (pLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL || pOutLayers[1] == NULL || pReserved == NULL)
         return VK_ERROR_INVALID_POINTER;
 
-    if (maxLayerCount < 2)
+    if (*pLayerCount < 2)
         return VK_ERROR_INITIALIZATION_FAILED;
-    *pOutLayerCount = 2;
+    *pLayerCount = 2;
     strncpy((char *) pOutLayers[0], "multi1", maxStringSize);
     strncpy((char *) pOutLayers[1], "multi2", maxStringSize);
     return VK_SUCCESS;
index 74d8582ab143e73b3b45fae0fa9f556d65214f3c..3171baf2bd479b1af6767000dbe1ffe1539a9815 100644 (file)
@@ -308,7 +308,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceExtensionInfo(
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
+VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxStringSize, size_t* pLayerCount, char* const* pOutLayers, void* pReserved)
 {
     char str[1024];
     if (gpu != NULL) {
@@ -316,16 +316,16 @@ VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t ma
         layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, nullptr, 0, 0, "PARAMCHECK", str);
         pCurObj = (VkBaseLayerObject *) gpu;
         loader_platform_thread_once(&tabOnce, initParamChecker);
-        VkResult result = nextTable.EnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved);
+        VkResult result = nextTable.EnumerateLayers(gpu, maxStringSize, pLayerCount, pOutLayers, pReserved);
         sprintf(str, "Completed layered EnumerateLayers\n");
         layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, nullptr, 0, 0, "PARAMCHECK", str);
         fflush(stdout);
         return result;
     } else {
-        if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)
+        if (pLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)
             return VK_ERROR_INVALID_POINTER;
         // This layer compatible with all GPUs
-        *pOutLayerCount = 1;
+        *pLayerCount = 1;
         strncpy(pOutLayers[0], "ParamChecker", maxStringSize);
         return VK_SUCCESS;
     }
index cc6bb3e1d39ddefe8bfeec9783922f58c4c20501..28e0fddc276d1df74b022c38ac6bdb235dc7a769 100644 (file)
@@ -161,14 +161,14 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice(VkPhysicalDevice gpu, const VkDevi
 }
 
 
-VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
+VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice physicalDevice, size_t maxStringSize, size_t* pLayerCount, char* const* pOutLayers, void* pReserved)
 {
-    if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL || pOutLayers[1] == NULL || pReserved == NULL)
+    if (pLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL || pOutLayers[1] == NULL || pReserved == NULL)
         return VK_ERROR_INVALID_POINTER;
 
-    if (maxLayerCount < 1)
+    if (*pLayerCount < 1)
         return VK_ERROR_INITIALIZATION_FAILED;
-    *pOutLayerCount = 1;
+    *pLayerCount = 1;
     strncpy((char *) pOutLayers[0], "ShaderChecker", maxStringSize);
     return VK_SUCCESS;
 }
index de296fa9b84f9a03fc9ec770c24b77cf2012a919..3325a109a974a9a8c2212ac3306254ace36ed864 100644 (file)
@@ -1368,8 +1368,9 @@ LOADER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
     return VK_SUCCESS;
 }
 
-LOADER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved)
+LOADER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxStringSize, size_t* pLayerCount, char* const* pOutLayers, void* pReserved)
 {
+    size_t maxLayerCount;
     uint32_t gpu_index;
     size_t count = 0;
     char *lib_name;
@@ -1379,9 +1380,11 @@ LOADER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxL
     char layer_buf[16][256];
     char * layers[16];
 
-    if (pOutLayerCount == NULL || pOutLayers == NULL)
+    if (pLayerCount == NULL || pOutLayers == NULL)
         return VK_ERROR_INVALID_POINTER;
 
+    maxLayerCount = *pLayerCount;
+
     if (!icd)
         return VK_ERROR_UNAVAILABLE;
 
@@ -1417,11 +1420,11 @@ LOADER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxL
             count++;
             free(cpyStr);
         } else {
-            size_t cnt;
+            size_t cnt = 16; /* only allow 16 layers, for now */
             uint32_t n;
             VkResult res;
             n = (uint32_t) ((maxStringSize < 256) ? maxStringSize : 256);
-            res = fpEnumerateLayers((VkPhysicalDevice) NULL, 16, n, &cnt, layers, (char *) icd->gpus + gpu_index);
+            res = fpEnumerateLayers((VkPhysicalDevice) NULL, n, &cnt, layers, (char *) icd->gpus + gpu_index);
             loader_platform_close_library(handle);
             if (res != VK_SUCCESS)
                 continue;
@@ -1436,7 +1439,7 @@ LOADER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalDevice gpu, size_t maxL
         }
     }
 
-    *pOutLayerCount = count;
+    *pLayerCount = count;
 
     return VK_SUCCESS;
 }
index fe76533a347c26be4977ee599c2cbdef1b850c60..e97243b1d3c1859291aea9722596ae6875d5e63d 100755 (executable)
@@ -492,10 +492,10 @@ class GenericLayerSubcommand(Subcommand):
                      '        fflush(stdout);\n'
                      '    %s'
                      '    } else {\n'
-                     '        if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)\n'
+                     '        if (pLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)\n'
                      '            return VK_ERROR_INVALID_POINTER;\n'
                      '        // This layer compatible with all GPUs\n'
-                     '        *pOutLayerCount = 1;\n'
+                     '        *pLayerCount = 1;\n'
                      '        strncpy((char *) pOutLayers[0], "%s", maxStringSize);\n'
                      '        return VK_SUCCESS;\n'
                      '    }\n'
@@ -753,10 +753,10 @@ class APIDumpSubcommand(Subcommand):
                      '        %s    %s    %s\n'
                      '    %s'
                      '    } else {\n'
-                     '        if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)\n'
+                     '        if (pLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)\n'
                      '            return VK_ERROR_INVALID_POINTER;\n'
                      '        // This layer compatible with all GPUs\n'
-                     '        *pOutLayerCount = 1;\n'
+                     '        *pLayerCount = 1;\n'
                      '        strncpy((char *) pOutLayers[0], "%s", maxStringSize);\n'
                      '        return VK_SUCCESS;\n'
                      '    }\n'
@@ -1209,10 +1209,10 @@ class ObjectTrackerSubcommand(Subcommand):
                      '    %s%s'
                      '    %s'
                      '    } else {\n'
-                     '        if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)\n'
+                     '        if (pLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)\n'
                      '            return VK_ERROR_INVALID_POINTER;\n'
                      '        // This layer compatible with all GPUs\n'
-                     '        *pOutLayerCount = 1;\n'
+                     '        *pLayerCount = 1;\n'
                      '        strncpy((char *) pOutLayers[0], "%s", maxStringSize);\n'
                      '        return VK_SUCCESS;\n'
                      '    }\n'
@@ -1349,10 +1349,10 @@ class ThreadingSubcommand(Subcommand):
                      '        fflush(stdout);\n'
                      '    %s'
                      '    } else {\n'
-                     '        if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)\n'
+                     '        if (pLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL)\n'
                      '            return VK_ERROR_INVALID_POINTER;\n'
                      '        // This layer compatible with all GPUs\n'
-                     '        *pOutLayerCount = 1;\n'
+                     '        *pLayerCount = 1;\n'
                      '        strncpy((char *) pOutLayers[0], "%s", maxStringSize);\n'
                      '        return VK_SUCCESS;\n'
                      '    }\n'
index d9a077560ef72939221a89904333c3cf42adc6ca..e77a662f2a7b0888a8da428699edead82738e460 100755 (executable)
--- a/vulkan.py
+++ b/vulkan.py
@@ -262,9 +262,8 @@ core = Extension(
 
         Proto("VkResult", "EnumerateLayers",
             [Param("VkPhysicalDevice", "gpu"),
-             Param("size_t", "maxLayerCount"),
              Param("size_t", "maxStringSize"),
-             Param("size_t*", "pOutLayerCount"),
+             Param("size_t*", "pLayerCount"),
              Param("char* const*", "pOutLayers"),
              Param("void*", "pReserved")]),