mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-29 16:05:59 +01:00
render/vulkan: use correct source offset in read_pixels
This commit is contained in:
parent
9c7db7124e
commit
10e16db738
1 changed files with 9 additions and 7 deletions
|
@ -1541,11 +1541,6 @@ static bool vulkan_read_pixels(struct wlr_renderer *wlr_renderer,
|
||||||
VK_ACCESS_TRANSFER_READ_BIT);
|
VK_ACCESS_TRANSFER_READ_BIT);
|
||||||
|
|
||||||
if (blit_supported) {
|
if (blit_supported) {
|
||||||
VkOffset3D blit_size = {
|
|
||||||
.x = width,
|
|
||||||
.y = height,
|
|
||||||
.z = 1
|
|
||||||
};
|
|
||||||
VkImageBlit image_blit_region = {
|
VkImageBlit image_blit_region = {
|
||||||
.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||||
.srcSubresource.layerCount = 1,
|
.srcSubresource.layerCount = 1,
|
||||||
|
@ -1553,10 +1548,17 @@ static bool vulkan_read_pixels(struct wlr_renderer *wlr_renderer,
|
||||||
.x = src_x,
|
.x = src_x,
|
||||||
.y = src_y,
|
.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.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||||
.dstSubresource.layerCount = 1,
|
.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,
|
vkCmdBlitImage(cb, src_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
||||||
dst_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
dst_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||||
|
|
Loading…
Reference in a new issue