vulkan: Allow storage images in the WSI.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 20 Nov 2018 20:57:27 +0000 (21:57 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 21 Nov 2018 20:36:55 +0000 (21:36 +0100)
Since apps also have to follow the ImageFormatProperties query,
we can disallow formats that don't allow image stores (for AMD
that would be SRGB formats).

Note that this only affects anything if the app actually decides
to use the flag.

Had someone ask for this on IRC and at least on the AMD side we
can support it.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/vulkan/wsi/wsi_common_display.c
src/vulkan/wsi/wsi_common_wayland.c
src/vulkan/wsi/wsi_common_x11.c

index fd0d30ad80ca3587fe2a2fa8c26c6e5d21475161..edfb166fa69b22449ff6b9b9dda2aeb737157fce 100644 (file)
@@ -834,6 +834,7 @@ wsi_display_surface_get_capabilities(VkIcdSurfaceBase *surface_base,
       VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
       VK_IMAGE_USAGE_SAMPLED_BIT |
       VK_IMAGE_USAGE_TRANSFER_DST_BIT |
+      VK_IMAGE_USAGE_STORAGE_BIT |
       VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
 
    return VK_SUCCESS;
index 3d3a60167bfa7a6ba699c242a0f69795b51f7438..c0132566eadc11ee5933bf417dd1a03a472d0bd7 100644 (file)
@@ -508,6 +508,7 @@ wsi_wl_surface_get_capabilities(VkIcdSurfaceBase *surface,
       VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
       VK_IMAGE_USAGE_SAMPLED_BIT |
       VK_IMAGE_USAGE_TRANSFER_DST_BIT |
+      VK_IMAGE_USAGE_STORAGE_BIT |
       VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
 
    return VK_SUCCESS;
index c740726fe54746f8bfc3bb1e0273f00d3695765d..6146c8f3da85d3e85f6981ad0b06cae24dfc7a72 100644 (file)
@@ -515,6 +515,7 @@ x11_surface_get_capabilities(VkIcdSurfaceBase *icd_surface,
       VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
       VK_IMAGE_USAGE_SAMPLED_BIT |
       VK_IMAGE_USAGE_TRANSFER_DST_BIT |
+      VK_IMAGE_USAGE_STORAGE_BIT |
       VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
 
    return VK_SUCCESS;