mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
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.
This commit is contained in:
parent
f0375eed24
commit
c02872e033
3 changed files with 10 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue