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 <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
This commit is contained in:
Samuel Pitoiset 2023-03-10 15:44:13 +01:00 committed by Marge Bot
parent aec9fd394f
commit aa15d64949
2 changed files with 5 additions and 0 deletions

View file

@ -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) {

View file

@ -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];
};