aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_wsi_x11.c
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2016-07-04 18:06:58 +0100
committerJason Ekstrand <[email protected]>2016-07-04 10:15:48 -0700
commitdbbc4fb4cc8792fa25125a9c828b649d61113362 (patch)
tree04e718150eece7f160df43bb668158e190a8b099 /src/intel/vulkan/anv_wsi_x11.c
parent51227b41c6b026f5b0a3925093b91800cdfcc923 (diff)
anv/wsi: create swapchain images using specified image usage
The image usage specified by the caller of vkCreateSwapchainKHR should be passed onto the internal image creation. Otherwise the driver might later crash when the user tries to use the image as a combined sampler even though the creation was explicitly created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT. Leaving the previous VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT as this might be expected even if the swapchain is created without any flag. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96791 Cc: "12.0" <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_wsi_x11.c')
-rw-r--r--src/intel/vulkan/anv_wsi_x11.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_wsi_x11.c b/src/intel/vulkan/anv_wsi_x11.c
index d1e23a65d98..2895d6b7cfe 100644
--- a/src/intel/vulkan/anv_wsi_x11.c
+++ b/src/intel/vulkan/anv_wsi_x11.c
@@ -606,7 +606,8 @@ x11_image_init(struct anv_device *device, struct x11_swapchain *chain,
.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,