vulkan/wsi/display: Split image creation
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>
This commit is contained in:
parent
b626a5be43
commit
d95e3fd98c
|
@ -1056,9 +1056,8 @@ wsi_display_image_init(VkDevice device_h,
|
|||
if (drm_format == 0)
|
||||
return VK_ERROR_DEVICE_LOST;
|
||||
|
||||
VkResult result = wsi_create_native_image(&chain->base, create_info,
|
||||
0, NULL, NULL, NULL,
|
||||
&image->base);
|
||||
VkResult result = wsi_create_image(&chain->base, &chain->base.image_info,
|
||||
&image->base);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
|
@ -1132,6 +1131,7 @@ wsi_display_swapchain_destroy(struct wsi_swapchain *drv_chain,
|
|||
|
||||
for (uint32_t i = 0; i < chain->base.image_count; i++)
|
||||
wsi_display_image_finish(drv_chain, allocator, &chain->images[i]);
|
||||
wsi_destroy_image_info(&chain->base, &chain->base.image_info);
|
||||
|
||||
wsi_swapchain_finish(&chain->base);
|
||||
vk_free(allocator, chain);
|
||||
|
@ -1937,6 +1937,15 @@ wsi_display_surface_create_swapchain(
|
|||
|
||||
chain->surface = (VkIcdSurfaceDisplay *) icd_surface;
|
||||
|
||||
result = wsi_configure_native_image(&chain->base, create_info,
|
||||
0, NULL, NULL,
|
||||
NULL /* alloc_shm */,
|
||||
&chain->base.image_info);
|
||||
if (result != VK_SUCCESS) {
|
||||
vk_free(allocator, chain);
|
||||
goto fail_init_images;
|
||||
}
|
||||
|
||||
for (uint32_t image = 0; image < chain->base.image_count; image++) {
|
||||
result = wsi_display_image_init(device, &chain->base,
|
||||
create_info, allocator,
|
||||
|
@ -1947,6 +1956,7 @@ wsi_display_surface_create_swapchain(
|
|||
wsi_display_image_finish(&chain->base, allocator,
|
||||
&chain->images[image]);
|
||||
}
|
||||
wsi_destroy_image_info(&chain->base, &chain->base.image_info);
|
||||
vk_free(allocator, chain);
|
||||
goto fail_init_images;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue