panvk: Round FillBuffer sizes down to a multiple of 4

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16276>
This commit is contained in:
Jason Ekstrand 2022-05-04 09:50:30 -05:00 committed by Marge Bot
parent ad05bc9315
commit 5ef9bd5ff2
2 changed files with 11 additions and 0 deletions

View File

@ -11,6 +11,7 @@ include = [
"dEQP-VK.api.command_buffers.render_pass_continue",
"dEQP-VK.api.command_buffers.render_pass_continue_no_fb",
"dEQP-VK.api.copy_and_blit.core.*",
"dEQP-VK.api.fill_and_update_buffer.suballocation.*",
"dEQP-VK.binding_model.descriptor_copy.compute.*",
"dEQP-VK.compute.builtin_var.*",
"dEQP-VK.draw.renderpass.instanced.draw_indexed_vk_*",

View File

@ -2000,6 +2000,16 @@ panvk_meta_fill_buf(struct panvk_cmd_buffer *cmdbuf,
};
size = panvk_buffer_range(dst, offset, size);
/* From the Vulkan spec:
*
* "size is the number of bytes to fill, and must be either a multiple
* of 4, or VK_WHOLE_SIZE to fill the range from offset to the end of
* the buffer. If VK_WHOLE_SIZE is used and the remaining size of the
* buffer is not a multiple of 4, then the nearest smaller multiple is
* used."
*/
size &= ~3ull;
assert(!(offset & 3) && !(size & 3));
unsigned nwords = size / sizeof(uint32_t);