Monado OpenXR Runtime
comp_vulkan.c File Reference

Vulkan code for compositors. More...

#include "os/os_time.h"
#include "util/u_handles.h"
#include "util/u_trace_marker.h"
#include "util/comp_vulkan.h"
Include dependency graph for comp_vulkan.c:

Macros

#define VK_ERROR_RET(VK, FUNC, MSG, RET)   VK_ERROR(VK, FUNC ": %s\n\t" MSG, vk_result_string(RET))
 
#define UUID_STR_SIZE   (XRT_UUID_SIZE * 3 + 1)
 
#define CHECK_COLOR(FORMAT)    formats->has_##FORMAT = vk_csci_is_format_supported(vk, VK_FORMAT_##FORMAT, XRT_SWAPCHAIN_USAGE_COLOR);
 
#define CHECK_DS(FORMAT)    formats->has_##FORMAT = vk_csci_is_format_supported(vk, VK_FORMAT_##FORMAT, XRT_SWAPCHAIN_USAGE_DEPTH_STENCIL);
 
#define ADD_IF_SUPPORTED(FORMAT)
 
#define PRINT_NAME(FORMAT)   "\n\tVK_FORMAT_" #FORMAT ": %s"
 
#define PRINT_BOOLEAN(FORMAT)   , formats->has_##FORMAT ? "true" : "false"
 

Functions

static void snprint_luid (char *str, size_t size, xrt_luid_t *luid)
 
static void snprint_uuid (char *str, size_t size, xrt_uuid_t *uuid)
 
static bool get_device_id_props (struct vk_bundle *vk, int gpu_index, VkPhysicalDeviceIDProperties *out_id_props)
 
static bool get_device_uuid (struct vk_bundle *vk, int gpu_index, xrt_uuid_t *uuid)
 
static bool get_device_luid (struct vk_bundle *vk, int gpu_index, xrt_luid_t *luid)
 
VkResult fill_in_results (struct vk_bundle *vk, const struct comp_vulkan_arguments *vk_args, struct comp_vulkan_results *vk_res)
 
static VkResult create_instance (struct vk_bundle *vk, const struct comp_vulkan_arguments *vk_args)
 
static VkResult create_device (struct vk_bundle *vk, const struct comp_vulkan_arguments *vk_args)
 
bool comp_vulkan_init_bundle (struct vk_bundle *vk, const struct comp_vulkan_arguments *vk_args, struct comp_vulkan_results *vk_res)
 Fully initialises a vk_bundle, by creating instance, device and queue. More...
 
void comp_vulkan_formats_check (struct vk_bundle *vk, struct comp_vulkan_formats *formats)
 Fills in a comp_vulkan_formats struct with the supported formats, use comp_vulkan_formats_copy_to_info to fill a compositor info struct. More...
 
void comp_vulkan_formats_copy_to_info (const struct comp_vulkan_formats *formats, struct xrt_compositor_info *info)
 Fills in a xrt_compositor_info struct with the formats listed from a comp_vulkan_formats. More...
 
void comp_vulkan_formats_log (enum u_logging_level log_level, const struct comp_vulkan_formats *formats)
 Logs the formats at info level. More...
 

Detailed Description

Macro Definition Documentation

◆ ADD_IF_SUPPORTED

#define ADD_IF_SUPPORTED (   FORMAT)
Value:
if (formats->has_##FORMAT) { \
info->formats[format_count++] = VK_FORMAT_##FORMAT; \
}