From: Samuel Pitoiset Date: Fri, 10 Mar 2023 14:44:13 +0000 (+0100) Subject: radv: store the total radv_shader_part_binary size X-Git-Tag: upstream/23.3.3~11321 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa15d64949b1d3d553b46a2756e46fb9ef8b59c8;p=platform%2Fupstream%2Fmesa.git radv: store the total radv_shader_part_binary size Similar to radv_shader. This will be used for the shaders cache. Signed-off-by: Samuel Pitoiset Part-of: --- diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index f8a67e5..ec7be44 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -2786,6 +2786,7 @@ static void radv_aco_build_shader_part(void **bin, part_binary->num_sgprs = num_sgprs; part_binary->num_vgprs = num_vgprs; + part_binary->total_size = size; part_binary->code_size = code_size * sizeof(uint32_t); memcpy(part_binary->data, code, part_binary->code_size); if (disasm_size) { diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 4ae59c0..8d52659 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -466,6 +466,10 @@ struct radv_shader_part_binary { uint8_t num_vgprs; unsigned code_size; unsigned disasm_size; + + /* Self-referential size so we avoid consistency issues. */ + uint32_t total_size; + uint8_t data[0]; };