56 VkPhysicalDevice physical_device;
57 int physical_device_index;
59 uint32_t queue_family_index;
62#if defined(VK_KHR_video_encode_queue)
63 uint32_t encode_queue_family_index;
64 uint32_t encode_queue_index;
72#if defined(XRT_GRAPHICS_BUFFER_HANDLE_IS_WIN32_HANDLE)
73 bool color_image_import_opaque_win32;
74 bool color_image_export_opaque_win32;
75 bool depth_image_import_opaque_win32;
76 bool depth_image_export_opaque_win32;
78 bool color_image_import_d3d11;
79 bool color_image_export_d3d11;
80 bool depth_image_import_d3d11;
81 bool depth_image_export_d3d11;
83#elif defined(XRT_GRAPHICS_BUFFER_HANDLE_IS_FD)
84 bool color_image_import_opaque_fd;
85 bool color_image_export_opaque_fd;
86 bool depth_image_import_opaque_fd;
87 bool depth_image_export_opaque_fd;
89#elif defined(XRT_GRAPHICS_BUFFER_HANDLE_IS_AHARDWAREBUFFER)
90 bool color_image_import_opaque_fd;
91 bool color_image_export_opaque_fd;
92 bool depth_image_import_opaque_fd;
93 bool depth_image_export_opaque_fd;
95 bool color_image_import_ahardwarebuffer;
96 bool color_image_export_ahardwarebuffer;
97 bool depth_image_import_ahardwarebuffer;
98 bool depth_image_export_ahardwarebuffer;
101#if defined(XRT_GRAPHICS_SYNC_HANDLE_IS_FD)
103 bool fence_opaque_fd;
105 bool binary_semaphore_sync_fd;
106 bool binary_semaphore_opaque_fd;
108 bool timeline_semaphore_sync_fd;
109 bool timeline_semaphore_opaque_fd;
110#elif defined(XRT_GRAPHICS_SYNC_HANDLE_IS_WIN32_HANDLE)
111 bool fence_win32_handle;
113 bool binary_semaphore_d3d12_fence;
114 bool binary_semaphore_win32_handle;
116 bool timeline_semaphore_d3d12_fence;
117 bool timeline_semaphore_win32_handle;
119#error "Need port for fence sync handles checkers"
124 bool has_KHR_external_memory_capabilities;
125 bool has_EXT_display_surface_counter;
126 bool has_EXT_swapchain_colorspace;
127 bool has_EXT_debug_utils;
131 bool has_KHR_8bit_storage;
132 bool has_KHR_external_fence_fd;
133 bool has_KHR_external_memory;
134 bool has_KHR_external_semaphore_fd;
135 bool has_KHR_format_feature_flags2;
136 bool has_KHR_global_priority;
137 bool has_KHR_image_format_list;
138 bool has_KHR_maintenance1;
139 bool has_KHR_maintenance2;
140 bool has_KHR_maintenance3;
141 bool has_KHR_maintenance4;
142 bool has_KHR_synchronization2;
143 bool has_KHR_timeline_semaphore;
144 bool has_EXT_calibrated_timestamps;
145 bool has_EXT_display_control;
146 bool has_EXT_external_memory_dma_buf;
147 bool has_EXT_external_memory_host;
148 bool has_EXT_global_priority;
149 bool has_EXT_image_drm_format_modifier;
150 bool has_EXT_robustness2;
151 bool has_KHR_present_wait;
152 bool has_ANDROID_external_format_resolve;
153 bool has_GOOGLE_display_timing;
187 VkDebugReportCallbackEXT debug_report_cb;
189 VkPhysicalDeviceMemoryProperties device_memory_props;
192 PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
193 PFN_vkCreateInstance vkCreateInstance;
194 PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties;
197 PFN_vkDestroyInstance vkDestroyInstance;
198 PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
199 PFN_vkCreateDevice vkCreateDevice;
200 PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR;
202 PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT;
203 PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT;
205 PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices;
206 PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
207 PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2;
208 PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2;
209 PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
210 PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties;
211 PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
212 PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR;
213 PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR;
214 PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR;
215 PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties;
216 PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2;
217 PFN_vkGetPhysicalDeviceImageFormatProperties2KHR vkGetPhysicalDeviceImageFormatProperties2;
218 PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR vkGetPhysicalDeviceExternalBufferPropertiesKHR;
219 PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR vkGetPhysicalDeviceExternalFencePropertiesKHR;
220 PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR vkGetPhysicalDeviceExternalSemaphorePropertiesKHR;
221 PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties;
222 PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties;
224#if defined(VK_KHR_present_wait)
225 PFN_vkWaitForPresentKHR vkWaitForPresentKHR;
229#if defined(VK_EXT_calibrated_timestamps)
230 PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT vkGetPhysicalDeviceCalibrateableTimeDomainsEXT;
234#if defined(VK_USE_PLATFORM_DISPLAY_KHR)
235 PFN_vkCreateDisplayPlaneSurfaceKHR vkCreateDisplayPlaneSurfaceKHR;
236 PFN_vkGetDisplayPlaneCapabilitiesKHR vkGetDisplayPlaneCapabilitiesKHR;
237 PFN_vkGetPhysicalDeviceDisplayPropertiesKHR vkGetPhysicalDeviceDisplayPropertiesKHR;
238 PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR vkGetPhysicalDeviceDisplayPlanePropertiesKHR;
239 PFN_vkGetDisplayModePropertiesKHR vkGetDisplayModePropertiesKHR;
240 PFN_vkReleaseDisplayEXT vkReleaseDisplayEXT;
244#if defined(VK_USE_PLATFORM_XCB_KHR)
245 PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR;
249#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
250 PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR;
254#if defined(VK_USE_PLATFORM_WAYLAND_KHR) && defined(VK_EXT_acquire_drm_display)
255 PFN_vkAcquireDrmDisplayEXT vkAcquireDrmDisplayEXT;
256 PFN_vkGetDrmDisplayEXT vkGetDrmDisplayEXT;
260#if defined(VK_USE_PLATFORM_XLIB_XRANDR_EXT)
261 PFN_vkGetRandROutputDisplayEXT vkGetRandROutputDisplayEXT;
262 PFN_vkAcquireXlibDisplayEXT vkAcquireXlibDisplayEXT;
266#if defined(VK_USE_PLATFORM_ANDROID_KHR)
267 PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR;
271#if defined(VK_USE_PLATFORM_WIN32_KHR)
272 PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR;
276#if defined(VK_EXT_display_surface_counter)
277 PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabilities2EXT;
281#if defined(VK_EXT_debug_utils)
282 PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT;
283 PFN_vkSubmitDebugUtilsMessageEXT vkSubmitDebugUtilsMessageEXT;
284 PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT;
290 PFN_vkDestroyDevice vkDestroyDevice;
291 PFN_vkDeviceWaitIdle vkDeviceWaitIdle;
292 PFN_vkAllocateMemory vkAllocateMemory;
293 PFN_vkFreeMemory vkFreeMemory;
294 PFN_vkMapMemory vkMapMemory;
295 PFN_vkUnmapMemory vkUnmapMemory;
297 PFN_vkCreateBuffer vkCreateBuffer;
298 PFN_vkDestroyBuffer vkDestroyBuffer;
299 PFN_vkBindBufferMemory vkBindBufferMemory;
301 PFN_vkCreateImage vkCreateImage;
302 PFN_vkDestroyImage vkDestroyImage;
303 PFN_vkBindImageMemory vkBindImageMemory;
305 PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
306 PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges;
307 PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
308 PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2;
309 PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout;
311 PFN_vkCreateImageView vkCreateImageView;
312 PFN_vkDestroyImageView vkDestroyImageView;
314 PFN_vkCreateSampler vkCreateSampler;
315 PFN_vkDestroySampler vkDestroySampler;
317 PFN_vkCreateShaderModule vkCreateShaderModule;
318 PFN_vkDestroyShaderModule vkDestroyShaderModule;
320 PFN_vkCreateQueryPool vkCreateQueryPool;
321 PFN_vkDestroyQueryPool vkDestroyQueryPool;
322 PFN_vkGetQueryPoolResults vkGetQueryPoolResults;
324 PFN_vkCreateCommandPool vkCreateCommandPool;
325 PFN_vkDestroyCommandPool vkDestroyCommandPool;
326 PFN_vkResetCommandPool vkResetCommandPool;
328 PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers;
329 PFN_vkBeginCommandBuffer vkBeginCommandBuffer;
330 PFN_vkCmdBeginQuery vkCmdBeginQuery;
331 PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults;
332 PFN_vkCmdEndQuery vkCmdEndQuery;
333 PFN_vkCmdResetQueryPool vkCmdResetQueryPool;
334 PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp;
335 PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier;
336 PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass;
337 PFN_vkCmdSetScissor vkCmdSetScissor;
338 PFN_vkCmdSetViewport vkCmdSetViewport;
339 PFN_vkCmdClearColorImage vkCmdClearColorImage;
340 PFN_vkCmdEndRenderPass vkCmdEndRenderPass;
341 PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets;
342 PFN_vkCmdBindPipeline vkCmdBindPipeline;
343 PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers;
344 PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer;
345 PFN_vkCmdDraw vkCmdDraw;
346 PFN_vkCmdDrawIndexed vkCmdDrawIndexed;
347 PFN_vkCmdDispatch vkCmdDispatch;
348 PFN_vkCmdCopyBuffer vkCmdCopyBuffer;
349 PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage;
350 PFN_vkCmdCopyImage vkCmdCopyImage;
351 PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer;
352 PFN_vkCmdBlitImage vkCmdBlitImage;
353 PFN_vkCmdPushConstants vkCmdPushConstants;
354 PFN_vkEndCommandBuffer vkEndCommandBuffer;
355 PFN_vkFreeCommandBuffers vkFreeCommandBuffers;
357 PFN_vkCreateRenderPass vkCreateRenderPass;
358 PFN_vkDestroyRenderPass vkDestroyRenderPass;
360 PFN_vkCreateFramebuffer vkCreateFramebuffer;
361 PFN_vkDestroyFramebuffer vkDestroyFramebuffer;
363 PFN_vkCreatePipelineCache vkCreatePipelineCache;
364 PFN_vkDestroyPipelineCache vkDestroyPipelineCache;
366 PFN_vkResetDescriptorPool vkResetDescriptorPool;
367 PFN_vkCreateDescriptorPool vkCreateDescriptorPool;
368 PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool;
370 PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets;
371 PFN_vkFreeDescriptorSets vkFreeDescriptorSets;
373 PFN_vkCreateComputePipelines vkCreateComputePipelines;
374 PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines;
375 PFN_vkDestroyPipeline vkDestroyPipeline;
377 PFN_vkCreatePipelineLayout vkCreatePipelineLayout;
378 PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout;
380 PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout;
381 PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
382 PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout;
384 PFN_vkGetDeviceQueue vkGetDeviceQueue;
385 PFN_vkQueueSubmit vkQueueSubmit;
386 PFN_vkQueueWaitIdle vkQueueWaitIdle;
388 PFN_vkCreateSemaphore vkCreateSemaphore;
389#if defined(VK_KHR_timeline_semaphore)
390 PFN_vkSignalSemaphoreKHR vkSignalSemaphore;
391 PFN_vkWaitSemaphoresKHR vkWaitSemaphores;
392 PFN_vkGetSemaphoreCounterValueKHR vkGetSemaphoreCounterValue;
395 PFN_vkDestroySemaphore vkDestroySemaphore;
397 PFN_vkCreateFence vkCreateFence;
398 PFN_vkWaitForFences vkWaitForFences;
399 PFN_vkGetFenceStatus vkGetFenceStatus;
400 PFN_vkDestroyFence vkDestroyFence;
401 PFN_vkResetFences vkResetFences;
403 PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR;
404 PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR;
405 PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR;
406 PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR;
407 PFN_vkQueuePresentKHR vkQueuePresentKHR;
409#if defined(VK_USE_PLATFORM_WIN32_KHR)
410 PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32HandleKHR;
411 PFN_vkGetFenceWin32HandleKHR vkGetFenceWin32HandleKHR;
412 PFN_vkGetSemaphoreWin32HandleKHR vkGetSemaphoreWin32HandleKHR;
413 PFN_vkImportFenceWin32HandleKHR vkImportFenceWin32HandleKHR;
414 PFN_vkImportSemaphoreWin32HandleKHR vkImportSemaphoreWin32HandleKHR;
418#if !defined(VK_USE_PLATFORM_WIN32_KHR)
419 PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR;
420 PFN_vkGetFenceFdKHR vkGetFenceFdKHR;
421 PFN_vkGetSemaphoreFdKHR vkGetSemaphoreFdKHR;
422 PFN_vkImportFenceFdKHR vkImportFenceFdKHR;
423 PFN_vkImportSemaphoreFdKHR vkImportSemaphoreFdKHR;
427#if defined(VK_USE_PLATFORM_ANDROID_KHR)
428 PFN_vkGetMemoryAndroidHardwareBufferANDROID vkGetMemoryAndroidHardwareBufferANDROID;
429 PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID;
433#if defined(VK_EXT_external_memory_host)
434 PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT;
438#if defined(VK_EXT_calibrated_timestamps)
439 PFN_vkGetCalibratedTimestampsEXT vkGetCalibratedTimestampsEXT;
443 PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE;
445#if defined(VK_EXT_display_control)
446 PFN_vkGetSwapchainCounterEXT vkGetSwapchainCounterEXT;
447 PFN_vkRegisterDeviceEventEXT vkRegisterDeviceEventEXT;
448 PFN_vkRegisterDisplayEventEXT vkRegisterDisplayEventEXT;
452#if defined(VK_EXT_image_drm_format_modifier)
453 PFN_vkGetImageDrmFormatModifierPropertiesEXT vkGetImageDrmFormatModifierPropertiesEXT;
457#if defined(VK_EXT_debug_utils)
458 PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT;
459 PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT;
460 PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT;
461 PFN_vkQueueBeginDebugUtilsLabelEXT vkQueueBeginDebugUtilsLabelEXT;
462 PFN_vkQueueEndDebugUtilsLabelEXT vkQueueEndDebugUtilsLabelEXT;
463 PFN_vkQueueInsertDebugUtilsLabelEXT vkQueueInsertDebugUtilsLabelEXT;
464 PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT;
465 PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT;
474 VkDeviceMemory memory;
501#define VK_CHK_AND_RET(RET, FUNC_STR) \
503 VkResult _ret = RET; \
504 if (_ret != VK_SUCCESS) { \
505 vk_print_result(vk, __FILE__, __LINE__, __func__, _ret, FUNC_STR); \
526#define VK_CHK_WITH_RET(RET, FUNC_STR, TO_RET) \
528 VkResult _ret = RET; \
529 if (_ret != VK_SUCCESS) { \
530 vk_print_result(vk, __FILE__, __LINE__, __func__, _ret, FUNC_STR); \
552#define VK_CHK_WITH_GOTO(RET, FUNC_STR, GOTO) \
554 VkResult _ret = RET; \
555 if (_ret != VK_SUCCESS) { \
556 vk_print_result(vk, __FILE__, __LINE__, __func__, _ret, FUNC_STR); \
563vk_append_to_pnext_chain(VkBaseInStructure *head, VkBaseInStructure *new_struct)
565 assert(new_struct->pNext == NULL);
567 new_struct->pNext = head->pNext;
568 head->pNext = new_struct;
577XRT_CHECK_RESULT
const char *
578vk_result_string(VkResult code);
580XRT_CHECK_RESULT
const char *
581vk_object_type_string(VkObjectType type);
583XRT_CHECK_RESULT
const char *
584vk_physical_device_type_string(VkPhysicalDeviceType device_type);
586XRT_CHECK_RESULT
const char *
587vk_format_string(VkFormat code);
589XRT_CHECK_RESULT
const char *
590vk_sharing_mode_string(VkSharingMode code);
592XRT_CHECK_RESULT
const char *
593vk_present_mode_string(VkPresentModeKHR code);
595XRT_CHECK_RESULT
const char *
596vk_color_space_string(VkColorSpaceKHR code);
598XRT_CHECK_RESULT
const char *
599vk_power_state_string(VkDisplayPowerStateEXT code);
612XRT_CHECK_RESULT
const char *
619XRT_CHECK_RESULT
const char *
626XRT_CHECK_RESULT
const char *
633XRT_CHECK_RESULT
const char *
641XRT_CHECK_RESULT
const char *
642vk_display_plane_alpha_flag_string(VkDisplayPlaneAlphaFlagBitsKHR bits,
bool null_on_unknown);
649XRT_CHECK_RESULT
const char *
659#define VK_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__)
660#define VK_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__)
661#define VK_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__)
662#define VK_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__)
663#define VK_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__)
672#if defined(VK_EXT_debug_utils) || defined(XRT_DOXYGEN)
688#define VK_NAME_OBJ(VK, TYPE, SUFFIX, OBJ, NAME) \
690 if ((VK)->has_EXT_debug_utils) { \
691 XRT_MAYBE_UNUSED TYPE _thing = (TYPE)(OBJ); \
692 vk_name_object(VK, VK_OBJECT_TYPE_##SUFFIX, (uint64_t)OBJ, NAME); \
699#define VK_NAME_OBJ(VK, TYPE, SUFFIX, OBJ, NAME) VK_NAME_OBJ_DISABLED(VK, TYPE, OBJ)
718#define VK_NAME_OBJ_DISABLED(VK, TYPE, OBJ) \
720 XRT_MAYBE_UNUSED TYPE _thing = (TYPE)(OBJ); \
726#define VK_NAME_INSTANCE(VK, OBJ, NAME) VK_NAME_OBJ_DISABLED(VK, VkInstance, (uintptr_t)OBJ)
727#define VK_NAME_PHYSICAL_DEVICE(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkPhysicalDevice, PHYSICAL_DEVICE, (uintptr_t)OBJ, NAME)
728#define VK_NAME_DEVICE(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkDevice, DEVICE, (uintptr_t)OBJ, NAME)
729#define VK_NAME_QUEUE(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkQueue, QUEUE, (uintptr_t)OBJ, NAME)
730#define VK_NAME_COMMAND_BUFFER(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkCommandBuffer, COMMAND_BUFFER, (uintptr_t)OBJ, NAME)
732#define VK_NAME_SEMAPHORE(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkSemaphore, SEMAPHORE, OBJ, NAME)
733#define VK_NAME_FENCE(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkFence, FENCE, OBJ, NAME)
734#define VK_NAME_DEVICE_MEMORY(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkDeviceMemory, DEVICE_MEMORY, OBJ, NAME)
735#define VK_NAME_BUFFER(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkBuffer, BUFFER, OBJ, NAME)
736#define VK_NAME_IMAGE(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkImage, IMAGE, OBJ, NAME)
737#define VK_NAME_EVENT(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkEvent, EVENT, OBJ, NAME)
738#define VK_NAME_QUERY_POOL(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkQueryPool, QUERY_POOL, OBJ, NAME)
739#define VK_NAME_BUFFER_VIEW(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkBufferView, BUFFER_VIEW, OBJ, NAME)
740#define VK_NAME_IMAGE_VIEW(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkImageView, IMAGE_VIEW, OBJ, NAME)
741#define VK_NAME_SHADER_MODULE(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkShaderModule, SHADER_MODULE, OBJ, NAME)
742#define VK_NAME_PIPELINE_CACHE(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkPipelineCache, PIPELINE_CACHE, OBJ, NAME)
743#define VK_NAME_PIPELINE_LAYOUT(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkPipelineLayout, PIPELINE_LAYOUT, OBJ, NAME)
744#define VK_NAME_RENDER_PASS(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkRenderPass, RENDER_PASS, OBJ, NAME)
745#define VK_NAME_PIPELINE(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkPipeline, PIPELINE, OBJ, NAME)
746#define VK_NAME_DESCRIPTOR_SET_LAYOUT(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkDescriptorSetLayout, DESCRIPTOR_SET_LAYOUT, OBJ, NAME)
747#define VK_NAME_SAMPLER(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkSampler, SAMPLER, OBJ, NAME)
748#define VK_NAME_DESCRIPTOR_POOL(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkDescriptorPool, DESCRIPTOR_POOL, OBJ, NAME)
749#define VK_NAME_DESCRIPTOR_SET(VK, OBJ, NAME) VK_NAME_OBJ_DISABLED(VK, VkDescriptorSet, OBJ)
750#define VK_NAME_FRAMEBUFFER(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkFramebuffer, FRAMEBUFFER, OBJ, NAME)
751#define VK_NAME_COMMAND_POOL(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkCommandPool, COMMAND_POOL, OBJ, NAME)
753#define VK_NAME_SURFACE(VK, OBJ, NAME) VK_NAME_OBJ_DISABLED(VK, VkSurfaceKHR, OBJ)
754#define VK_NAME_SWAPCHAIN(VK, OBJ, NAME) VK_NAME_OBJ(VK, VkSwapchainKHR, SWAPCHAIN_KHR, OBJ, NAME)
772 struct vk_bundle *vk,
const char *file,
int line,
const char *calling_func, VkResult ret,
const char *called_func);
783 const VkPhysicalDeviceProperties *pdp,
821vk_print_display_surface_create_info(
struct vk_bundle *vk,
822 VkDisplaySurfaceCreateInfoKHR *i,
841 const char *layer_name,
842 uint32_t *out_prop_count,
843 VkExtensionProperties **out_props);
853 uint32_t *out_physical_device_count,
854 VkPhysicalDevice **out_physical_devices);
864 VkPhysicalDevice physical_device,
865 const char *layer_name,
866 uint32_t *out_prop_count,
867 VkExtensionProperties **out_props);
869#if defined(VK_KHR_surface) || defined(XRT_DOXYGEN)
878 VkSurfaceKHR surface,
879 uint32_t *out_format_count,
880 VkSurfaceFormatKHR **out_formats);
889 VkSurfaceKHR surface,
890 uint32_t *out_present_mode_count,
891 VkPresentModeKHR **out_present_modes);
894#if defined(VK_KHR_swapchain) || defined(XRT_DOXYGEN)
902 VkSwapchainKHR swapchain,
903 uint32_t *out_image_count,
904 VkImage **out_images);
907#if defined(VK_USE_PLATFORM_DISPLAY_KHR) || defined(XRT_DOXYGEN)
915 VkPhysicalDevice physical_device,
916 uint32_t *out_prop_count,
917 VkDisplayPropertiesKHR **out_props);
926 VkPhysicalDevice physical_device,
927 uint32_t *out_prop_count,
928 VkDisplayPlanePropertiesKHR **out_props);
938 VkPhysicalDevice physical_device,
939 VkDisplayKHR display,
940 uint32_t *out_prop_count,
941 VkDisplayModePropertiesKHR **out_props);
1024 bool shader_image_gather_extended;
1025 bool shader_storage_image_write_without_format;
1026 bool null_descriptor;
1027 bool timeline_semaphore;
1028 bool synchronization_2;
1029 bool ext_fmt_resolve;
1030 bool storage_buffer_8bit_access;
1039XRT_CHECK_RESULT VkResult
1043 VkQueueGlobalPriorityEXT global_priority,
1072XRT_CHECK_RESULT VkResult
1074 PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr,
1075 VkInstance instance,
1076 VkPhysicalDevice physical_device,
1078 uint32_t queue_family_index,
1079 uint32_t queue_index,
1080 bool external_fence_fd_enabled,
1081 bool external_semaphore_fd_enabled,
1082 bool timeline_semaphore_enabled,
1083 bool image_format_list_enabled,
1084 bool debug_utils_enabled,
1098vk_get_memory_type(
struct vk_bundle *vk, uint32_t type_bits, VkMemoryPropertyFlags memory_props, uint32_t *out_type_id);
1134XRT_CHECK_RESULT VkResult
1137 const VkMemoryRequirements *requirements,
1138 const void *pNext_for_allocate,
1139 const char *caller_name,
1140 VkDeviceMemory *out_mem);
1163XRT_CHECK_RESULT VkResult
1168 VkDeviceMemory *out_mem);
1183XRT_CHECK_RESULT VkResult
1185 VkDeviceMemory device_memory,
1196 VkImageUsageFlags usage,
1197 VkDeviceMemory *out_mem,
1198 VkImage *out_image);
1208 struct vk_bundle *vk, VkExtent2D extent, VkImageUsageFlags usage, VkDeviceMemory *out_mem, VkImage *out_image);
1218 VkImageTiling image_tiling,
1219 VkImageUsageFlags image_usage_flags,
1220 VkMemoryPropertyFlags memory_property_flags,
1221 VkDeviceMemory *out_mem,
1222 VkImage *out_image);
1228vk_create_sampler(
struct vk_bundle *vk, VkSamplerAddressMode clamp_mode, VkSampler *out_sampler);
1243 VkImageViewType type,
1245 VkImageSubresourceRange subresource_range,
1246 VkImageView *out_view);
1252vk_create_view_swizzle(
struct vk_bundle *vk,
1254 VkImageViewType type,
1256 VkImageSubresourceRange subresource_range,
1257 VkComponentMapping components,
1258 VkImageView *out_view);
1269 VkImageViewType type,
1271 VkImageUsageFlags image_usage,
1272 VkImageSubresourceRange subresource_range,
1273 VkImageView *out_view);
1283vk_init_descriptor_pool(
struct vk_bundle *vk,
1284 const VkDescriptorPoolSize *pool_sizes,
1285 uint32_t pool_size_count,
1287 VkDescriptorPool *out_descriptor_pool);
1290vk_allocate_descriptor_sets(
struct vk_bundle *vk,
1291 VkDescriptorPool descriptor_pool,
1293 const VkDescriptorSetLayout *set_layout,
1294 VkDescriptorSet *sets);
1306 VkBufferUsageFlags usage,
1307 VkMemoryPropertyFlags properties,
1308 VkBuffer *out_buffer,
1309 VkDeviceMemory *out_mem);
1315vk_update_buffer(
struct vk_bundle *vk,
float *buffer,
size_t buffer_size, VkDeviceMemory memory);
1333 VkCommandBuffer cmd_buffer,
1335 VkAccessFlags src_access_mask,
1336 VkAccessFlags dst_access_mask,
1337 VkImageLayout old_image_layout,
1338 VkImageLayout new_image_layout,
1339 VkPipelineStageFlags src_stage_mask,
1340 VkPipelineStageFlags dst_stage_mask,
1341 VkImageSubresourceRange subresource_range);
1352 VkCommandBuffer cmd_buffer,
1354 VkAccessFlags src_access_mask,
1355 VkAccessFlags dst_access_mask,
1356 VkImageLayout old_layout,
1357 VkImageLayout new_layout,
1358 VkImageSubresourceRange subresource_range);
1360#if defined(VK_EXT_debug_utils) || defined(XRT_DOXYGEN)
1404 VkDescriptorPool *out_descriptor_pool);
1413 VkDescriptorPool descriptor_pool,
1414 VkDescriptorSetLayout descriptor_layout,
1415 VkDescriptorSet *out_descriptor_set);
1424 VkDescriptorSetLayout descriptor_set_layout,
1425 VkPipelineLayout *out_pipeline_layout);
1442 VkPipelineCache pipeline_cache,
1443 VkShaderModule shader,
1444 VkPipelineLayout pipeline_layout,
1445 const VkSpecializationInfo *specialization_info,
1446 VkPipeline *out_compute_pipeline);
1460VkExternalMemoryHandleTypeFlags
1486#define VK_CSCI_FORMATS(THING_COLOR, THING_DS, THING_D, THING_S) \
1488 THING_COLOR(R16G16B16A16_UNORM) \
1489 THING_COLOR(R16G16B16A16_SFLOAT) \
1490 THING_COLOR(R16G16B16_UNORM) \
1491 THING_COLOR(R16G16B16_SFLOAT) \
1492 THING_COLOR(R8G8B8A8_SRGB) \
1493 THING_COLOR(B8G8R8A8_SRGB) \
1494 THING_COLOR(R8G8B8_SRGB) \
1495 THING_COLOR(R8G8B8A8_UNORM) \
1496 THING_COLOR(B8G8R8A8_UNORM) \
1497 THING_COLOR(R8G8B8_UNORM) \
1498 THING_COLOR(B8G8R8_UNORM) \
1499 THING_COLOR(R5G6B5_UNORM_PACK16) \
1500 THING_COLOR(R32_SFLOAT) \
1502 THING_D(D32_SFLOAT) \
1503 THING_D(D16_UNORM) \
1504 THING_D(X8_D24_UNORM_PACK32) \
1506 THING_DS(D24_UNORM_S8_UINT) \
1507 THING_DS(D32_SFLOAT_S8_UINT) \
1574VkExternalMemoryHandleTypeFlags
1584 VkFormat image_format,
1586 VkExternalMemoryHandleTypeFlags handle_type,
1587 bool *out_importable,
1588 bool *out_exportable);
1610XRT_CHECK_RESULT
bool
1623XRT_CHECK_RESULT VkResult
1641XRT_CHECK_RESULT VkResult
1661XRT_CHECK_RESULT VkResult
1664#if defined(VK_KHR_timeline_semaphore) || defined(XRT_DOXYGEN)
1671XRT_CHECK_RESULT VkResult
1672vk_create_timeline_semaphore_and_native(
struct vk_bundle *vk,
1673 VkSemaphore *out_sem,
1689XRT_CHECK_RESULT VkResult
1692#if defined(VK_KHR_timeline_semaphore) || defined(XRT_DOXYGEN)
1699XRT_CHECK_RESULT VkResult
1710#if defined(VK_EXT_calibrated_timestamps) || defined(XRT_DOXYGEN)
1730XRT_CHECK_RESULT VkResult
u_logging_level
Logging level enum.
Definition: u_logging.h:44
VkResult vk_enumerate_display_mode_properties(struct vk_bundle *vk, VkPhysicalDevice physical_device, VkDisplayKHR display, uint32_t *out_prop_count, VkDisplayModePropertiesKHR **out_props)
Enumerate the mode properties of the given VkDisplayKHR, which belongs to the given VkPhysicalDevice.
VkResult vk_enumerate_physical_device_extension_properties(struct vk_bundle *vk, VkPhysicalDevice physical_device, const char *layer_name, uint32_t *out_prop_count, VkExtensionProperties **out_props)
Enumerate the extension properties of the given VkPhysicalDevice for the named layer_name,...
Definition: vk_enumerate.c:102
VkResult vk_create_image_advanced(struct vk_bundle *vk, VkExtent3D extent, VkFormat format, VkImageTiling image_tiling, VkImageUsageFlags image_usage_flags, VkMemoryPropertyFlags memory_property_flags, VkDeviceMemory *out_mem, VkImage *out_image)
Helper to create a VkImage, with more options for tiling and memory storage.
Definition: vk_helpers.c:972
VkResult vk_enumerate_physical_display_plane_properties(struct vk_bundle *vk, VkPhysicalDevice physical_device, uint32_t *out_prop_count, VkDisplayPlanePropertiesKHR **out_props)
Enumerate the display plane properties of the given VkPhysicalDevice.
XRT_CHECK_RESULT VkResult vk_create_device(struct vk_bundle *vk, int forced_index, bool only_compute, VkQueueGlobalPriorityEXT global_priority, struct u_string_list *required_device_ext_list, struct u_string_list *optional_device_ext_list, const struct vk_device_features *optional_device_features)
Creates a VkDevice and initialises the VkQueue.
Definition: vk_bundle_init.c:1225
void vk_cmd_image_barrier_gpu_locked(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)
Inserts a image barrier command specifically for GPU commands, doesn't take any locks,...
Definition: vk_helpers.c:1720
XRT_CHECK_RESULT 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, bool external_fence_fd_enabled, bool external_semaphore_fd_enabled, bool timeline_semaphore_enabled, bool image_format_list_enabled, bool debug_utils_enabled, enum u_logging_level log_level)
Initialize a bundle with objects given to us by client code, used by client_vk_compositor in Composit...
Definition: vk_bundle_init.c:1512
VkResult vk_create_image_mutable_rgba(struct vk_bundle *vk, VkExtent2D extent, VkImageUsageFlags usage, VkDeviceMemory *out_mem, VkImage *out_image)
Helper to create a mutable RG88B8A8 VkImage that specializes in the two UNORM and SRGB variants of th...
Definition: vk_helpers.c:935
XRT_CHECK_RESULT VkResult vk_convert_timestamps_to_host_ns(struct vk_bundle *vk, uint32_t count, uint64_t *in_out_timestamps)
Convert timestamps in GPU ticks (as return by VkQueryPool timestamp queries) into host CPU nanosecond...
XRT_CHECK_RESULT VkResult vk_create_semaphore_from_native(struct vk_bundle *vk, xrt_graphics_sync_handle_t native, VkSemaphore *out_sem)
Creates a Vulkan semaphore from a native graphics sync handle.
Definition: vk_sync_objects.c:461
void vk_cmd_image_barrier_locked(struct vk_bundle *vk, VkCommandBuffer cmd_buffer, VkImage image, VkAccessFlags src_access_mask, VkAccessFlags dst_access_mask, VkImageLayout old_image_layout, VkImageLayout new_image_layout, VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask, VkImageSubresourceRange subresource_range)
Inserts a image barrier command, doesn't take any locks, the calling code will need hold the lock for...
Definition: vk_helpers.c:1683
VkResult vk_enumerate_physical_device_display_properties(struct vk_bundle *vk, VkPhysicalDevice physical_device, uint32_t *out_prop_count, VkDisplayPropertiesKHR **out_props)
Enumerate the display properties of the given VkPhysicalDevice.
XRT_CHECK_RESULT VkResult vk_create_timeline_semaphore_from_native(struct vk_bundle *vk, xrt_graphics_sync_handle_t native, VkSemaphore *out_sem)
Creates a Vulkan timeline semaphore from a native graphics sync handle, see vk_create_semaphore_from_...
VkResult vk_create_image_simple(struct vk_bundle *vk, VkExtent2D extent, VkFormat format, VkImageUsageFlags usage, VkDeviceMemory *out_mem, VkImage *out_image)
Helper to create a VkImage.
Definition: vk_helpers.c:914
VkResult vk_select_physical_device(struct vk_bundle *vk, int forced_index)
Setup the physical device, this is called by vk_create_device but has uses for outside of that.
Definition: vk_bundle_init.c:1219
void vk_print_device_info(struct vk_bundle *vk, enum u_logging_level log_level, const VkPhysicalDeviceProperties *pdp, uint32_t gpu_index, const char *title)
Print device information to the logger at the given logging level, if the vk_bundle has that level en...
Definition: vk_print.c:75
VkResult vk_enumerate_swapchain_images(struct vk_bundle *vk, VkSwapchainKHR swapchain, uint32_t *out_image_count, VkImage **out_images)
Enumerate the images of the given VkSwapchainKHR.
VkResult vk_deinit_mutex(struct vk_bundle *vk)
De-initialize mutexes in the vk_bundle.
Definition: vk_bundle_init.c:1498
XRT_CHECK_RESULT VkResult vk_create_semaphore_and_native(struct vk_bundle *vk, VkSemaphore *out_sem, xrt_graphics_sync_handle_t *out_native)
Creates a Vulkan semaphore and a native graphics sync handle.
Definition: vk_sync_objects.c:282
XRT_CHECK_RESULT VkResult vk_create_and_submit_fence_native(struct vk_bundle *vk, xrt_graphics_sync_handle_t *out_native)
Creates a Vulkan fence, submits it to the default VkQueue and return its native graphics sync handle.
Definition: vk_sync_objects.c:105
VkResult vk_enumerate_surface_present_modes(struct vk_bundle *vk, VkSurfaceKHR surface, uint32_t *out_present_mode_count, VkPresentModeKHR **out_present_modes)
Enumerate the present modes of the given VkSurfaceKHR.
XRT_CHECK_RESULT VkResult vk_create_image_from_native(struct vk_bundle *vk, const struct xrt_swapchain_create_info *info, struct xrt_image_native *image_native, VkImage *out_image, VkDeviceMemory *out_mem)
Creates a Vulkan device memory and image from a native graphics buffer handle.
Definition: vk_helpers.c:1075
VkResult vk_get_loader_functions(struct vk_bundle *vk, PFN_vkGetInstanceProcAddr g)
Can be done on a completely bare bundle.
Definition: vk_function_loaders.c:43
XRT_CHECK_RESULT bool vk_can_import_and_export_timeline_semaphore(struct vk_bundle *vk)
Is there a good likelihood that the import/export of a timeline semaphore will succeed,...
Definition: vk_sync_objects.c:77
VkResult vk_enumerate_physical_devices(struct vk_bundle *vk, uint32_t *out_physical_device_count, VkPhysicalDevice **out_physical_devices)
Enumerate the physical devices of the VkInstance that has been opened on the given vk_bundle.
Definition: vk_enumerate.c:79
XRT_CHECK_RESULT VkResult vk_create_fence_sync_from_native(struct vk_bundle *vk, xrt_graphics_sync_handle_t native, VkFence *out_fence)
Creates a Vulkan fence from a native graphics sync handle.
Definition: vk_sync_objects.c:338
VkResult vk_enumerate_instance_extensions_properties(struct vk_bundle *vk, const char *layer_name, uint32_t *out_prop_count, VkExtensionProperties **out_props)
Return the VkExtensionProperties of the given layer_name, NULL means the "base" driver instance.
Definition: vk_enumerate.c:55
VkResult vk_create_view_usage(struct vk_bundle *vk, VkImage image, VkImageViewType type, VkFormat format, VkImageUsageFlags image_usage, VkImageSubresourceRange subresource_range, VkImageView *out_view)
Creates a image with a specific subset of usage, useful for a mutable images where one format might n...
Definition: vk_helpers.c:1505
struct u_string_list * vk_build_instance_extensions(struct vk_bundle *vk, struct u_string_list *required_instance_ext_list, struct u_string_list *optional_instance_ext_list)
Only requires vk_get_loader_functions to have been called.
Definition: vk_bundle_init.c:128
XRT_CHECK_RESULT VkResult vk_alloc_and_bind_image_memory(struct vk_bundle *vk, VkImage image, const VkMemoryRequirements *requirements, const void *pNext_for_allocate, const char *caller_name, VkDeviceMemory *out_mem)
Allocate memory for an image and bind it to that image.
Definition: vk_helpers.c:806
VkResult vk_enumerate_surface_formats(struct vk_bundle *vk, VkSurfaceKHR surface, uint32_t *out_format_count, VkSurfaceFormatKHR **out_formats)
Enumerate the surface formats of the given VkSurfaceKHR, returns a list of VkSurfaceFormatKHR,...
void vk_name_object(struct vk_bundle *vk, VkObjectType type, uint64_t object, const char *name)
Uses VK_EXT_debug_utils to set a name for an object, for easier debugging.
void vk_print_opened_device_info(struct vk_bundle *vk, enum u_logging_level log_level)
Print device information about the device that bundle manages at the given logging level if the vk_bu...
Definition: vk_print.c:103
VkResult vk_check_required_instance_extensions(struct vk_bundle *vk, struct u_string_list *required_instance_ext_list)
Check if the required instance extensions are supported, if not print error message with all extensio...
Definition: vk_bundle_init.c:74
VkResult vk_get_device_functions(struct vk_bundle *vk)
Requires a device to have been created and set on the bundle.
Definition: vk_function_loaders.c:158
XRT_CHECK_RESULT VkResult vk_get_native_handle_from_device_memory(struct vk_bundle *vk, VkDeviceMemory device_memory, xrt_graphics_buffer_handle_t *out_handle)
Given a DeviceMemory handle created to be exportable, outputs the native buffer type (FD on desktop L...
Definition: vk_helpers.c:1362
VkResult vk_get_instance_functions(struct vk_bundle *vk)
Requires a instance to have been created and set on the bundle.
Definition: vk_function_loaders.c:57
void vk_cmd_insert_label(struct vk_bundle *vk, VkCommandBuffer cmd_buffer, const char *name)
Uses VK_EXT_debug_utils to insert debug label into a VkCommandBuffer.
void vk_print_result(struct vk_bundle *vk, const char *file, int line, const char *calling_func, VkResult ret, const char *called_func)
Print the result of a function, info level if ret == VK_SUCCESS and error level otherwise.
Definition: vk_print.c:49
VkResult vk_init_mutex(struct vk_bundle *vk)
Initialize mutexes in the vk_bundle.
Definition: vk_bundle_init.c:1489
xrt_swapchain_usage_bits
Usage of the swapchain images.
Definition: xrt_compositor.h:509
Wrapper around OS threading native functions.
A wrapper around a native mutex.
Definition: os_threading.h:55
Definition: u_string_list.cpp:19
Definition: vk_helpers.h:472
A bundle of Vulkan functions and objects, used by both Compositor and Compositor client code.
Definition: vk_helpers.h:51
bool synchronization_2
Was synchronization2 requested, available, and enabled?
Definition: vk_helpers.h:177
bool timeline_semaphore
Were timeline semaphore requested, available, and enabled?
Definition: vk_helpers.h:168
uint32_t timestamp_valid_bits
Valid bits in the queue selected.
Definition: vk_helpers.h:165
uint32_t max_per_stage_descriptor_storage_images
Per stage limit on storage images.
Definition: vk_helpers.h:174
bool is_tegra
Is the GPU a tegra device.
Definition: vk_helpers.h:184
bool timestamp_compute_and_graphics
Are timestamps available for compute and graphics queues?
Definition: vk_helpers.h:159
bool present_wait
Was KHR_present_wait requested, available, and enabled?
Definition: vk_helpers.h:180
uint32_t max_per_stage_descriptor_sampled_images
Per stage limit on sampled images (includes combined).
Definition: vk_helpers.h:171
float timestamp_period
Nanoseconds per gpu tick.
Definition: vk_helpers.h:162
Arguments to vk_create_descriptor_pool function.
Definition: vk_helpers.h:1383
uint32_t descriptor_count
The max count of created descriptors.
Definition: vk_helpers.h:1390
uint32_t uniform_per_descriptor_count
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER.
Definition: vk_helpers.h:1384
bool freeable
Are descriptors freeable, or must vkResetDescriptorPool be used.
Definition: vk_helpers.h:1393
uint32_t sampler_per_descriptor_count
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER.
Definition: vk_helpers.h:1385
uint32_t storage_image_per_descriptor_count
VK_DESCRIPTOR_TYPE_STORAGE_IMAGE.
Definition: vk_helpers.h:1386
uint32_t storage_buffer_per_descriptor_count
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER.
Definition: vk_helpers.h:1387
Used to enable device features as a argument vk_create_device.
Definition: vk_helpers.h:1023
A single image of a swapchain based on native buffer handles.
Definition: xrt_compositor.h:2158
Swapchain creation info.
Definition: xrt_compositor.h:879
Basic logging functionality.
A collection of strings, like a list of extensions to enable.
VkImageAspectFlags vk_csci_get_barrier_aspect_mask(VkFormat format)
Return the barrier aspect mask for this format, this is intended for the barriers that flush the data...
Definition: vk_compositor_flags.c:131
VkResult vk_create_descriptor_set(struct vk_bundle *vk, VkDescriptorPool descriptor_pool, VkDescriptorSetLayout descriptor_layout, VkDescriptorSet *out_descriptor_set)
Creates a descriptor set.
Definition: vk_state_creators.c:88
void vk_print_external_handles_info(struct vk_bundle *vk, enum u_logging_level log_level)
Print external handle features to the logger at the given logging level, if the vk_bundle has that le...
Definition: vk_print.c:127
VkExternalMemoryHandleTypeFlags vk_cb_get_buffer_external_handle_type(struct vk_bundle *vk)
Return the extern handle type that a buffer should be created with.
Definition: vk_compositor_flags.c:65
void vk_fill_in_has_instance_extensions(struct vk_bundle *vk, struct u_string_list *ext_list)
Fills in has_* in vk_bundle given a string of prefiltered instance extensions.
Definition: vk_bundle_init.c:179
XRT_CHECK_RESULT const char * vk_surface_transform_flag_string(VkSurfaceTransformFlagBitsKHR bits, bool null_on_unknown)
Returns the surface transform flag if one valid bit is set, if multiple bits are set,...
Definition: vk_helpers.c:697
bool vk_csci_is_format_supported(struct vk_bundle *vk, VkFormat format, enum xrt_swapchain_usage_bits xbits)
Verify if a format is supported for a specific usage.
Definition: vk_compositor_flags.c:344
XRT_CHECK_RESULT const char * xrt_swapchain_usage_flag_string(enum xrt_swapchain_usage_bits bits, bool null_on_unknown)
Returns xrt swapchain_usage flag if one valid bit is set, if multiple bits are set,...
Definition: vk_helpers.c:742
VkExternalMemoryHandleTypeFlags vk_csci_get_image_external_handle_type(struct vk_bundle *vk, struct xrt_image_native *xin)
Return the extern handle type that a image should be created with.
Definition: vk_compositor_flags.c:214
VkResult vk_create_pipeline_cache(struct vk_bundle *vk, VkPipelineCache *out_pipeline_cache)
Creates a pipeline cache.
Definition: vk_state_creators.c:147
VkResult vk_create_descriptor_pool(struct vk_bundle *vk, const struct vk_descriptor_pool_info *info, VkDescriptorPool *out_descriptor_pool)
Creates a descriptor pool, made for a single layout.
Definition: vk_state_creators.c:16
void vk_print_swapchain_create_info(struct vk_bundle *vk, VkSwapchainCreateInfoKHR *i, enum u_logging_level log_level)
Print a VkSwapchainCreateInfoKHR, used to log during creation.
Definition: vk_print.c:228
XRT_CHECK_RESULT const char * vk_image_usage_flag_string(VkImageUsageFlagBits bits, bool null_on_unknown)
Returns the image usage flag if one valid bit is set, if multiple bits are set, will return 'MULTIPLE...
Definition: vk_helpers.c:626
VkAccessFlags vk_csci_get_barrier_access_mask(enum xrt_swapchain_usage_bits bits)
Returns the access flags for the compositor to app barriers.
Definition: vk_compositor_flags.c:79
XRT_CHECK_RESULT const char * vk_format_feature_flag_string(VkFormatFeatureFlagBits bits, bool null_on_unknown)
Returns the format feature flag if one valid bit is set, if multiple bits are set,...
Definition: vk_helpers.c:605
void vk_csci_get_image_external_support(struct vk_bundle *vk, VkFormat image_format, enum xrt_swapchain_usage_bits bits, VkExternalMemoryHandleTypeFlags handle_type, bool *out_importable, bool *out_exportable)
Get whether a given image can be imported/exported for a handle type.
Definition: vk_compositor_flags.c:229
XRT_CHECK_RESULT const char * vk_composite_alpha_flag_string(VkCompositeAlphaFlagBitsKHR bits, bool null_on_unknown)
Returns the composite alpha flag if one valid bit is set, if multiple bits are set,...
Definition: vk_helpers.c:678
VkResult vk_create_compute_pipeline(struct vk_bundle *vk, VkPipelineCache pipeline_cache, VkShaderModule shader, VkPipelineLayout pipeline_layout, const VkSpecializationInfo *specialization_info, VkPipeline *out_compute_pipeline)
Creates a compute pipeline, assumes entry function is called 'main'.
Definition: vk_state_creators.c:172
void vk_print_features_info(struct vk_bundle *vk, enum u_logging_level log_level)
Print device features to the logger at the given logging level, if the vk_bundle has that level enabl...
Definition: vk_print.c:112
VkImageLayout vk_csci_get_barrier_optimal_layout(VkFormat format)
Return the optimal layout for this format, this is the layout as given to the app so is bound to the ...
Definition: vk_compositor_flags.c:112
VkImageUsageFlags vk_csci_get_image_usage_flags(struct vk_bundle *vk, VkFormat format, enum xrt_swapchain_usage_bits bits)
Returns the usage bits for a given selected format and usage.
Definition: vk_compositor_flags.c:177
VkResult vk_create_pipeline_layout(struct vk_bundle *vk, VkDescriptorSetLayout descriptor_set_layout, VkPipelineLayout *out_pipeline_layout)
Creates a pipeline layout from a single descriptor set layout.
Definition: vk_state_creators.c:118
VkImageAspectFlags vk_csci_get_image_view_aspect(VkFormat format, enum xrt_swapchain_usage_bits bits)
For images views created by the compositor to sample the images, what aspect should be set.
Definition: vk_compositor_flags.c:154
Header holding common defines.
Header declaring XRT graphics interfaces.
int xrt_graphics_buffer_handle_t
The type underlying buffers shared between compositor clients and the main compositor.
Definition: xrt_handles.h:246
int xrt_graphics_sync_handle_t
The type underlying synchronization primitives (semaphores, etc) shared between compositor clients an...
Definition: xrt_handles.h:348
Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.