Monado OpenXR Runtime
sdl_compositor.c File Reference

SDL compositor implementation. More...

#include "os/os_time.h"
#include "util/u_misc.h"
#include "util/u_time.h"
#include "util/u_debug.h"
#include "util/u_verify.h"
#include "util/u_handles.h"
#include "util/u_trace_marker.h"
#include "util/comp_vulkan.h"
#include "multi/comp_multi_interface.h"
#include "sdl_internal.h"
#include <stdio.h>
#include <stdarg.h>
Include dependency graph for sdl_compositor.c:

Macros

#define SC_TRACE(c, ...)   U_LOG_IFL_T(c->base.vk.log_level, __VA_ARGS__);
 
#define SC_DEBUG(c, ...)   U_LOG_IFL_D(c->base.vk.log_level, __VA_ARGS__);
 
#define SC_INFO(c, ...)   U_LOG_IFL_I(c->base.vk.log_level, __VA_ARGS__);
 
#define SC_WARN(c, ...)   U_LOG_IFL_W(c->base.vk.log_level, __VA_ARGS__);
 
#define SC_ERROR(c, ...)   U_LOG_IFL_E(c->base.vk.log_level, __VA_ARGS__);
 

Functions

static struct vk_bundleget_vk (struct sdl_compositor *c)
 
static VkResult select_instances_extensions (struct sdl_compositor *c, struct u_string_list *required, struct u_string_list *optional)
 
static bool compositor_init_vulkan (struct sdl_compositor *c, enum u_logging_level log_level)
 
static bool compositor_init_pacing (struct sdl_compositor *c)
 
static bool compositor_init_info (struct sdl_compositor *c)
 
static bool compositor_init_sys_info (struct sdl_compositor *c, struct sdl_program *sp, struct xrt_device *xdev)
 
static xrt_result_t sdl_compositor_begin_session (struct xrt_compositor *xc, const struct xrt_begin_session_info *info)
 
static xrt_result_t sdl_compositor_end_session (struct xrt_compositor *xc)
 
static xrt_result_t sdl_compositor_predict_frame (struct xrt_compositor *xc, int64_t *out_frame_id, int64_t *out_wake_time_ns, int64_t *out_predicted_gpu_time_ns, int64_t *out_predicted_display_time_ns, int64_t *out_predicted_display_period_ns)
 
static xrt_result_t sdl_compositor_mark_frame (struct xrt_compositor *xc, int64_t frame_id, enum xrt_compositor_frame_point point, int64_t when_ns)
 
static xrt_result_t sdl_compositor_begin_frame (struct xrt_compositor *xc, int64_t frame_id)
 
static xrt_result_t sdl_compositor_discard_frame (struct xrt_compositor *xc, int64_t frame_id)
 
static xrt_result_t sdl_compositor_layer_commit (struct xrt_compositor *xc, xrt_graphics_sync_handle_t sync_handle)
 
static void sdl_compositor_destroy (struct xrt_compositor *xc)
 
void sdl_compositor_init (struct sdl_program *sp)
 Initializes the compositor part of the SDL program. More...
 
xrt_result_t sdl_compositor_create_system (struct sdl_program *sp, struct xrt_system_compositor **out_xsysc)
 Creates the system compositor that wraps the native compositor. More...
 

Variables

static const char * instance_extensions_common []
 
static const char * required_device_extensions []
 
static const char * optional_device_extensions []
 

Detailed Description

Function Documentation

◆ sdl_compositor_create_system()

xrt_result_t sdl_compositor_create_system ( struct sdl_program sp,
struct xrt_system_compositor **  out_xsysc 
)

Creates the system compositor that wraps the native compositor.

◆ sdl_compositor_init()

void sdl_compositor_init ( struct sdl_program sp)

Initializes the compositor part of the SDL program.

References sdl_program::xdev_base.

Variable Documentation

◆ instance_extensions_common

const char* instance_extensions_common[]
static
Initial value:
= {
VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME,
VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME,
VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME,
VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME,
}