2019-03-18 05:52:32 +00:00
|
|
|
// Copyright 2019, Collabora, Ltd.
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
|
|
/*!
|
|
|
|
* @file
|
|
|
|
* @brief Settings struct for compositor header.
|
|
|
|
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
|
|
|
|
* @author Jakob Bornecrantz <jakob@collabora.com>
|
2020-03-01 10:31:21 +00:00
|
|
|
* @ingroup comp_main
|
2019-03-18 05:52:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "xrt/xrt_device.h"
|
|
|
|
#include "xrt/xrt_compositor.h"
|
|
|
|
#include "xrt/xrt_vulkan_includes.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 21:37:34 +00:00
|
|
|
|
2019-04-03 16:24:06 +00:00
|
|
|
/*!
|
|
|
|
* Since NVidia direct mode lets us 'acquire' any display, we need to
|
|
|
|
* be careful about which displays we attempt to acquire.
|
|
|
|
* We may wish to allow user configuration to extend this list.
|
|
|
|
*/
|
|
|
|
XRT_MAYBE_UNUSED static const char *NV_DIRECT_WHITELIST[] = {
|
|
|
|
"Sony SIE HMD *08",
|
|
|
|
"HTC Corporation HTC-VIVE",
|
2020-04-03 15:25:19 +00:00
|
|
|
"HTC Corporation VIVE Pro",
|
|
|
|
"Oculus VR Inc. Rift", /* Matches DK1, DK2 and CV1 */
|
|
|
|
"Valve Corporation Index HMD",
|
2019-04-03 16:24:06 +00:00
|
|
|
};
|
2019-03-18 05:52:32 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* Window type to use.
|
|
|
|
*
|
2020-03-01 10:31:21 +00:00
|
|
|
* @ingroup comp_main
|
2019-03-18 05:52:32 +00:00
|
|
|
*/
|
|
|
|
enum window_type
|
|
|
|
{
|
|
|
|
WINDOW_NONE = 0,
|
|
|
|
WINDOW_AUTO,
|
|
|
|
WINDOW_XCB,
|
|
|
|
WINDOW_WAYLAND,
|
2019-03-31 21:37:34 +00:00
|
|
|
WINDOW_DIRECT_RANDR,
|
|
|
|
WINDOW_DIRECT_NVIDIA,
|
2019-03-18 05:52:32 +00:00
|
|
|
};
|
|
|
|
|
2019-03-31 21:37:34 +00:00
|
|
|
|
2019-03-18 05:52:32 +00:00
|
|
|
/*!
|
|
|
|
* Settings for the compositor.
|
|
|
|
*
|
2020-03-01 10:31:21 +00:00
|
|
|
* @ingroup comp_main
|
2019-03-18 05:52:32 +00:00
|
|
|
*/
|
|
|
|
struct comp_settings
|
|
|
|
{
|
|
|
|
int display;
|
|
|
|
|
|
|
|
VkFormat color_format;
|
|
|
|
VkColorSpaceKHR color_space;
|
|
|
|
VkPresentModeKHR present_mode;
|
|
|
|
|
|
|
|
//! Window type to use.
|
|
|
|
enum window_type window_type;
|
|
|
|
|
|
|
|
//! Distortion type to use.
|
|
|
|
enum xrt_distortion_model distortion_model;
|
|
|
|
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
|
2020-01-25 20:19:13 +00:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
//! Display wireframe instead of solid triangles.
|
|
|
|
bool wireframe;
|
|
|
|
} debug;
|
|
|
|
|
2019-03-18 05:52:32 +00:00
|
|
|
//! Not used with direct mode.
|
|
|
|
bool fullscreen;
|
|
|
|
|
|
|
|
//! Should we debug print a lot!
|
|
|
|
bool print_spew;
|
|
|
|
|
|
|
|
//! Should we debug print.
|
|
|
|
bool print_debug;
|
|
|
|
|
2020-02-15 01:53:03 +00:00
|
|
|
//! Print information about available modes for direct mode.
|
|
|
|
bool print_modes;
|
|
|
|
|
2019-03-18 03:28:09 +00:00
|
|
|
//! Nominal frame interval
|
|
|
|
uint64_t nominal_frame_interval_ns;
|
2019-03-26 10:07:11 +00:00
|
|
|
|
2019-10-25 19:05:06 +00:00
|
|
|
//! Run the compositor on this Vulkan physical device
|
|
|
|
int gpu_index;
|
2020-02-15 02:02:11 +00:00
|
|
|
|
|
|
|
//! Try to choose the mode with this index for direct mode
|
|
|
|
int desired_mode;
|
2019-03-18 05:52:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Initialize the settings struct with either defaults or loaded setting.
|
|
|
|
*
|
2020-03-01 10:31:21 +00:00
|
|
|
* @ingroup comp_main
|
2019-03-18 05:52:32 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
comp_settings_init(struct comp_settings *s, struct xrt_device *xdev);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|