radv: store spi_shader_col_format to radv_shader_part_binary
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 10 Mar 2023 14:40:22 +0000 (15:40 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 21 Mar 2023 13:53:58 +0000 (13:53 +0000)
For PS epilogs in the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>

src/amd/vulkan/radv_shader.c
src/amd/vulkan/radv_shader.h

index c3d9460..f8a67e5 100644 (file)
@@ -2504,6 +2504,8 @@ radv_shader_part_create(struct radv_shader_part_binary *binary, unsigned wave_si
    shader_part->disasm_string =
       binary->disasm_size ? strdup((const char *)(binary->data + binary->code_size)) : NULL;
 
+   shader_part->spi_shader_col_format = binary->info.spi_shader_col_format;
+
    return shader_part;
 }
 
@@ -2968,12 +2970,12 @@ radv_create_ps_epilog(struct radv_device *device, const struct radv_ps_epilog_ke
    aco_compile_ps_epilog(&ac_opts, &ac_info, &ac_epilog_info, &args.ac, &radv_aco_build_shader_part,
                          (void **)&binary);
 
+   binary->info.spi_shader_col_format = key->spi_shader_col_format;
+
    epilog = radv_shader_part_create(binary, info.wave_size);
    if (!epilog)
       goto fail_create;
 
-   epilog->spi_shader_col_format = key->spi_shader_col_format;
-
    /* Allocate memory and upload the epilog. */
    epilog->alloc = radv_alloc_shader_memory(device, epilog->code_size, NULL);
    if (!epilog->alloc)
index 73ec735..4ae59c0 100644 (file)
@@ -458,6 +458,10 @@ struct radv_shader_binary_rtld {
 };
 
 struct radv_shader_part_binary {
+   struct {
+      uint32_t spi_shader_col_format;
+   } info;
+
    uint8_t num_sgprs;
    uint8_t num_vgprs;
    unsigned code_size;