diff options
author | llyyr <llyyr.public@gmail.com> | 2023-01-18 06:12:43 +0530 |
---|---|---|
committer | llyyr <llyyr.public@gmail.com> | 2023-01-18 06:56:49 +0530 |
commit | 10e16db73879d42cd8f381cc54eb990ace3d9219 (patch) | |
tree | 8712b8fc98123c87b89887407fb023f7b68935b9 /render | |
parent | 9c7db7124edea044a89c5872742f8bd09adb1140 (diff) |
render/vulkan: use correct source offset in read_pixels
Diffstat (limited to 'render')
-rw-r--r-- | render/vulkan/renderer.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c index dfdc13cd..564da5d1 100644 --- a/render/vulkan/renderer.c +++ b/render/vulkan/renderer.c @@ -1541,11 +1541,6 @@ static bool vulkan_read_pixels(struct wlr_renderer *wlr_renderer, VK_ACCESS_TRANSFER_READ_BIT); if (blit_supported) { - VkOffset3D blit_size = { - .x = width, - .y = height, - .z = 1 - }; VkImageBlit image_blit_region = { .srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, .srcSubresource.layerCount = 1, @@ -1553,10 +1548,17 @@ static bool vulkan_read_pixels(struct wlr_renderer *wlr_renderer, .x = src_x, .y = src_y, }, - .srcOffsets[1] = blit_size, + .srcOffsets[1] = { + .x = src_x + width, + .y = src_y + height, + }, .dstSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, .dstSubresource.layerCount = 1, - .dstOffsets[1] = blit_size + .dstOffsets[1] = { + .x = width, + .y = height, + .z = 1, + } }; vkCmdBlitImage(cb, src_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, dst_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, |