ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
VkPhysicalDevice gpu,
- size_t maxLayerCount,
size_t maxStringSize,
- size_t* pOutLayerCount,
+ size_t* pLayerCount,
char* const* pOutLayers,
void* pReserved)
{
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);
VkResult VKAPI vkEnumerateLayers(
VkPhysicalDevice physicalDevice,
- size_t maxLayerCount,
size_t maxStringSize,
size_t* pLayerCount,
char* const* pOutLayers,
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
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;
}
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;
}
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;
}
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;
}
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;
}
}
-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;
}
}
/********************************* 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;
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) {
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;
}
}
-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;
}
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;
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;
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;
}
}
- *pOutLayerCount = count;
+ *pLayerCount = count;
return VK_SUCCESS;
}
' 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'
' %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'
' %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'
' 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'
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")]),