Go to the documentation of this file.
19 #if defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__)
21 int main(
int argc,
char *argv[])
29 #define VK_NO_PROTOTYPES
34 #include "../src/video/khronos/vulkan/vulkan.h"
39 #define UINT64_MAX 18446744073709551615
42 #define VULKAN_FUNCTIONS() \
43 VULKAN_DEVICE_FUNCTION(vkAcquireNextImageKHR) \
44 VULKAN_DEVICE_FUNCTION(vkAllocateCommandBuffers) \
45 VULKAN_DEVICE_FUNCTION(vkBeginCommandBuffer) \
46 VULKAN_DEVICE_FUNCTION(vkCmdClearColorImage) \
47 VULKAN_DEVICE_FUNCTION(vkCmdPipelineBarrier) \
48 VULKAN_DEVICE_FUNCTION(vkCreateCommandPool) \
49 VULKAN_DEVICE_FUNCTION(vkCreateFence) \
50 VULKAN_DEVICE_FUNCTION(vkCreateImageView) \
51 VULKAN_DEVICE_FUNCTION(vkCreateSemaphore) \
52 VULKAN_DEVICE_FUNCTION(vkCreateSwapchainKHR) \
53 VULKAN_DEVICE_FUNCTION(vkDestroyCommandPool) \
54 VULKAN_DEVICE_FUNCTION(vkDestroyDevice) \
55 VULKAN_DEVICE_FUNCTION(vkDestroyFence) \
56 VULKAN_DEVICE_FUNCTION(vkDestroyImageView) \
57 VULKAN_DEVICE_FUNCTION(vkDestroySemaphore) \
58 VULKAN_DEVICE_FUNCTION(vkDestroySwapchainKHR) \
59 VULKAN_DEVICE_FUNCTION(vkDeviceWaitIdle) \
60 VULKAN_DEVICE_FUNCTION(vkEndCommandBuffer) \
61 VULKAN_DEVICE_FUNCTION(vkFreeCommandBuffers) \
62 VULKAN_DEVICE_FUNCTION(vkGetDeviceQueue) \
63 VULKAN_DEVICE_FUNCTION(vkGetFenceStatus) \
64 VULKAN_DEVICE_FUNCTION(vkGetSwapchainImagesKHR) \
65 VULKAN_DEVICE_FUNCTION(vkQueuePresentKHR) \
66 VULKAN_DEVICE_FUNCTION(vkQueueSubmit) \
67 VULKAN_DEVICE_FUNCTION(vkResetCommandBuffer) \
68 VULKAN_DEVICE_FUNCTION(vkResetFences) \
69 VULKAN_DEVICE_FUNCTION(vkWaitForFences) \
70 VULKAN_GLOBAL_FUNCTION(vkCreateInstance) \
71 VULKAN_GLOBAL_FUNCTION(vkEnumerateInstanceExtensionProperties) \
72 VULKAN_GLOBAL_FUNCTION(vkEnumerateInstanceLayerProperties) \
73 VULKAN_INSTANCE_FUNCTION(vkCreateDevice) \
74 VULKAN_INSTANCE_FUNCTION(vkDestroyInstance) \
75 VULKAN_INSTANCE_FUNCTION(vkDestroySurfaceKHR) \
76 VULKAN_INSTANCE_FUNCTION(vkEnumerateDeviceExtensionProperties) \
77 VULKAN_INSTANCE_FUNCTION(vkEnumeratePhysicalDevices) \
78 VULKAN_INSTANCE_FUNCTION(vkGetDeviceProcAddr) \
79 VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceFeatures) \
80 VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceProperties) \
81 VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceQueueFamilyProperties) \
82 VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceSurfaceCapabilitiesKHR) \
83 VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceSurfaceFormatsKHR) \
84 VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceSurfacePresentModesKHR) \
85 VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceSurfaceSupportKHR)
87 #define VULKAN_DEVICE_FUNCTION(name) static PFN_##name name = NULL;
88 #define VULKAN_GLOBAL_FUNCTION(name) static PFN_##name name = NULL;
89 #define VULKAN_INSTANCE_FUNCTION(name) static PFN_##name name = NULL;
91 #undef VULKAN_DEVICE_FUNCTION
92 #undef VULKAN_GLOBAL_FUNCTION
93 #undef VULKAN_INSTANCE_FUNCTION
99 #if VK_HEADER_VERSION < 22
105 #if VK_HEADER_VERSION < 38
118 return "VK_NOT_READY";
122 return "VK_EVENT_SET";
124 return "VK_EVENT_RESET";
126 return "VK_INCOMPLETE";
128 return "VK_ERROR_OUT_OF_HOST_MEMORY";
130 return "VK_ERROR_OUT_OF_DEVICE_MEMORY";
132 return "VK_ERROR_INITIALIZATION_FAILED";
134 return "VK_ERROR_DEVICE_LOST";
136 return "VK_ERROR_MEMORY_MAP_FAILED";
138 return "VK_ERROR_LAYER_NOT_PRESENT";
140 return "VK_ERROR_EXTENSION_NOT_PRESENT";
142 return "VK_ERROR_FEATURE_NOT_PRESENT";
144 return "VK_ERROR_INCOMPATIBLE_DRIVER";
146 return "VK_ERROR_TOO_MANY_OBJECTS";
148 return "VK_ERROR_FORMAT_NOT_SUPPORTED";
150 return "VK_ERROR_FRAGMENTED_POOL";
152 return "VK_ERROR_SURFACE_LOST_KHR";
154 return "VK_ERROR_NATIVE_WINDOW_IN_USE_KHR";
156 return "VK_SUBOPTIMAL_KHR";
158 return "VK_ERROR_OUT_OF_DATE_KHR";
160 return "VK_ERROR_INCOMPATIBLE_DISPLAY_KHR";
162 return "VK_ERROR_VALIDATION_FAILED_EXT";
164 return "VK_ERROR_OUT_OF_POOL_MEMORY_KHR";
166 return "VK_ERROR_INVALID_SHADER_NV";
172 return "VK_ERROR_<Unknown>";
173 return "VK_<Unknown>";
224 "SDL_Vulkan_GetVkGetInstanceProcAddr(): %s\n",
229 #define VULKAN_DEVICE_FUNCTION(name)
230 #define VULKAN_GLOBAL_FUNCTION(name) \
231 name = (PFN_##name)vkGetInstanceProcAddr(VK_NULL_HANDLE, #name); \
234 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, \
235 "vkGetInstanceProcAddr(VK_NULL_HANDLE, \"" #name "\") failed\n"); \
238 #define VULKAN_INSTANCE_FUNCTION(name)
240 #undef VULKAN_DEVICE_FUNCTION
241 #undef VULKAN_GLOBAL_FUNCTION
242 #undef VULKAN_INSTANCE_FUNCTION
249 const char **extensions =
NULL;
250 unsigned extensionCount = 0;
261 "SDL_Vulkan_GetInstanceExtensions(): %s\n",
265 extensions =
SDL_malloc(
sizeof(
const char *) * extensionCount);
275 "SDL_Vulkan_GetInstanceExtensions(): %s\n",
287 "vkCreateInstance(): %s\n",
295 #define VULKAN_DEVICE_FUNCTION(name)
296 #define VULKAN_GLOBAL_FUNCTION(name)
297 #define VULKAN_INSTANCE_FUNCTION(name) \
298 name = (PFN_##name)vkGetInstanceProcAddr(vulkanContext.instance, #name); \
301 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, \
302 "vkGetInstanceProcAddr(instance, \"" #name "\") failed\n"); \
306 #undef VULKAN_DEVICE_FUNCTION
307 #undef VULKAN_GLOBAL_FUNCTION
308 #undef VULKAN_INSTANCE_FUNCTION
327 VkPhysicalDevice *physicalDevices;
329 uint32_t queueFamiliesPropertiesAllocatedSize = 0;
331 uint32_t deviceExtensionsAllocatedSize = 0;
339 "vkEnumeratePhysicalDevices(): %s\n",
343 if(physicalDeviceCount == 0)
346 "vkEnumeratePhysicalDevices(): no physical devices\n");
349 physicalDevices =
SDL_malloc(
sizeof(VkPhysicalDevice) * physicalDeviceCount);
361 "vkEnumeratePhysicalDevices(): %s\n",
366 for(physicalDeviceIndex = 0; physicalDeviceIndex < physicalDeviceCount;
367 physicalDeviceIndex++)
376 VkPhysicalDevice physicalDevice = physicalDevices[physicalDeviceIndex];
382 if(queueFamiliesCount == 0)
384 if(queueFamiliesPropertiesAllocatedSize < queueFamiliesCount)
387 queueFamiliesPropertiesAllocatedSize = queueFamiliesCount;
388 queueFamiliesProperties =
390 if(!queueFamiliesProperties)
399 physicalDevice, &queueFamiliesCount, queueFamiliesProperties);
402 for(queueFamilyIndex = 0; queueFamilyIndex < queueFamiliesCount;
407 if(queueFamiliesProperties[queueFamilyIndex].queueCount == 0)
419 "vkGetPhysicalDeviceSurfaceSupportKHR(): %s\n",
442 "vkEnumerateDeviceExtensionProperties(): %s\n",
446 if(deviceExtensionCount == 0)
448 if(deviceExtensionsAllocatedSize < deviceExtensionCount)
451 deviceExtensionsAllocatedSize = deviceExtensionCount;
454 if(!deviceExtensions)
463 physicalDevice,
NULL, &deviceExtensionCount, deviceExtensions);
470 "vkEnumerateDeviceExtensionProperties(): %s\n",
474 for(
i = 0;
i < deviceExtensionCount;
i++)
482 if(!hasSwapchainExtension)
500 static const float queuePriority[] = {1.0f};
502 static const char *
const deviceExtensionNames[] = {
531 #define VULKAN_DEVICE_FUNCTION(name) \
532 name = (PFN_##name)vkGetDeviceProcAddr(vulkanContext.device, #name); \
535 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, \
536 "vkGetDeviceProcAddr(device, \"" #name "\") failed\n"); \
539 #define VULKAN_GLOBAL_FUNCTION(name)
540 #define VULKAN_INSTANCE_FUNCTION(name)
542 #undef VULKAN_DEVICE_FUNCTION
543 #undef VULKAN_GLOBAL_FUNCTION
544 #undef VULKAN_INSTANCE_FUNCTION
547 #undef VULKAN_FUNCTIONS
575 "vkCreateSemaphore(): %s\n",
594 "vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): %s\n",
603 "Vulkan surface doesn't support VK_IMAGE_USAGE_TRANSFER_DST_BIT\n");
618 "vkGetPhysicalDeviceSurfaceFormatsKHR(): %s\n",
643 "vkGetPhysicalDeviceSurfaceFormatsKHR(): %s\n",
661 "vkGetSwapchainImagesKHR(): %s\n",
681 "vkGetSwapchainImagesKHR(): %s\n",
750 "vkCreateSwapchainKHR(): %s\n",
800 "vkCreateCommandPool(): %s\n",
824 "vkAllocateCommandBuffers(): %s\n",
858 "vkCreateFence(): %s\n",
923 "vkResetCommandBuffer(): %s\n",
933 "vkBeginCommandBuffer(): %s\n",
960 "vkEndCommandBuffer(): %s\n",
971 if(doDestroySwapchain)
1052 "vkAcquireNextImageKHR(): %s\n",
1072 clearColor.
float32[0] = (float)(0.5 + 0.5 *
SDL_sin(currentTime));
1073 clearColor.
float32[1] = (float)(0.5 + 0.5 *
SDL_sin(currentTime + M_PI * 2 / 3));
1074 clearColor.
float32[2] = (float)(0.5 + 0.5 *
SDL_sin(currentTime + M_PI * 4 / 3));
1107 "vkQueuePresentKHR(): %s\n",
1155 SDL_Log(
"Window Size : %d,%d\n", dw, dh);
1157 SDL_Log(
"Draw Size : %d,%d\n", dw, dh);
1183 SDL_Log(
"%2.2f frames per second\n", ((
double)
frames * 1000) / (now - then));
VKAPI_ATTR VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences)
static void recordPipelineImageBarrier(VkCommandBuffer commandBuffer, VkAccessFlags sourceAccessMask, VkAccessFlags destAccessMask, VkImageLayout sourceLayout, VkImageLayout destLayout, VkImage image)
static void destroySwapchain(void)
VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device)
VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags)
static void createSemaphores(void)
static SDLTest_CommonState * state
#define SDL_BITSPERPIXEL(X)
@ VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
VkCommandPool commandPool
VkImageUsageFlags imageUsage
VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator)
#define SDL_Vulkan_GetDrawableSize
@ VK_IMAGE_USAGE_TRANSFER_DST_BIT
VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue *pColor, uint32_t rangeCount, const VkImageSubresourceRange *pRanges)
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance instance, const char *pName)
uint32_t queueCreateInfoCount
uint32_t enabledExtensionCount
VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator)
#define VK_KHR_SWAPCHAIN_EXTENSION_NAME
@ VK_ERROR_MEMORY_MAP_FAILED
VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices)
@ VK_FENCE_CREATE_SIGNALED_BIT
uint32_t queueFamilyIndex
int main(int argc, char *argv[])
uint32_t presentQueueFamilyIndex
VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator)
@ VK_ERROR_INCOMPATIBLE_DISPLAY_KHR
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32 *pSupported)
@ VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT
VkPhysicalDevice physicalDevice
VkAccessFlags dstAccessMask
const VkPipelineStageFlags * pWaitDstStageMask
const uint32_t * pImageIndices
Uint64 SDL_GetPerformanceFrequency(void)
Get the count per second of the high resolution counter.
@ VK_STRUCTURE_TYPE_SUBMIT_INFO
VkSurfaceFormatKHR * surfaceFormats
VkCommandPoolCreateFlags flags
@ VK_STRUCTURE_TYPE_PRESENT_INFO_KHR
@ VK_ACCESS_TRANSFER_WRITE_BIT
static void loadDeviceFunctions(void)
VkSurfaceCapabilitiesKHR surfaceCapabilities
#define SDL_Vulkan_GetInstanceExtensions
@ VK_PRESENT_MODE_FIFO_KHR
const VkCommandBuffer * pCommandBuffers
@ VK_ACCESS_MEMORY_READ_BIT
VKAPI_ATTR VkResult VKAPI_CALL vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, uint64_t timeout)
@ VK_COMMAND_BUFFER_LEVEL_PRIMARY
@ VK_ERROR_FRAGMENTED_POOL
VkImageUsageFlags supportedUsageFlags
uint32_t imageArrayLayers
uint32_t srcQueueFamilyIndex
VkImageAspectFlags aspectMask
VkImage * swapchainImages
uint32_t graphicsQueueFamilyIndex
uint32_t surfaceFormatsAllocatedCount
@ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
VkSemaphore imageAvailableSemaphore
VkAccessFlags srcAccessMask
static SDL_bool createNewSwapchainAndSwapchainSpecificStuff(void)
@ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
@ VK_ERROR_OUT_OF_POOL_MEMORY_KHR
@ VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore)
GLfloat GLfloat GLfloat GLfloat h
static void destroyCommandPool(void)
@ VK_ERROR_LAYER_NOT_PRESENT
VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties)
static PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr
@ VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
uint32_t signalSemaphoreCount
static void loadInstanceFunctions(void)
SDLTest_CommonState * SDLTest_CommonCreateState(char **argv, Uint32 flags)
Parse command line parameters and create common state.
The structure that defines a display mode.
@ VK_PIPELINE_STAGE_TRANSFER_BIT
static void destroyCommandBuffers(void)
void SDLTest_CommonQuit(SDLTest_CommonState *state)
Close test window.
#define SDL_GetWindowSize
uint32_t waitSemaphoreCount
#define SDL_Vulkan_CreateSurface
@ VK_ERROR_INITIALIZATION_FAILED
VKAPI_ATTR VkResult VKAPI_CALL vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo)
VkColorSpaceKHR imageColorSpace
@ VK_SHARING_MODE_EXCLUSIVE
const VkPhysicalDeviceFeatures * pEnabledFeatures
SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv)
Easy argument handling when test app doesn't need any custom args.
VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance)
VkPhysicalDeviceFeatures physicalDeviceFeatures
VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers)
@ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
static void createCommandBuffers(void)
static void createInstance(void)
@ SDL_LOG_CATEGORY_APPLICATION
@ VK_ERROR_OUT_OF_HOST_MEMORY
VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages)
VkCommandPool commandPool
#define SDL_Vulkan_LoadLibrary
#define VK_QUEUE_FAMILY_IGNORED
VkFlags VkPipelineStageFlags
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer)
static const char * getVulkanResultString(VkResult result)
@ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
@ VK_ERROR_FEATURE_NOT_PRESENT
#define SDL_GetPerformanceCounter
uint32_t queueFamilyIndex
@ VK_ERROR_TOO_MANY_OBJECTS
static VulkanContext vulkanContext
@ VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
#define VK_VERSION_MAJOR(version)
VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue)
uint32_t commandBufferCount
static void createDevice(void)
@ VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR
@ VK_ERROR_INVALID_SHADER_NV
static void createCommandPool(void)
static void getSurfaceFormats(void)
@ VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
#define SDL_OutOfMemory()
@ VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR
VKAPI_ATTR void VKAPI_CALL vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator)
#define VULKAN_FUNCTIONS()
VKAPI_ATTR void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator)
VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator)
static void destroySwapchainAndSwapchainSpecificStuff(SDL_bool doDestroySwapchain)
#define SDL_arraysize(array)
static void createFences(void)
static void destroyFences(void)
SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
Open test window.
VkSharingMode imageSharingMode
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats)
const char *const * ppEnabledExtensionNames
static void getSwapchainImages(void)
@ VK_IMAGE_LAYOUT_UNDEFINED
#define SDL_LogSetPriority
VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers)
@ VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
@ VK_ERROR_INCOMPATIBLE_DRIVER
@ VK_ERROR_NATIVE_WINDOW_IN_USE_KHR
const VkSemaphore * pSignalSemaphores
VkPhysicalDeviceProperties physicalDeviceProperties
@ VK_ERROR_SURFACE_LOST_KHR
uint32_t surfaceFormatsCount
@ VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT
VkPresentModeKHR presentMode
static void getQueues(void)
const char *const * ppEnabledExtensionNames
VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures)
static void initVulkan(void)
VkCommandBuffer * commandBuffers
const VkDeviceQueueCreateInfo * pQueueCreateInfos
VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence)
#define VK_API_VERSION_1_0
VkSurfaceTransformFlagBitsKHR preTransform
@ VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCommandPool *pCommandPool)
VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties)
@ VK_COMMAND_POOL_CREATE_TRANSIENT_BIT
VkCommandBufferUsageFlags flags
static void shutdownVulkan(void)
VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo)
#define SDL_Vulkan_GetVkGetInstanceProcAddr
VkSemaphore renderingFinishedSemaphore
#define SDL_GetCurrentDisplayMode
VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers)
uint32_t swapchainDesiredImageCount
static SDL_bool createSwapchain(void)
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex)
#define SDL_Vulkan_UnloadLibrary
void SDLTest_CommonEvent(SDLTest_CommonState *state, SDL_Event *event, int *done)
Common event handler for test windows.
@ VK_ERROR_FORMAT_NOT_SUPPORTED
@ VK_ERROR_OUT_OF_DEVICE_MEMORY
VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFence *pFence)
uint32_t waitSemaphoreCount
static void findPhysicalDevice(void)
VKAPI_ATTR void VKAPI_CALL vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator)
VkCommandBufferLevel level
@ VK_ERROR_VALIDATION_FAILED_EXT
VkImageSubresourceRange subresourceRange
uint32_t enabledExtensionCount
@ VK_ERROR_OUT_OF_DATE_KHR
@ VK_FORMAT_R8G8B8A8_UNORM
VkSurfaceTransformFlagBitsKHR currentTransform
VkCompositeAlphaFlagBitsKHR compositeAlpha
static void createSurface(void)
@ VK_ERROR_EXTENSION_NOT_PRESENT
uint32_t swapchainImageCount
static void rerecordCommandBuffer(uint32_t frameIndex, const VkClearColorValue *clearColor)
const VkSemaphore * pWaitSemaphores
@ VK_STRUCTURE_TYPE_APPLICATION_INFO
@ VK_IMAGE_ASPECT_COLOR_BIT
VkSurfaceFormatKHR surfaceFormat
VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain)
const VkSemaphore * pWaitSemaphores
VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice)
uint32_t commandBufferCount
const VkApplicationInfo * pApplicationInfo
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
VkSwapchainKHR oldSwapchain
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities)
static void getSurfaceCaps(void)
@ VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
uint32_t dstQueueFamilyIndex
VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties)
@ VK_COLORSPACE_SRGB_NONLINEAR_KHR
static void loadGlobalFunctions(void)
static SDL_bool render(void)
const VkSwapchainKHR * pSwapchains
GLubyte GLubyte GLubyte GLubyte w
const float * pQueuePriorities
static void createSemaphore(VkSemaphore *semaphore)