// This is a helper macro to define the value of flag bit enum values.
#define VK_BIT(bit) (1 << (bit))
-// ------------------------------------------------------------------------------------------------
-// Enumerations
-
typedef enum {
VK_SUCCESS = 0,
VK_UNSUPPORTED = 1,
VK_RESULT_MAX_ENUM = 0x7FFFFFFF
} VkResult;
-// Structure type enumerant
typedef enum {
VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 1,
VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_DEVICE1_DISPLAY_BIT = VK_BIT(6),
} VkPhysicalDeviceCompatibilityFlagBits;
-// ------------------------------------------------------------------------------------------------
-// Vulkan structures
-
typedef struct {
VkStructureType sType;
const void* pNext;
uint32_t layers;
} VkFramebufferCreateInfo;
-// Union allowing specification of floating point or raw color data. Actual value selected is based on image being cleared.
typedef union VkClearColorValue_
{
float floatColor[4];
VkImageSubresourceRange subresourceRange;
} VkImageMemoryBarrier;
-// can be added to VkDeviceCreateInfo via pNext
typedef struct {
VkStructureType sType;
const void* pNext;
VkRenderPassBegin renderPassContinue;
} VkCmdBufferGraphicsBeginInfo;
-// ------------------------------------------------------------------------------------------------
-// API functions
typedef VkResult (VKAPI *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, VkInstance* pInstance);
typedef VkResult (VKAPI *PFN_vkDestroyInstance)(VkInstance instance);
typedef VkResult (VKAPI *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
VkPhysicalDevice physicalDevice,
const char* pName);
-// Device functions
-
VkResult VKAPI vkCreateDevice(
VkPhysicalDevice physicalDevice,
const VkDeviceCreateInfo* pCreateInfo,
size_t* pDataSize,
void* pData);
-// Image view functions
-
VkResult VKAPI vkCreateImageView(
VkDevice device,
const VkImageViewCreateInfo* pCreateInfo,