Monado OpenXR Runtime
comp_target_swapchain.c File Reference

Target Vulkan swapchain code. More...

#include "os/os_threading.h"
#include "util/u_misc.h"
#include "util/u_pacing.h"
#include "util/u_pretty_print.h"
#include "vk/vk_surface_info.h"
#include "main/comp_compositor.h"
#include "main/comp_target_swapchain.h"
#include <assert.h>
#include <stdlib.h>
#include <inttypes.h>
Include dependency graph for comp_target_swapchain.c:

Functions

static struct vk_bundleget_vk (struct comp_target_swapchain *cts)
 
static void destroy_old (struct comp_target_swapchain *cts, VkSwapchainKHR old)
 
static void destroy_image_views (struct comp_target_swapchain *cts)
 
static void create_image_views (struct comp_target_swapchain *cts)
 
static VkExtent2D select_extent (struct comp_target_swapchain *cts, VkSurfaceCapabilitiesKHR caps, VkExtent2D preferred)
 
static uint32_t select_image_count (struct comp_target_swapchain *cts, VkSurfaceCapabilitiesKHR caps, uint32_t preferred_at_least_image_count)
 
static bool check_surface_present_mode (struct comp_target_swapchain *cts, const struct vk_surface_info *info, VkPresentModeKHR present_mode)
 
static bool pick_first_matching_surface_format (const struct comp_target_create_images_info *create_info, VkSurfaceFormatKHR *surface_formats, uint32_t surface_format_count, VkSurfaceFormatKHR *out_surface_format)
 
static bool find_surface_format (struct comp_target_swapchain *cts, const struct comp_target_create_images_info *create_info, const struct vk_surface_info *info, VkSurfaceFormatKHR *out_surface_format)
 
static void do_update_timings_google_display_timing (struct comp_target_swapchain *cts)
 
static void do_update_timings_vblank_thread (struct comp_target_swapchain *cts)
 
static void target_fini_semaphores (struct comp_target_swapchain *cts)
 
static void target_init_semaphores (struct comp_target_swapchain *cts)
 
static void comp_target_swapchain_create_images (struct comp_target *ct, const struct comp_target_create_images_info *create_info)
 
static bool comp_target_swapchain_has_images (struct comp_target *ct)
 
static VkResult comp_target_swapchain_acquire_next_image (struct comp_target *ct, uint32_t *out_index)
 
static VkResult comp_target_swapchain_present (struct comp_target *ct, VkQueue queue, uint32_t index, uint64_t timeline_semaphore_value, uint64_t desired_present_time_ns, uint64_t present_slop_ns)
 
static bool comp_target_swapchain_check_ready (struct comp_target *ct)
 
static void comp_target_swapchain_calc_frame_pacing (struct comp_target *ct, int64_t *out_frame_id, uint64_t *out_wake_up_time_ns, uint64_t *out_desired_present_time_ns, uint64_t *out_present_slop_ns, uint64_t *out_predicted_display_time_ns)
 
static void comp_target_swapchain_mark_timing_point (struct comp_target *ct, enum comp_target_timing_point point, int64_t frame_id, uint64_t when_ns)
 
static VkResult comp_target_swapchain_update_timings (struct comp_target *ct)
 
static void comp_target_swapchain_info_gpu (struct comp_target *ct, int64_t frame_id, uint64_t gpu_start_ns, uint64_t gpu_end_ns, uint64_t when_ns)
 
void comp_target_swapchain_override_extents (struct comp_target_swapchain *cts, VkExtent2D extent)
 
void comp_target_swapchain_cleanup (struct comp_target_swapchain *cts)
 
void comp_target_swapchain_init_and_set_fnptrs (struct comp_target_swapchain *cts, enum comp_target_display_timing_usage timing_usage)
 

Detailed Description

Function Documentation

◆ comp_target_swapchain_acquire_next_image()

static VkResult comp_target_swapchain_acquire_next_image ( struct comp_target ct,
uint32_t *  out_index 
)
static
Todo:
what error to return here?