aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorllyyr <llyyr.public@gmail.com>2023-01-18 06:12:43 +0530
committerllyyr <llyyr.public@gmail.com>2023-01-18 06:56:49 +0530
commit10e16db73879d42cd8f381cc54eb990ace3d9219 (patch)
tree8712b8fc98123c87b89887407fb023f7b68935b9 /render
parent9c7db7124edea044a89c5872742f8bd09adb1140 (diff)
render/vulkan: use correct source offset in read_pixels
Diffstat (limited to 'render')
-rw-r--r--render/vulkan/renderer.c16
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,