63 #ifdef VK_USE_PLATFORM_XCB_KHR 67 #ifdef VK_USE_PLATFORM_WAYLAND_KHR 71 #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT 211 #define VK_DEBUG(vk, ...) \ 214 fprintf(stderr, "%s - ", __func__); \ 215 fprintf(stderr, __VA_ARGS__); \ 216 fprintf(stderr, "\n"); \ 220 #define VK_ERROR(vk, ...) \ 222 fprintf(stderr, "%s - ", __func__); \ 223 fprintf(stderr, __VA_ARGS__); \ 224 fprintf(stderr, "\n"); \ 284 VkMemoryPropertyFlags memory_props,
285 uint32_t *out_type_id);
323 const void *pNext_for_allocate,
325 VkDeviceSize *out_size);
366 VkImageSubresourceRange subresource_range,
367 VkImageView *out_view);
380 VkCommandBuffer cmd_buffer,
382 VkAccessFlags src_access_mask,
383 VkAccessFlags dst_access_mask,
384 VkImageLayout old_layout,
385 VkImageLayout new_layout,
386 VkImageSubresourceRange subresource_range);
PFN_vkAllocateMemory vkAllocateMemory
Definition: vk_helpers.h:102
VkResult vk_create_image_simple(struct vk_bundle *vk, uint32_t width, uint32_t height, VkFormat format, VkDeviceMemory *out_mem, VkImage *out_image)
Definition: vk_helpers.c:209
PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR
Definition: vk_helpers.h:64
PFN_vkDestroyShaderModule vkDestroyShaderModule
Definition: vk_helpers.h:124
PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass
Definition: vk_helpers.h:131
PFN_vkDestroyFramebuffer vkDestroyFramebuffer
Definition: vk_helpers.h:148
PFN_vkQueueSubmit vkQueueSubmit
Definition: vk_helpers.h:163
PFN_vkCmdEndRenderPass vkCmdEndRenderPass
Definition: vk_helpers.h:135
PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements
Definition: vk_helpers.h:114
Include all of the Vulkan headers in one place.
PFN_vkCmdDrawIndexed vkCmdDrawIndexed
Definition: vk_helpers.h:141
PFN_vkDestroyPipeline vkDestroyPipeline
Definition: vk_helpers.h:155
PFN_vkGetPhysicalDeviceDisplayPropertiesKHR vkGetPhysicalDeviceDisplayPropertiesKHR
Definition: vk_helpers.h:77
const char * vk_color_format_string(VkFormat code)
Definition: vk_helpers.c:64
const char * vk_result_string(VkResult code)
Definition: vk_helpers.c:31
PFN_vkReleaseDisplayEXT vkReleaseDisplayEXT
Definition: vk_helpers.h:81
PFN_vkCreateRenderPass vkCreateRenderPass
Definition: vk_helpers.h:145
PFN_vkDestroyInstance vkDestroyInstance
Definition: vk_helpers.h:56
VkResult vk_init_cmd_buffer(struct vk_bundle *vk, VkCommandBuffer *out_cmd_buffer)
Definition: vk_helpers.c:418
PFN_vkCreateDevice vkCreateDevice
Definition: vk_helpers.h:57
PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties
Definition: vk_helpers.h:89
bool vk_get_memory_type(struct vk_bundle *vk, uint32_t type_bits, VkMemoryPropertyFlags memory_props, uint32_t *out_type_id)
Definition: vk_helpers.c:126
VkResult vk_get_instance_functions(struct vk_bundle *vk)
Definition: vk_helpers.c:667
PFN_vkGetDisplayModePropertiesKHR vkGetDisplayModePropertiesKHR
Definition: vk_helpers.h:79
uint64_t VkImage
Definition: xrt_compositor.h:452
VkDevice device
Definition: vk_helpers.h:40
uint32_t queue_family_index
Definition: vk_helpers.h:41
PFN_vkCreateImageView vkCreateImageView
Definition: vk_helpers.h:117
PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool
Definition: vk_helpers.h:152
PFN_vkDestroyImage vkDestroyImage
Definition: vk_helpers.h:116
PFN_vkMapMemory vkMapMemory
Definition: vk_helpers.h:104
PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers
Definition: vk_helpers.h:128
PFN_vkEndCommandBuffer vkEndCommandBuffer
Definition: vk_helpers.h:142
PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR
Definition: vk_helpers.h:176
PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR vkGetPhysicalDeviceDisplayPlanePropertiesKHR
Definition: vk_helpers.h:78
const char * vk_power_state_string(VkDisplayPowerStateEXT code)
Definition: vk_helpers.c:99
PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer
Definition: vk_helpers.h:139
PFN_vkUnmapMemory vkUnmapMemory
Definition: vk_helpers.h:105
VkResult vk_create_view(struct vk_bundle *vk, VkImage image, VkFormat format, VkImageSubresourceRange subresource_range, VkImageView *out_view)
Definition: vk_helpers.c:375
PFN_vkCreateSampler vkCreateSampler
Definition: vk_helpers.h:120
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR
Definition: vk_helpers.h:91
PFN_vkGetDeviceQueue vkGetDeviceQueue
Definition: vk_helpers.h:162
PFN_vkBindImageMemory vkBindImageMemory
Definition: vk_helpers.h:115
PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets
Definition: vk_helpers.h:136
PFN_vkDestroyBuffer vkDestroyBuffer
Definition: vk_helpers.h:109
PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier
Definition: vk_helpers.h:130
VkResult vk_init_cmd_pool(struct vk_bundle *vk)
Definition: vk_helpers.c:547
xrt_swapchain_usage_bits
Usage of the swapchain images.
Definition: xrt_compositor.h:48
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR
Definition: vk_helpers.h:93
PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR
Definition: vk_helpers.h:94
PFN_vkFreeCommandBuffers vkFreeCommandBuffers
Definition: vk_helpers.h:143
PFN_vkDestroyPipelineCache vkDestroyPipelineCache
Definition: vk_helpers.h:150
PFN_vkCmdDraw vkCmdDraw
Definition: vk_helpers.h:140
PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines
Definition: vk_helpers.h:154
PFN_vkCreateFence vkCreateFence
Definition: vk_helpers.h:169
PFN_vkDestroySampler vkDestroySampler
Definition: vk_helpers.h:121
PFN_vkQueueWaitIdle vkQueueWaitIdle
Definition: vk_helpers.h:164
PFN_vkCreateDescriptorPool vkCreateDescriptorPool
Definition: vk_helpers.h:151
PFN_vkDestroyCommandPool vkDestroyCommandPool
Definition: vk_helpers.h:127
PFN_vkQueuePresentKHR vkQueuePresentKHR
Definition: vk_helpers.h:178
PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements
Definition: vk_helpers.h:111
PFN_vkGetDisplayPlaneCapabilitiesKHR vkGetDisplayPlaneCapabilitiesKHR
Definition: vk_helpers.h:73
PFN_vkCreateShaderModule vkCreateShaderModule
Definition: vk_helpers.h:123
PFN_vkCreateImage vkCreateImage
Definition: vk_helpers.h:113
VkPhysicalDevice physical_device
Definition: vk_helpers.h:39
PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout
Definition: vk_helpers.h:160
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr
Definition: vk_helpers.h:52
VkInstance instance
Definition: vk_helpers.h:38
PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets
Definition: vk_helpers.h:159
VkResult vk_create_image_from_fd(struct vk_bundle *vk, enum xrt_swapchain_usage_bits swapchain_usage, int64_t format, uint32_t width, uint32_t height, uint32_t array_size, uint32_t mip_count, struct xrt_image_fd *image_fd, VkImage *out_image, VkDeviceMemory *out_mem)
Definition: vk_helpers.c:262
PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR
Definition: vk_helpers.h:174
PFN_vkCreateDisplayPlaneSurfaceKHR vkCreateDisplayPlaneSurfaceKHR
Definition: vk_helpers.h:72
Header defining a XRT graphics provider.
VkCommandPool cmd_pool
Definition: vk_helpers.h:48
PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout
Definition: vk_helpers.h:157
void vk_destroy_validation_callback(struct vk_bundle *vk)
Definition: vk_helpers.c:630
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR
Definition: vk_helpers.h:92
uint64_t VkDeviceMemory
Definition: xrt_compositor.h:453
PFN_vkCreateInstance vkCreateInstance
Definition: vk_helpers.h:53
VkDebugReportCallbackEXT debug_report_cb
Definition: vk_helpers.h:44
PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets
Definition: vk_helpers.h:153
PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr
Definition: vk_helpers.h:98
PFN_vkResetFences vkResetFences
Definition: vk_helpers.h:172
PFN_vkFreeMemory vkFreeMemory
Definition: vk_helpers.h:103
PFN_vkCmdSetScissor vkCmdSetScissor
Definition: vk_helpers.h:132
VkPhysicalDeviceMemoryProperties device_memory_props
Definition: vk_helpers.h:46
PFN_vkDestroyDevice vkDestroyDevice
Definition: vk_helpers.h:99
PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices
Definition: vk_helpers.h:60
PFN_vkCreateSemaphore vkCreateSemaphore
Definition: vk_helpers.h:166
const char * vk_color_space_string(VkColorSpaceKHR code)
Definition: vk_helpers.c:110
PFN_vkCreatePipelineLayout vkCreatePipelineLayout
Definition: vk_helpers.h:156
PFN_vkCreateCommandPool vkCreateCommandPool
Definition: vk_helpers.h:126
PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR
Definition: vk_helpers.h:106
const char * vk_present_mode_string(VkPresentModeKHR code)
Definition: vk_helpers.c:85
PFN_vkBeginCommandBuffer vkBeginCommandBuffer
Definition: vk_helpers.h:129
uint32_t queue_index
Definition: vk_helpers.h:42
PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR
Definition: vk_helpers.h:61
PFN_vkDestroyImageView vkDestroyImageView
Definition: vk_helpers.h:118
PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR
Definition: vk_helpers.h:68
VkResult vk_alloc_and_bind_image_memory(struct vk_bundle *vk, VkImage image, size_t max_size, const void *pNext_for_allocate, VkDeviceMemory *out_mem, VkDeviceSize *out_size)
Allocate memory for an image and bind it to that image.
Definition: vk_helpers.c:150
PFN_vkDestroyFence vkDestroyFence
Definition: vk_helpers.h:171
PFN_vkAcquireXlibDisplayEXT vkAcquireXlibDisplayEXT
Definition: vk_helpers.h:80
PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR
Definition: vk_helpers.h:177
VkResult vk_get_loader_functions(struct vk_bundle *vk, PFN_vkGetInstanceProcAddr g)
Definition: vk_helpers.c:654
PFN_vkCmdClearColorImage vkCmdClearColorImage
Definition: vk_helpers.h:134
PFN_vkDestroyRenderPass vkDestroyRenderPass
Definition: vk_helpers.h:146
PFN_vkCreateBuffer vkCreateBuffer
Definition: vk_helpers.h:108
PFN_vkCmdBindPipeline vkCmdBindPipeline
Definition: vk_helpers.h:137
PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT
Definition: vk_helpers.h:59
VkResult vk_create_device(struct vk_bundle *vk, int forced_index)
Definition: vk_helpers.c:914
PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT
Definition: vk_helpers.h:58
PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties
Definition: vk_helpers.h:88
VkResult vk_init_from_given(struct vk_bundle *vk, PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr, VkInstance instance, VkPhysicalDevice physical_device, VkDevice device, uint32_t queue_family_index, uint32_t queue_index)
Initialize a bundle with objects given to us by client code, used by client_vk_compositor in Composit...
Definition: vk_helpers.c:981
PFN_vkCreateFramebuffer vkCreateFramebuffer
Definition: vk_helpers.h:147
bool print
Definition: vk_helpers.h:36
VkResult vk_set_image_layout(struct vk_bundle *vk, VkCommandBuffer cmd_buffer, VkImage image, VkAccessFlags src_access_mask, VkAccessFlags dst_access_mask, VkImageLayout old_layout, VkImageLayout new_layout, VkImageSubresourceRange subresource_range)
Definition: vk_helpers.c:462
PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout
Definition: vk_helpers.h:158
PFN_vkDestroySemaphore vkDestroySemaphore
Definition: vk_helpers.h:167
PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties
Definition: vk_helpers.h:87
A bundle of Vulkan functions and objects, used by both Compositor and Compositor client code...
Definition: vk_helpers.h:34
PFN_vkWaitForFences vkWaitForFences
Definition: vk_helpers.h:170
PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers
Definition: vk_helpers.h:138
PFN_vkCmdSetViewport vkCmdSetViewport
Definition: vk_helpers.h:133
PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR
Definition: vk_helpers.h:175
PFN_vkGetRandROutputDisplayEXT vkGetRandROutputDisplayEXT
Definition: vk_helpers.h:82
PFN_vkDeviceWaitIdle vkDeviceWaitIdle
Definition: vk_helpers.h:100
VkResult vk_create_sampler(struct vk_bundle *vk, VkSampler *out_sampler)
Definition: vk_helpers.c:346
void vk_init_validation_callback(struct vk_bundle *vk)
Definition: vk_helpers.c:607
A single image of a fd based swapchain.
Definition: xrt_compositor.h:503
PFN_vkCreatePipelineCache vkCreatePipelineCache
Definition: vk_helpers.h:149
VkResult vk_submit_cmd_buffer(struct vk_bundle *vk, VkCommandBuffer cmd_buffer)
Definition: vk_helpers.c:491
PFN_vkBindBufferMemory vkBindBufferMemory
Definition: vk_helpers.h:110