mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-11 01:15:30 +00:00
e745a28374
This commits lays the foundation for actions in Monado (input and output). There are lots of things missing and non-conformant in there. But once in more people then just me can test it out and work on it.
47 lines
1.2 KiB
C
47 lines
1.2 KiB
C
// Copyright 2018-2019, Collabora, Ltd.
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
/*!
|
|
* @file
|
|
* @brief Holds Vulkan specific session functions.
|
|
* @author Jakob Bornecrantz <jakob@collabora.com>
|
|
* @ingroup oxr_main
|
|
* @ingroup comp_client
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "util/u_misc.h"
|
|
|
|
#include "xrt/xrt_gfx_vk.h"
|
|
|
|
#include "oxr_objects.h"
|
|
#include "oxr_logger.h"
|
|
#include "oxr_two_call.h"
|
|
#include "oxr_handle.h"
|
|
|
|
|
|
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
|
|
vkGetInstanceProcAddr(VkInstance instance, const char *pName);
|
|
|
|
XrResult
|
|
oxr_session_populate_vk(struct oxr_logger *log,
|
|
struct oxr_system *sys,
|
|
XrGraphicsBindingVulkanKHR const *next,
|
|
struct oxr_session *sess)
|
|
{
|
|
struct xrt_compositor_vk *xcvk = xrt_gfx_vk_provider_create(
|
|
sys->head, sys->inst->timekeeping, next->instance,
|
|
vkGetInstanceProcAddr, next->physicalDevice, next->device,
|
|
next->queueFamilyIndex, next->queueIndex);
|
|
|
|
if (xcvk == NULL) {
|
|
return oxr_error(log, XR_ERROR_INITIALIZATION_FAILED,
|
|
" failed create a compositor");
|
|
}
|
|
|
|
sess->compositor = &xcvk->base;
|
|
sess->create_swapchain = oxr_swapchain_vk_create;
|
|
|
|
return XR_SUCCESS;
|
|
}
|