summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2015-10-06 18:34:37 -0700
committerChad Versace <[email protected]>2015-10-06 21:22:18 -0700
commitcf603714cb0e2e5c5dfe7309b8938c910933aafa (patch)
tree04535177e9f4153aa3a9f7355851a78ae68ef825
parentd00718104f956783291fbfc28f9d0a2e9bee4003 (diff)
vk/meta: Fix usage flags for image-wrapped-buffers
In make_image_for_buffer(), use VK_IMAGE_USAGE_SAMPLED_BIT when transferring from the buffer and use VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT when transferring to the buffer.
-rw-r--r--src/vulkan/anv_meta.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/vulkan/anv_meta.c b/src/vulkan/anv_meta.c
index 4abd8d38213..7646071276a 100644
--- a/src/vulkan/anv_meta.c
+++ b/src/vulkan/anv_meta.c
@@ -1304,6 +1304,7 @@ void anv_CmdBlitImage(
static VkImage
make_image_for_buffer(VkDevice vk_device, VkBuffer vk_buffer, VkFormat format,
+ VkImageUsageFlags usage,
const VkBufferImageCopy *copy)
{
ANV_FROM_HANDLE(anv_buffer, buffer, vk_buffer);
@@ -1326,7 +1327,7 @@ make_image_for_buffer(VkDevice vk_device, VkBuffer vk_buffer, VkFormat format,
.arraySize = 1,
.samples = 1,
.tiling = VK_IMAGE_TILING_LINEAR,
- .usage = VK_IMAGE_USAGE_SAMPLED_BIT,
+ .usage = usage,
.flags = 0,
}, &vk_image);
assert(result == VK_SUCCESS);
@@ -1368,8 +1369,7 @@ void anv_CmdCopyBufferToImage(
}
VkImage srcImage = make_image_for_buffer(vk_device, srcBuffer,
- proxy_format,
- &pRegions[r]);
+ proxy_format, VK_IMAGE_USAGE_SAMPLED_BIT, &pRegions[r]);
struct anv_image_view src_iview;
anv_image_view_init(&src_iview, cmd_buffer->device,
@@ -1490,8 +1490,7 @@ void anv_CmdCopyImageToBuffer(
}
VkImage destImage = make_image_for_buffer(vk_device, destBuffer,
- dest_format,
- &pRegions[r]);
+ dest_format, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, &pRegions[r]);
struct anv_image_view dest_iview;
anv_color_attachment_view_init(&dest_iview, cmd_buffer->device,