venus: remove redundant abstractions for wsi struct search
Doing that won't avoid linking wsi headers, and in fact we have already included both android and common wsi headers. For swapchain info, it's currently disabled by the swapchain spec version advertised on Android. Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
This commit is contained in:
@@ -22,12 +22,6 @@
|
||||
|
||||
#ifdef ANDROID
|
||||
|
||||
static inline const VkNativeBufferANDROID *
|
||||
vn_android_find_native_buffer(const VkImageCreateInfo *create_info)
|
||||
{
|
||||
return vk_find_struct_const(create_info->pNext, NATIVE_BUFFER_ANDROID);
|
||||
}
|
||||
|
||||
VkResult
|
||||
vn_android_image_from_anb(struct vn_device *dev,
|
||||
const VkImageCreateInfo *image_info,
|
||||
@@ -82,12 +76,6 @@ vn_android_gralloc_get_shared_present_usage(void);
|
||||
|
||||
#else
|
||||
|
||||
static inline const VkNativeBufferANDROID *
|
||||
vn_android_find_native_buffer(UNUSED const VkImageCreateInfo *create_info)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline VkResult
|
||||
vn_android_image_from_anb(UNUSED struct vn_device *dev,
|
||||
UNUSED const VkImageCreateInfo *image_info,
|
||||
|
||||
@@ -296,9 +296,9 @@ vn_CreateImage(VkDevice device,
|
||||
VkResult result;
|
||||
|
||||
const struct wsi_image_create_info *wsi_info =
|
||||
vn_wsi_find_wsi_image_create_info(pCreateInfo);
|
||||
vk_find_struct_const(pCreateInfo->pNext, WSI_IMAGE_CREATE_INFO_MESA);
|
||||
const VkNativeBufferANDROID *anb_info =
|
||||
vn_android_find_native_buffer(pCreateInfo);
|
||||
vk_find_struct_const(pCreateInfo->pNext, NATIVE_BUFFER_ANDROID);
|
||||
const VkExternalMemoryImageCreateInfo *external_info =
|
||||
vk_find_struct_const(pCreateInfo->pNext,
|
||||
EXTERNAL_MEMORY_IMAGE_CREATE_INFO);
|
||||
@@ -307,15 +307,10 @@ vn_CreateImage(VkDevice device,
|
||||
external_info->handleTypes ==
|
||||
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID;
|
||||
|
||||
#ifdef ANDROID
|
||||
/* VkImageSwapchainCreateInfoKHR is not useful at all */
|
||||
const VkImageSwapchainCreateInfoKHR *swapchain_info = NULL;
|
||||
#else
|
||||
const VkImageSwapchainCreateInfoKHR *swapchain_info = vk_find_struct_const(
|
||||
pCreateInfo->pNext, IMAGE_SWAPCHAIN_CREATE_INFO_KHR);
|
||||
if (swapchain_info && !swapchain_info->swapchain)
|
||||
swapchain_info = NULL;
|
||||
#endif
|
||||
|
||||
if (wsi_info) {
|
||||
result = vn_wsi_create_image(dev, pCreateInfo, wsi_info, alloc, &img);
|
||||
|
||||
@@ -23,13 +23,6 @@ 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,
|
||||
@@ -58,12 +51,6 @@ 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,
|
||||
|
||||
Reference in New Issue
Block a user