#define VK_MAX_PHYSICAL_DEVICE_NAME 256
#define VK_UUID_LENGTH 16
#define VK_MAX_EXTENSION_NAME 256
+#define VK_MAX_DESCRIPTION 256
#define VK_MAX_MEMORY_TYPES 32
#define VK_MAX_MEMORY_HEAPS 16
#define VK_LOD_CLAMP_NONE MAX_FLOAT
VK_TIMEOUT = 3,
VK_EVENT_SET = 4,
VK_EVENT_RESET = 5,
+ VK_INCOMPLETE = 6,
VK_ERROR_UNKNOWN = -1,
VK_ERROR_UNAVAILABLE = -2,
VK_ERROR_INITIALIZATION_FAILED = -3,
VK_ERROR_BUILDING_COMMAND_BUFFER = -30,
VK_ERROR_MEMORY_NOT_BOUND = -31,
VK_ERROR_INCOMPATIBLE_QUEUE = -32,
- VK_RESULT_BEGIN_RANGE = VK_ERROR_INCOMPATIBLE_QUEUE,
- VK_RESULT_END_RANGE = VK_EVENT_RESET,
- VK_RESULT_NUM = (VK_EVENT_RESET - VK_ERROR_INCOMPATIBLE_QUEUE + 1),
+ VK_ERROR_INVALID_LAYER = -33,
+ VK_RESULT_BEGIN_RANGE = VK_ERROR_INVALID_LAYER,
+ VK_RESULT_END_RANGE = VK_INCOMPLETE,
+ VK_RESULT_NUM = (VK_INCOMPLETE - VK_ERROR_INVALID_LAYER + 1),
VK_RESULT_MAX_ENUM = 0x7FFFFFFF
} VkResult;
const void* pNext;
const VkApplicationInfo* pAppInfo;
const VkAllocCallbacks* pAllocCb;
+ uint32_t layerCount;
+ const char*const* ppEnabledLayerNames;
uint32_t extensionCount;
const char*const* ppEnabledExtensionNames;
} VkInstanceCreateInfo;
const void* pNext;
uint32_t queueRecordCount;
const VkDeviceQueueCreateInfo* pRequestedQueues;
+ uint32_t layerCount;
+ const char*const* ppEnabledLayerNames;
uint32_t extensionCount;
const char*const* ppEnabledExtensionNames;
const VkPhysicalDeviceFeatures* pEnabledFeatures;
typedef struct {
char extName[VK_MAX_EXTENSION_NAME];
- uint32_t version;
+ uint32_t specVersion;
} VkExtensionProperties;
+typedef struct {
+ char layerName[VK_MAX_EXTENSION_NAME];
+ uint32_t specVersion;
+ uint32_t implVersion;
+ const char* description[VK_MAX_DESCRIPTION];
+} VkLayerProperties;
+
typedef struct {
VkStructureType sType;
const void* pNext;
VkImageSubresourceRange subresourceRange;
} VkImageMemoryBarrier;
-typedef struct {
- VkStructureType sType;
- const void* pNext;
- uint32_t layerCount;
- const char *const* ppActiveLayerNames;
-} VkLayerCreateInfo;
-
typedef struct {
VkStructureType sType;
const void* pNext;
typedef PFN_vkVoidFunction (VKAPI *PFN_vkGetDeviceProcAddr)(VkDevice device, const char* pName);
typedef VkResult (VKAPI *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice);
typedef VkResult (VKAPI *PFN_vkDestroyDevice)(VkDevice device);
-typedef VkResult (VKAPI *PFN_vkGetGlobalExtensionCount)(uint32_t* pCount);
-typedef VkResult (VKAPI *PFN_vkGetGlobalExtensionProperties)(uint32_t extensionIndex, VkExtensionProperties* pProperties);
-typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceExtensionCount)(VkPhysicalDevice physicalDevice, uint32_t* pCount);
-typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, uint32_t extensionIndex, VkExtensionProperties* pProperties);
-typedef VkResult (VKAPI *PFN_vkEnumerateLayers)(VkPhysicalDevice physicalDevice, size_t maxStringSize, size_t* pLayerCount, char* const* pOutLayers, void* pReserved);
+typedef VkResult (VKAPI *PFN_vkGetGlobalExtensionProperties)(const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties);
+typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties);
+typedef VkResult (VKAPI *PFN_vkGetGlobalLayerProperties)(uint32_t* pCount, VkLayerProperties* pProperties);
+typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties);
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_vkQueueWaitIdle)(VkQueue queue);
VkResult VKAPI vkDestroyDevice(
VkDevice device);
-VkResult VKAPI vkGetGlobalExtensionCount(
- uint32_t* pCount);
-
VkResult VKAPI vkGetGlobalExtensionProperties(
- uint32_t extensionIndex,
+ const char* pLayerName,
+ uint32_t* pCount,
VkExtensionProperties* pProperties);
-VkResult VKAPI vkGetPhysicalDeviceExtensionCount(
- VkPhysicalDevice physicalDevice,
- uint32_t* pCount);
-
VkResult VKAPI vkGetPhysicalDeviceExtensionProperties(
VkPhysicalDevice physicalDevice,
- uint32_t extensionIndex,
+ const char* pLayerName,
+ uint32_t* pCount,
VkExtensionProperties* pProperties);
-VkResult VKAPI vkEnumerateLayers(
+VkResult VKAPI vkGetGlobalLayerProperties(
+ uint32_t* pCount,
+ VkLayerProperties* pProperties);
+
+VkResult VKAPI vkGetPhysicalDeviceLayerProperties(
VkPhysicalDevice physicalDevice,
- size_t maxStringSize,
- size_t* pLayerCount,
- char* const* pOutLayers,
- void* pReserved);
+ uint32_t* pCount,
+ VkLayerProperties* pProperties);
VkResult VKAPI vkGetDeviceQueue(
VkDevice device,
static const VkExtensionProperties global_extensions[] = {
{
.extName = "VK_WSI_LunarG",
- .version = 3
+ .specVersion = 3
}
};
-VkResult anv_GetGlobalExtensionCount(
- uint32_t* pCount)
-{
- *pCount = ARRAY_SIZE(global_extensions);
-
- return VK_SUCCESS;
-}
-
-
VkResult anv_GetGlobalExtensionProperties(
- uint32_t extensionIndex,
+ const char* pLayerName,
+ uint32_t* pCount,
VkExtensionProperties* pProperties)
{
- assert(extensionIndex < ARRAY_SIZE(global_extensions));
-
- *pProperties = global_extensions[extensionIndex];
+ if (pProperties == NULL) {
+ *pCount = ARRAY_SIZE(global_extensions);
+ return VK_SUCCESS;
+ }
- return VK_SUCCESS;
-}
+ assert(*pCount < ARRAY_SIZE(global_extensions));
-VkResult anv_GetPhysicalDeviceExtensionCount(
- VkPhysicalDevice physicalDevice,
- uint32_t* pCount)
-{
- /* None supported at this time */
- *pCount = 0;
+ *pCount = ARRAY_SIZE(global_extensions);
+ memcpy(pProperties, global_extensions, sizeof(global_extensions));
return VK_SUCCESS;
}
VkResult anv_GetPhysicalDeviceExtensionProperties(
VkPhysicalDevice physicalDevice,
- uint32_t extensionIndex,
+ const char* pLayerName,
+ uint32_t* pCount,
VkExtensionProperties* pProperties)
{
+ if (pProperties == NULL) {
+ *pCount = 0;
+ return VK_SUCCESS;
+ }
+
/* None supported at this time */
return vk_error(VK_ERROR_INVALID_EXTENSION);
}
-VkResult anv_EnumerateLayers(
+VkResult anv_GetGlobalLayerProperties(
+ uint32_t* pCount,
+ VkLayerProperties* pProperties)
+{
+ if (pProperties == NULL) {
+ *pCount = 0;
+ return VK_SUCCESS;
+ }
+
+ /* None supported at this time */
+ return vk_error(VK_ERROR_INVALID_LAYER);
+}
+
+VkResult anv_GetPhysicalDeviceLayerProperties(
VkPhysicalDevice physicalDevice,
- size_t maxStringSize,
- size_t* pLayerCount,
- char* const* pOutLayers,
- void* pReserved)
+ uint32_t* pCount,
+ VkLayerProperties* pProperties)
{
- *pLayerCount = 0;
+ if (pProperties == NULL) {
+ *pCount = 0;
+ return VK_SUCCESS;
+ }
- return VK_SUCCESS;
+ /* None supported at this time */
+ return vk_error(VK_ERROR_INVALID_LAYER);
}
VkResult anv_GetDeviceQueue(