mesa/src/virtio/vulkan/vn_wsi.h

91 lines
2.2 KiB
C

/*
* Copyright 2019 Google LLC
* SPDX-License-Identifier: MIT
*
* based in part on anv and radv which are:
* Copyright © 2015 Intel Corporation
* Copyright © 2016 Red Hat.
* Copyright © 2016 Bas Nieuwenhuizen
*/
#ifndef VN_WSI_H
#define VN_WSI_H
#include "vn_common.h"
#include "wsi_common.h"
#ifdef VN_USE_WSI_PLATFORM
VkResult
vn_wsi_init(struct vn_physical_device *physical_dev);
void
vn_wsi_fini(struct vn_physical_device *physical_dev);
static inline const struct wsi_image_create_info *
vn_wsi_find_wsi_image_create_info(const VkImageCreateInfo *create_info)
{
return vk_find_struct_const(create_info->pNext,
WSI_IMAGE_CREATE_INFO_MESA);
}
VkResult
vn_wsi_create_image(struct vn_device *dev,
const VkImageCreateInfo *create_info,
const struct wsi_image_create_info *wsi_info,
const VkAllocationCallbacks *alloc,
struct vn_image **out_img);
VkResult
vn_wsi_create_image_from_swapchain(
struct vn_device *dev,
const VkImageCreateInfo *create_info,
const VkImageSwapchainCreateInfoKHR *swapchain_info,
const VkAllocationCallbacks *alloc,
struct vn_image **out_img);
#else
static inline VkResult
vn_wsi_init(UNUSED struct vn_physical_device *physical_dev)
{
return VK_SUCCESS;
}
static inline void
vn_wsi_fini(UNUSED struct vn_physical_device *physical_dev)
{
}
static inline const struct wsi_image_create_info *
vn_wsi_find_wsi_image_create_info(const VkImageCreateInfo *create_info)
{
return NULL;
}
static inline VkResult
vn_wsi_create_image(struct vn_device *dev,
const VkImageCreateInfo *create_info,
const struct wsi_image_create_info *wsi_info,
const VkAllocationCallbacks *alloc,
struct vn_image **out_img)
{
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
static inline VkResult
vn_wsi_create_image_from_swapchain(
struct vn_device *dev,
const VkImageCreateInfo *create_info,
const VkImageSwapchainCreateInfoKHR *swapchain_info,
const VkAllocationCallbacks *alloc,
struct vn_image **out_img)
{
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
#endif /* VN_USE_WSI_PLATFORM */
#endif /* VN_WSI_H */