zink: fix rendering to 3D-textures
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 16 Jul 2019 15:16:09 +0000 (17:16 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:47 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_resource.c
src/gallium/drivers/zink/zink_surface.c

index 8726427b66cb76e067d73067075c86daad0065da..2fd63060aeac0fd380e46ae7292640713c68492f 100644 (file)
@@ -160,6 +160,8 @@ zink_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;
          break;
 
       case PIPE_BUFFER:
index dc0c0b3ce0a31cfd613455085203256d0f88bf3a..0b480643b1b3303ecb560aa6c1f070a6ed375554 100644 (file)
@@ -86,7 +86,7 @@ zink_create_surface(struct pipe_context *pctx,
       break;
 
    case PIPE_TEXTURE_3D:
-      ivci.viewType = VK_IMAGE_VIEW_TYPE_3D;
+      ivci.viewType = VK_IMAGE_VIEW_TYPE_2D;
       break;
 
    default: