summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-05-16 10:19:20 -0700
committerJason Ekstrand <[email protected]>2016-05-17 12:17:22 -0700
commit263a8cb52de2ef36a54b00cb1a31738ea09a0ac8 (patch)
tree6f6678ba989a36b607fd927bc1fd6e4286dee494
parenteb6baa31746b55d48892b0c57f0e0076b91efdeb (diff)
anv/wayland: Don't allow non-renderable formats
-rw-r--r--src/intel/vulkan/anv_wsi_wayland.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_wsi_wayland.c b/src/intel/vulkan/anv_wsi_wayland.c
index 0c21029a56d..08eeda0a038 100644
--- a/src/intel/vulkan/anv_wsi_wayland.c
+++ b/src/intel/vulkan/anv_wsi_wayland.c
@@ -31,6 +31,7 @@
#define MIN_NUM_IMAGES 2
struct wsi_wl_display {
+ struct anv_physical_device *physical_device;
struct wl_display * display;
struct wl_drm * drm;
@@ -59,11 +60,12 @@ wsi_wl_display_add_vk_format(struct wsi_wl_display *display, VkFormat format)
if (*f == format)
return;
- /* Don't add formats which aren't supported by the driver */
- if (anv_format_for_vk_format(format)->isl_format ==
- ISL_FORMAT_UNSUPPORTED) {
+ /* Don't add formats that aren't renderable. */
+ VkFormatProperties props;
+ anv_GetPhysicalDeviceFormatProperties(
+ anv_physical_device_to_handle(display->physical_device), format, &props);
+ if (!(props.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT))
return;
- }
f = anv_vector_add(&display->formats);
if (f)
@@ -241,6 +243,7 @@ wsi_wl_display_create(struct wsi_wayland *wsi, struct wl_display *wl_display)
memset(display, 0, sizeof(*display));
display->display = wl_display;
+ display->physical_device = wsi->physical_device;
if (!anv_vector_init(&display->formats, sizeof(VkFormat), 8))
goto fail;