monado/src/xrt/compositor/client/comp_vk_client.h
Ryan Pavlik f3eac87504 xrt: Correct usage of XRT_MAYBE_UNUSED on functions.
It shouldn't be used on a function marked "static inline" - that's
sufficient to avoid the warning. So, it should almost never be in
a header.
2020-03-04 11:15:35 +00:00

104 lines
2 KiB
C

// Copyright 2019, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Vulkan client side glue to compositor header.
* @author Jakob Bornecrantz <jakob@collabora.com>
* @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
* @ingroup comp_client
*/
#pragma once
#include "vk/vk_helpers.h"
#include "xrt/xrt_gfx_vk.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
*
* Structs
*
*/
struct client_vk_compositor;
/*!
* Wraps the real compositor swapchain providing a Vulkan based interface.
*
* Almost a one to one mapping to a OpenXR swapchain.
*
* @ingroup comp_client
*/
struct client_vk_swapchain
{
struct xrt_swapchain_vk base;
struct xrt_swapchain_fd *xscfd;
struct client_vk_compositor *c;
};
/*!
* Wraps the real compositor providing a Vulkan based interface.
*
* @ingroup comp_client
*/
struct client_vk_compositor
{
struct xrt_compositor_vk base;
struct xrt_compositor_fd *xcfd;
struct vk_bundle vk;
};
/*
*
* Functions and helpers.
*
*/
/*!
* Convinence function to convert a xrt_swapchain to a client_vk_swapchain.
*
* @ingroup comp_client
*/
static inline struct client_vk_swapchain *
client_vk_swapchain(struct xrt_swapchain *xsc)
{
return (struct client_vk_swapchain *)xsc;
}
/*!
* Convinence function to convert a xrt_compositor to a client_vk_compositor.
*
* @ingroup comp_client
*/
static inline struct client_vk_compositor *
client_vk_compositor(struct xrt_compositor *xc)
{
return (struct client_vk_compositor *)xc;
}
/*!
* Create a new client_vk_compositor.
*
* @ingroup comp_client
*/
struct client_vk_compositor *
client_vk_compositor_create(struct xrt_compositor_fd *xcfd,
VkInstance instance,
PFN_vkGetInstanceProcAddr getProc,
VkPhysicalDevice physicalDevice,
VkDevice device,
uint32_t queueFamilyIndex,
uint32_t queueIndex);
#ifdef __cplusplus
}
#endif