From: Taekyun Kim Date: Thu, 14 Apr 2016 07:52:19 +0000 (+0900) Subject: swapchain: Create VkImage using ICD provided function X-Git-Tag: submit/submit/tizen/20170906.070327/20170906.070422~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=293a28ca174010ef442c9c1afb8791e27d38ddaf;p=platform%2Fcore%2Fuifw%2Fvulkan-wsi-tizen.git swapchain: Create VkImage using ICD provided function Change-Id: I240be8b23ae05b31718528a21befb2d85c4c1ba6 --- diff --git a/src/wsi/swapchain.c b/src/wsi/swapchain.c index 566ff42..d39c489 100644 --- a/src/wsi/swapchain.c +++ b/src/wsi/swapchain.c @@ -84,10 +84,26 @@ vk_CreateSwapchainKHR(VkDevice device, VK_CHECK(chain->buffers, return VK_ERROR_OUT_OF_HOST_MEMORY, "vk_alloc() failed.\n"); for (i = 0; i < buffer_count; i++) { - chain->buffers[i].tbm = buffers[i]; + VkImageCreateInfo image_info = { + VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, + NULL, + 0, + VK_IMAGE_TYPE_2D, + info->imageFormat, + { info->imageExtent.width, info->imageExtent.height, 0 }, + 0, + 0, + 0, + VK_IMAGE_TILING_LINEAR, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, + VK_SHARING_MODE_EXCLUSIVE, + 0, + NULL, + VK_IMAGE_LAYOUT_UNDEFINED, + }; - /* TODO: Create VkImage from tbm_surface_h. */ - chain->buffers[i].image = (VkImage)buffers[i]; + chain->buffers[i].tbm = buffers[i]; + chain->buffers[i].image = vk_icd_create_presentable_image(device, &image_info, buffers[i]); } *swapchain = (VkSwapchainKHR)chain;