zink: always allow transfer to/from buffers
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 8 Nov 2019 11:54:09 +0000 (12:54 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 12 Nov 2019 12:40:49 +0000 (12:40 +0000)
src/gallium/drivers/zink/zink_resource.c

index 2785b986b3082c9fe44ec765490afd887967f3d8..b8af12ed5f4e02cd0cac1154ce9b56e30e487280 100644 (file)
@@ -104,7 +104,8 @@ resource_create(struct pipe_screen *pscreen,
       bci.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
       bci.size = templ->width0;
 
-      bci.usage = 0;
+      bci.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT |
+                  VK_BUFFER_USAGE_TRANSFER_DST_BIT;
 
       if (templ->bind & PIPE_BIND_VERTEX_BUFFER)
          bci.usage |= VK_BUFFER_USAGE_VERTEX_BUFFER_BIT;
@@ -121,9 +122,6 @@ resource_create(struct pipe_screen *pscreen,
       if (templ->bind & PIPE_BIND_COMMAND_ARGS_BUFFER)
          bci.usage |= VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT;
 
-      if (templ->usage == PIPE_USAGE_STAGING)
-         bci.usage |= VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
-
       if (vkCreateBuffer(screen->dev, &bci, NULL, &res->buffer) !=
           VK_SUCCESS) {
          FREE(res);