mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-27 09:01:46 +00:00
435d5a9b9e
Instead of maintaining this chunk of code and build options, the Vulkan loader can be used to load up validation. This has the advantage that no layer name needs to be hard coded inside Monado, which was subject of change recently. Instead of using our own environment variable we can easily set the one from the loader, e.g. `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`.
116 lines
2.2 KiB
C
116 lines
2.2 KiB
C
// 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>
|
|
* @ingroup comp_main
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "xrt/xrt_device.h"
|
|
#include "xrt/xrt_compositor.h"
|
|
#include "xrt/xrt_vulkan_includes.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
/*!
|
|
* 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",
|
|
"HTC Corporation VIVE Pro",
|
|
"Oculus VR Inc. Rift", /* Matches DK1, DK2 and CV1 */
|
|
"Valve Corporation Index HMD",
|
|
};
|
|
|
|
/*!
|
|
* Window type to use.
|
|
*
|
|
* @ingroup comp_main
|
|
*/
|
|
enum window_type
|
|
{
|
|
WINDOW_NONE = 0,
|
|
WINDOW_AUTO,
|
|
WINDOW_XCB,
|
|
WINDOW_WAYLAND,
|
|
WINDOW_DIRECT_RANDR,
|
|
WINDOW_DIRECT_NVIDIA,
|
|
};
|
|
|
|
|
|
/*!
|
|
* Settings for the compositor.
|
|
*
|
|
* @ingroup comp_main
|
|
*/
|
|
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;
|
|
|
|
struct
|
|
{
|
|
//! Display wireframe instead of solid triangles.
|
|
bool wireframe;
|
|
} debug;
|
|
|
|
//! Not used with direct mode.
|
|
bool fullscreen;
|
|
|
|
//! Should we debug print a lot!
|
|
bool print_spew;
|
|
|
|
//! Should we debug print.
|
|
bool print_debug;
|
|
|
|
//! Print information about available modes for direct mode.
|
|
bool print_modes;
|
|
|
|
//! Should we flip y axis for compositor buffers (for GL)
|
|
bool flip_y;
|
|
|
|
//! Nominal frame interval
|
|
uint64_t nominal_frame_interval_ns;
|
|
|
|
//! Run the compositor on this Vulkan physical device
|
|
int gpu_index;
|
|
|
|
//! Try to choose the mode with this index for direct mode
|
|
int desired_mode;
|
|
};
|
|
|
|
/*!
|
|
* Initialize the settings struct with either defaults or loaded setting.
|
|
*
|
|
* @ingroup comp_main
|
|
*/
|
|
void
|
|
comp_settings_init(struct comp_settings *s, struct xrt_device *xdev);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|