diff options
author | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2023-03-22 23:01:10 -0300 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2023-04-03 10:59:45 -0300 |
commit | 57587c00b493b2a2cf3ce3d4d5064fb4cda14c39 (patch) | |
tree | 469a0b12d96813f972a02b890ec3ff0323e14f7e | |
parent | 724d07ef8a4a5150640acdc164d933487bbab9c5 (diff) | |
download | gtk+-57587c00b493b2a2cf3ce3d4d5064fb4cda14c39.tar.gz |
gsk/vulkanimage: Set buffer row length and height
This doesn't make any difference now, but will allow us to copy
subregions more easily. This is not obvious, but here's a quick
explanation:
Leaving 'bufferRowLength' and 'bufferImageHeight' implies that
Vulkan will assume the size passed in the 'imageExtent' field.
Right now, this assumption is correct - the only user of this
function is the glyph cache, and it only copies and uploads
exact rects. Next commits will change that assumption, so we
must pass 'buffer*' fields, and tell Vulkan, "this part of the
buffer represents an image of width x height, and I want the
subregion (x, y, smallerWidth, smallerHeight) of this image".
-rw-r--r-- | gsk/vulkan/gskvulkanimage.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gsk/vulkan/gskvulkanimage.c b/gsk/vulkan/gskvulkanimage.c index 102d5281bc..075e2501f4 100644 --- a/gsk/vulkan/gskvulkanimage.c +++ b/gsk/vulkan/gskvulkanimage.c @@ -722,6 +722,8 @@ gsk_vulkan_image_upload_regions (GskVulkanImage *self, } bufferImageCopy[i].bufferOffset = offset; + bufferImageCopy[i].bufferRowLength = regions[i].width; + bufferImageCopy[i].bufferImageHeight = regions[i].height; bufferImageCopy[i].imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; bufferImageCopy[i].imageSubresource.mipLevel = 0; bufferImageCopy[i].imageSubresource.baseArrayLayer = 0; |