Mesa (staging/19.3): zink: always allow mutating the format

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 11 19:45:53 UTC 2019


Module: Mesa
Branch: staging/19.3
Commit: b90f5a9ea024173d4951aba1eea4c8b73d3147d5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b90f5a9ea024173d4951aba1eea4c8b73d3147d5

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Tue Oct 29 23:19:53 2019 +0100

zink: always allow mutating the format

There's no good way to know if a texture-view will be created, so we
just have to accept it for all resources.

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Fixes: 8d46e35d16e ("zink: introduce opengl over vulkan")
(cherry picked from commit ca87a53b4661ae15d0c26d2ef0dbdc5a7009dee6)

---

 src/gallium/drivers/zink/zink_resource.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 0051c891d57..09d84ba71a5 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -137,6 +137,7 @@ resource_create(struct pipe_screen *pscreen,
 
       VkImageCreateInfo ici = {};
       ici.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
+      ici.flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
 
       switch (templ->target) {
       case PIPE_TEXTURE_1D:
@@ -146,7 +147,7 @@ resource_create(struct pipe_screen *pscreen,
 
       case PIPE_TEXTURE_CUBE:
       case PIPE_TEXTURE_CUBE_ARRAY:
-         ici.flags = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
+         ici.flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
          /* fall-through */
       case PIPE_TEXTURE_2D:
       case PIPE_TEXTURE_2D_ARRAY:
@@ -157,7 +158,7 @@ resource_create(struct pipe_screen *pscreen,
       case PIPE_TEXTURE_3D:
          ici.imageType = VK_IMAGE_TYPE_3D;
          if (templ->bind & PIPE_BIND_RENDER_TARGET)
-            ici.flags = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT;
+            ici.flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT;
          break;
 
       case PIPE_BUFFER:




More information about the mesa-commit mailing list