};
static VkResult
-wsi_wl_image_init(struct wsi_wl_swapchain *chain, struct wsi_wl_image *image,
+wsi_wl_image_init(struct wsi_wl_swapchain *chain,
+ struct wsi_wl_image *image,
+ const VkSwapchainCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks* pAllocator)
{
VkDevice vk_device = anv_device_to_handle(chain->base.device);
.samples = 1,
/* FIXME: Need a way to use X tiling to allow scanout */
.tiling = VK_IMAGE_TILING_OPTIMAL,
- .usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
+ .usage = (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
+ pCreateInfo->imageUsage),
.flags = 0,
}},
pAllocator,
}
for (uint32_t i = 0; i < chain->image_count; i++) {
- result = wsi_wl_image_init(chain, &chain->images[i], pAllocator);
+ result = wsi_wl_image_init(chain, &chain->images[i],
+ pCreateInfo, pAllocator);
if (result != VK_SUCCESS)
goto fail;
chain->images[i].busy = false;
.samples = 1,
/* FIXME: Need a way to use X tiling to allow scanout */
.tiling = VK_IMAGE_TILING_OPTIMAL,
- .usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
+ .usage = (pCreateInfo->imageUsage |
+ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT),
.flags = 0,
}},
NULL,