diff options
author | Simon Ser <contact@emersion.fr> | 2022-11-08 16:05:23 +0100 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-11-11 19:26:48 +0000 |
commit | e1ba64c4b769e265d96813e2f52060be79d10807 (patch) | |
tree | 0207184a66c73e9bf4bef04950853bfaf4f72298 /render/vulkan | |
parent | d112c2d9225031591ff94e89784e2fe6acebaeb2 (diff) |
render/vulkan: use initializer for VkBufferImageCopy
Missed that one it seems.
Diffstat (limited to 'render/vulkan')
-rw-r--r-- | render/vulkan/texture.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/render/vulkan/texture.c b/render/vulkan/texture.c index 5776233c..c636f9f5 100644 --- a/render/vulkan/texture.c +++ b/render/vulkan/texture.c @@ -105,24 +105,25 @@ static bool write_pixels(struct wlr_vk_texture *texture, } } - VkBufferImageCopy copy; - copy.imageExtent.width = width; - copy.imageExtent.height = height; - copy.imageExtent.depth = 1; - copy.imageOffset.x = dst_x; - copy.imageOffset.y = dst_y; - copy.imageOffset.z = 0; - copy.bufferOffset = buf_off; - copy.bufferRowLength = width; - copy.bufferImageHeight = height; - copy.imageSubresource.mipLevel = 0; - copy.imageSubresource.baseArrayLayer = 0; - copy.imageSubresource.layerCount = 1; - copy.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; - assert((uint32_t)(map - (char *)vmap) == bsize); vkUnmapMemory(dev, span.buffer->memory); + VkBufferImageCopy copy = { + .imageExtent.width = width, + .imageExtent.height = height, + .imageExtent.depth = 1, + .imageOffset.x = dst_x, + .imageOffset.y = dst_y, + .imageOffset.z = 0, + .bufferOffset = buf_off, + .bufferRowLength = width, + .bufferImageHeight = height, + .imageSubresource.mipLevel = 0, + .imageSubresource.baseArrayLayer = 0, + .imageSubresource.layerCount = 1, + .imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, + }; + vkCmdCopyBufferToImage(cb, span.buffer->buffer, texture->image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ©); vulkan_change_layout(cb, texture->image, |