From 9fc179c774502d083dfab7385484fddc75d90f21 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 4 Feb 2021 10:42:22 +0100 Subject: [PATCH] zink: don't always require linear display-targets We only need these display-targets to be linear in the case of a software winsys. In the DRM case, they can be tiled without issues. Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_resource.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index 867e1ae49ab..490ab36c84f 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -217,15 +217,16 @@ resource_create(struct pipe_screen *pscreen, templ->target == PIPE_TEXTURE_CUBE_ARRAY) ici.arrayLayers *= 6; - if (templ->bind & (PIPE_BIND_DISPLAY_TARGET | - PIPE_BIND_SHARED)) { + if (screen->winsys && templ->bind & PIPE_BIND_DISPLAY_TARGET) ici.tiling = VK_IMAGE_TILING_LINEAR; - } if (templ->bind & PIPE_BIND_SHARED) { emici.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO; emici.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; ici.pNext = &emici; + + /* TODO: deal with DRM modifiers here */ + ici.tiling = VK_IMAGE_TILING_LINEAR; } if (templ->usage == PIPE_USAGE_STAGING)