39 VkPhysicalDevice physical_device;
41 uint32_t queue_family_index;
44 VkDebugReportCallbackEXT debug_report_cb;
46 VkPhysicalDeviceMemoryProperties device_memory_props;
48 VkCommandPool cmd_pool;
52 PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
53 PFN_vkCreateInstance vkCreateInstance;
56 PFN_vkDestroyInstance vkDestroyInstance;
57 PFN_vkCreateDevice vkCreateDevice;
58 PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT;
59 PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT;
60 PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices;
61 PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR;
63 #ifdef VK_USE_PLATFORM_XCB_KHR 64 PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR;
67 #ifdef VK_USE_PLATFORM_WAYLAND_KHR 68 PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR;
71 #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT 72 PFN_vkCreateDisplayPlaneSurfaceKHR vkCreateDisplayPlaneSurfaceKHR;
73 PFN_vkGetDisplayPlaneCapabilitiesKHR vkGetDisplayPlaneCapabilitiesKHR;
77 PFN_vkGetPhysicalDeviceDisplayPropertiesKHR vkGetPhysicalDeviceDisplayPropertiesKHR;
78 PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR vkGetPhysicalDeviceDisplayPlanePropertiesKHR;
79 PFN_vkGetDisplayModePropertiesKHR vkGetDisplayModePropertiesKHR;
80 PFN_vkAcquireXlibDisplayEXT vkAcquireXlibDisplayEXT;
81 PFN_vkReleaseDisplayEXT vkReleaseDisplayEXT;
82 PFN_vkGetRandROutputDisplayEXT vkGetRandROutputDisplayEXT;
87 PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
88 PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties;
89 PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
91 PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
92 PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR;
93 PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR;
94 PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR;
98 PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
99 PFN_vkDestroyDevice vkDestroyDevice;
100 PFN_vkDeviceWaitIdle vkDeviceWaitIdle;
102 PFN_vkAllocateMemory vkAllocateMemory;
103 PFN_vkFreeMemory vkFreeMemory;
104 PFN_vkMapMemory vkMapMemory;
105 PFN_vkUnmapMemory vkUnmapMemory;
106 PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR;
108 PFN_vkCreateBuffer vkCreateBuffer;
109 PFN_vkDestroyBuffer vkDestroyBuffer;
110 PFN_vkBindBufferMemory vkBindBufferMemory;
111 PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
113 PFN_vkCreateImage vkCreateImage;
114 PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
115 PFN_vkBindImageMemory vkBindImageMemory;
116 PFN_vkDestroyImage vkDestroyImage;
117 PFN_vkCreateImageView vkCreateImageView;
118 PFN_vkDestroyImageView vkDestroyImageView;
120 PFN_vkCreateSampler vkCreateSampler;
121 PFN_vkDestroySampler vkDestroySampler;
123 PFN_vkCreateShaderModule vkCreateShaderModule;
124 PFN_vkDestroyShaderModule vkDestroyShaderModule;
126 PFN_vkCreateCommandPool vkCreateCommandPool;
127 PFN_vkDestroyCommandPool vkDestroyCommandPool;
128 PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers;
129 PFN_vkBeginCommandBuffer vkBeginCommandBuffer;
130 PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier;
131 PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass;
132 PFN_vkCmdSetScissor vkCmdSetScissor;
133 PFN_vkCmdSetViewport vkCmdSetViewport;
134 PFN_vkCmdClearColorImage vkCmdClearColorImage;
135 PFN_vkCmdEndRenderPass vkCmdEndRenderPass;
136 PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets;
137 PFN_vkCmdBindPipeline vkCmdBindPipeline;
138 PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers;
139 PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer;
140 PFN_vkCmdDraw vkCmdDraw;
141 PFN_vkCmdDrawIndexed vkCmdDrawIndexed;
142 PFN_vkEndCommandBuffer vkEndCommandBuffer;
143 PFN_vkFreeCommandBuffers vkFreeCommandBuffers;
145 PFN_vkCreateRenderPass vkCreateRenderPass;
146 PFN_vkDestroyRenderPass vkDestroyRenderPass;
147 PFN_vkCreateFramebuffer vkCreateFramebuffer;
148 PFN_vkDestroyFramebuffer vkDestroyFramebuffer;
149 PFN_vkCreatePipelineCache vkCreatePipelineCache;
150 PFN_vkDestroyPipelineCache vkDestroyPipelineCache;
151 PFN_vkCreateDescriptorPool vkCreateDescriptorPool;
152 PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool;
153 PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets;
154 PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines;
155 PFN_vkDestroyPipeline vkDestroyPipeline;
156 PFN_vkCreatePipelineLayout vkCreatePipelineLayout;
157 PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout;
158 PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout;
159 PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
160 PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout;
162 PFN_vkGetDeviceQueue vkGetDeviceQueue;
163 PFN_vkQueueSubmit vkQueueSubmit;
164 PFN_vkQueueWaitIdle vkQueueWaitIdle;
166 PFN_vkCreateSemaphore vkCreateSemaphore;
167 PFN_vkDestroySemaphore vkDestroySemaphore;
169 PFN_vkCreateFence vkCreateFence;
170 PFN_vkWaitForFences vkWaitForFences;
171 PFN_vkDestroyFence vkDestroyFence;
173 PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR;
174 PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR;
175 PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR;
176 PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR;
177 PFN_vkQueuePresentKHR vkQueuePresentKHR;
189 vk_result_string(VkResult code);
192 vk_color_format_string(VkFormat code);
195 vk_present_mode_string(VkPresentModeKHR code);
198 vk_power_state_string(VkDisplayPowerStateEXT code);
201 vk_color_space_string(VkColorSpaceKHR code);
210 #define VK_DEBUG(vk, ...) \ 213 fprintf(stderr, "%s - ", __func__); \ 214 fprintf(stderr, __VA_ARGS__); \ 215 fprintf(stderr, "\n"); \ 219 #define VK_ERROR(vk, ...) \ 221 fprintf(stderr, "%s - ", __func__); \ 222 fprintf(stderr, __VA_ARGS__); \ 223 fprintf(stderr, "\n"); \ 230 vk_init_validation_callback(
struct vk_bundle *vk);
236 vk_destroy_validation_callback(
struct vk_bundle *vk);
242 vk_get_loader_functions(
struct vk_bundle *vk, PFN_vkGetInstanceProcAddr g);
248 vk_get_instance_functions(
struct vk_bundle *vk);
270 PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr,
272 VkPhysicalDevice physical_device,
274 uint32_t queue_family_index,
275 uint32_t queue_index);
283 VkMemoryPropertyFlags memory_props,
284 uint32_t *out_type_id);
322 const void *pNext_for_allocate,
323 VkDeviceMemory *out_mem,
324 VkDeviceSize *out_size);
330 vk_create_image_from_fd(
struct vk_bundle *vk,
339 VkDeviceMemory *out_mem);
345 vk_create_image_simple(
struct vk_bundle *vk,
349 VkDeviceMemory *out_mem,
356 vk_create_sampler(
struct vk_bundle *vk, VkSampler *out_sampler);
365 VkImageSubresourceRange subresource_range,
366 VkImageView *out_view);
372 vk_init_cmd_buffer(
struct vk_bundle *vk, VkCommandBuffer *out_cmd_buffer);
378 vk_set_image_layout(
struct vk_bundle *vk,
379 VkCommandBuffer cmd_buffer,
381 VkAccessFlags src_access_mask,
382 VkAccessFlags dst_access_mask,
383 VkImageLayout old_layout,
384 VkImageLayout new_layout,
385 VkImageSubresourceRange subresource_range);
391 vk_submit_cmd_buffer(
struct vk_bundle *vk, VkCommandBuffer cmd_buffer);
Include all of the Vulkan headers in one place.
xrt_swapchain_usage_bits
Usage of the swapchain images.
Definition: xrt_compositor.h:48
Header defining a XRT graphics provider.
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
VkResult vk_create_device(struct vk_bundle *vk, int forced_index)
Definition: vk_helpers.c:948
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:1023
A bundle of Vulkan functions and objects, used by both Compositor and Compositor client code...
Definition: vk_helpers.h:34
A single image of a fd based swapchain.
Definition: xrt_compositor.h:450