diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index ecf7ac2cdf4..bb5c8c278bd 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -864,13 +864,18 @@ capture_trace(VkQueue _queue) static void radv_device_init_cache_key(struct radv_device *device) { - STATIC_ASSERT(sizeof(struct radv_device_cache_key) == 4); + STATIC_ASSERT(sizeof(enum radeon_family) == 4); + STATIC_ASSERT(sizeof(struct radv_device_cache_key) == 12); STATIC_ASSERT(sizeof(device->compiler_info.key) == 12); const struct radv_physical_device *pdev = radv_device_physical(device); struct radv_device_cache_key *key = &device->cache_key; struct mesa_blake3 ctx; + key->family = pdev->info.family; + key->ptr_size = sizeof(void *); + key->conformant_trunc_coord = pdev->info.compiler_info.conformant_trunc_coord; + key->image_2d_view_of_3d = device->vk.enabled_features.image2DViewOf3D && pdev->info.gfx_level == GFX9; key->mesh_shader_queries = device->vk.enabled_features.meshShaderQueries && pdev->emulate_mesh_shader_queries; key->primitives_generated_query = radv_uses_primitives_generated_query(device); @@ -889,7 +894,6 @@ radv_device_init_cache_key(struct radv_device *device) } _mesa_blake3_init(&ctx); - _mesa_blake3_update(&ctx, &pdev->cache_key, sizeof(pdev->cache_key)); _mesa_blake3_update(&ctx, &device->cache_key, sizeof(device->cache_key)); _mesa_blake3_update(&ctx, &device->compiler_info.key, sizeof(device->compiler_info.key)); _mesa_blake3_final(&ctx, device->cache_hash); diff --git a/src/amd/vulkan/radv_device.h b/src/amd/vulkan/radv_device.h index dac7ffd07a4..8ac15ae8a82 100644 --- a/src/amd/vulkan/radv_device.h +++ b/src/amd/vulkan/radv_device.h @@ -55,11 +55,15 @@ struct radv_layer_dispatch_tables { }; struct radv_device_cache_key { + enum radeon_family family; + uint32_t ptr_size; + + uint32_t conformant_trunc_coord : 1; uint32_t image_2d_view_of_3d : 1; uint32_t mesh_shader_queries : 1; uint32_t primitives_generated_query : 1; - uint32_t reserved : 29; + uint32_t reserved : 28; }; enum radv_force_vrs { diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index f900c1aa36c..22c8189334e 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -288,19 +288,6 @@ parse_hex(char *out, const char *in, unsigned length) } } -static void -radv_physical_device_init_cache_key(struct radv_physical_device *pdev) -{ - STATIC_ASSERT(sizeof(enum radeon_family) == 4); - STATIC_ASSERT(sizeof(struct radv_physical_device_cache_key) == 12); - - struct radv_physical_device_cache_key *key = &pdev->cache_key; - - key->family = pdev->info.family; - key->ptr_size = sizeof(void *); - key->conformant_trunc_coord = pdev->info.compiler_info.conformant_trunc_coord; -} - static int radv_device_get_cache_uuid(struct radv_physical_device *pdev, void *uuid) { @@ -2660,8 +2647,6 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm pdev->render_devid = render_stat.st_rdev; } - radv_physical_device_init_cache_key(pdev); - if (radv_device_get_cache_uuid(pdev, pdev->cache_uuid)) { result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED, "cannot generate UUID"); goto fail_wsi; diff --git a/src/amd/vulkan/radv_physical_device.h b/src/amd/vulkan/radv_physical_device.h index 608d8ab518b..aecfe59e6b5 100644 --- a/src/amd/vulkan/radv_physical_device.h +++ b/src/amd/vulkan/radv_physical_device.h @@ -36,13 +36,6 @@ struct radv_binning_settings { unsigned fpovs_per_batch; /* allowed range: [0, 255], 0 = unlimited */ }; -struct radv_physical_device_cache_key { - enum radeon_family family; - uint32_t ptr_size; - uint32_t conformant_trunc_coord : 1; - uint32_t reserved : 31; -}; - enum radv_video_enc_hw_ver { RADV_VIDEO_ENC_HW_1_2, RADV_VIDEO_ENC_HW_2, @@ -181,7 +174,6 @@ struct radv_physical_device { uint32_t encoder_interface_version; bool video_encode_enabled; bool video_decode_enabled; - struct radv_physical_device_cache_key cache_key; uint32_t tess_distribution_mode;