From c3884f7f1e2db10a9aad5a659dc84163fa3fc704 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 24 Feb 2025 12:22:04 +0100 Subject: [PATCH] radv: reserve bits explicitly for cache key structs Having explicit reserved bits for those structs will make compiler change backports easier and more robust regarding precompiled shaders on SteamDeck. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_device.h | 2 ++ src/amd/vulkan/radv_physical_device.h | 2 ++ src/amd/vulkan/radv_shader.h | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/src/amd/vulkan/radv_device.h b/src/amd/vulkan/radv_device.h index eeb2354b92d..0709d5b210b 100644 --- a/src/amd/vulkan/radv_device.h +++ b/src/amd/vulkan/radv_device.h @@ -61,6 +61,8 @@ struct radv_device_cache_key { uint32_t mesh_shader_queries : 1; uint32_t primitives_generated_query : 1; uint32_t trap_excp_flags : 4; + + uint32_t reserved : 23; }; enum radv_force_vrs { diff --git a/src/amd/vulkan/radv_physical_device.h b/src/amd/vulkan/radv_physical_device.h index a001316bb81..dffc40a968a 100644 --- a/src/amd/vulkan/radv_physical_device.h +++ b/src/amd/vulkan/radv_physical_device.h @@ -61,6 +61,8 @@ struct radv_physical_device_cache_key { uint32_t use_llvm : 1; uint32_t use_ngg : 1; uint32_t use_ngg_culling : 1; + + uint32_t reserved : 11; }; enum radv_video_enc_hw_ver { diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index ea855388840..90bcf4377fb 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -89,6 +89,8 @@ struct radv_shader_stage_key { /* Whether the shader is used with indirect pipeline binds. */ uint8_t indirect_bindable : 1; + + uint32_t reserved : 18; }; struct radv_ps_epilog_key { @@ -108,6 +110,8 @@ struct radv_ps_epilog_key { bool export_sample_mask; bool alpha_to_coverage_via_mrtz; bool alpha_to_one; + + uint16_t reserved; }; struct radv_spirv_to_nir_options { @@ -125,6 +129,7 @@ struct radv_graphics_state_key { uint32_t dynamic_line_rast_mode : 1; uint32_t enable_remove_point_size : 1; uint32_t unknown_rast_prim : 1; + uint32_t reserved : 13; struct { uint8_t topology;