Module: Mesa
Branch: master
Commit: 9fc179c774502d083dfab7385484fddc75d90f21
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9fc179c774502d083dfab7385484fddc75d90f21

Author: Erik Faye-Lund <[email protected]>
Date:   Thu Feb  4 10:42:22 2021 +0100

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8858>

---

 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)

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to