aboutsummaryrefslogtreecommitdiff
path: root/render/vulkan/texture.c
diff options
context:
space:
mode:
authorManuel Stoeckl <code@mstoeckl.com>2022-11-25 12:28:43 -0500
committerManuel Stoeckl <code@mstoeckl.com>2022-11-25 12:29:02 -0500
commitc02872e033b431d9f02a240abeebdf0aaa043ea6 (patch)
tree2f02aec2f6eb51ce636f3836e020579937d44c2d /render/vulkan/texture.c
parentf0375eed24276e27e036f724c9fde5d344fc140a (diff)
render/vulkan: align staging buffers for texture upload
vkCmdCopyBufferToImage requires that the buffer offset be a multiple of the texel block size, which for single plane uncompressed formats is the same as the number of bytes per pixel. This commit adds an alignment parameter to vulkan_get_stage_span which ensures that the provided span (and the sequence of image copy operations derived which use it) have this alignment.
Diffstat (limited to 'render/vulkan/texture.c')
-rw-r--r--render/vulkan/texture.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/render/vulkan/texture.c b/render/vulkan/texture.c
index 45e3fec9..9437cafc 100644
--- a/render/vulkan/texture.c
+++ b/render/vulkan/texture.c
@@ -73,7 +73,7 @@ static bool write_pixels(struct wlr_vk_texture *texture,
}
// get staging buffer
- struct wlr_vk_buffer_span span = vulkan_get_stage_span(renderer, bsize);
+ struct wlr_vk_buffer_span span = vulkan_get_stage_span(renderer, bsize, bytespb);
if (!span.buffer || span.alloc.size != bsize) {
wlr_log(WLR_ERROR, "Failed to retrieve staging buffer");
free(copies);