From 2ae97a4eb673243392b8566774e55a315abd1d38 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 6 Feb 2025 15:27:12 +0100 Subject: [PATCH] panvk: correct number of read bytes for dynamic buffers This function takes the number of bytes, not number of entries. This should hopefully fix start-up issues on Citra. While we're at it, fixup the alignment of the line that writes the bytes. Fixes: 27beadcbdb5 ("panvk: Extend the shader logic to support Valhall") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12539 Reviewed-by: Mary Guillemard Part-of: --- src/panfrost/vulkan/panvk_vX_shader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panfrost/vulkan/panvk_vX_shader.c b/src/panfrost/vulkan/panvk_vX_shader.c index 0350635e52f..ce223a145f6 100644 --- a/src/panfrost/vulkan/panvk_vX_shader.c +++ b/src/panfrost/vulkan/panvk_vX_shader.c @@ -1191,6 +1191,7 @@ shader_desc_info_deserialize(struct blob_reader *blob, #else shader->desc_info.dyn_bufs.count = blob_read_uint32(blob); blob_copy_bytes(blob, shader->desc_info.dyn_bufs.map, + sizeof(*shader->desc_info.dyn_bufs.map) * shader->desc_info.dyn_bufs.count); #endif @@ -1291,7 +1292,7 @@ shader_desc_info_serialize(struct blob *blob, const struct panvk_shader *shader) blob_write_uint32(blob, shader->desc_info.dyn_bufs.count); blob_write_bytes(blob, shader->desc_info.dyn_bufs.map, sizeof(*shader->desc_info.dyn_bufs.map) * - shader->desc_info.dyn_bufs.count); + shader->desc_info.dyn_bufs.count); #endif }