From 776f4523f916a0acf55a0baa1e65dc52a6b08b89 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 15 Feb 2024 12:56:57 +0100 Subject: [PATCH] radv: fix binary shaders compatibility with ESO RADV needs to assume that all features that affect shaders might be enabled. Note that disable_trunc_coord is specific to DXVK and mesh_shader_queries is still disabled by default. This fixes dEQP-VK.shader_object.binary.device_features.* on GFX10+. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_device.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 2c050c28d26..402341703e6 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -677,6 +677,19 @@ radv_device_init_cache_key(struct radv_device *device) key->mesh_shader_queries = device->vk.enabled_features.meshShaderQueries; key->primitives_generated_query = radv_uses_primitives_generated_query(device); + /* The Vulkan spec says: + * "Binary shaders retrieved from a physical device with a certain shaderBinaryUUID are + * guaranteed to be compatible with all other physical devices reporting the same + * shaderBinaryUUID and the same or higher shaderBinaryVersion." + * + * That means the driver should compile shaders for the "worst" case of all features being + * enabled, regardless of what features are actually enabled on the logical device. + */ + if (device->vk.enabled_features.shaderObject) { + key->image_2d_view_of_3d = device->physical_device->rad_info.gfx_level == GFX9; + key->primitives_generated_query = true; + } + _mesa_blake3_compute(key, sizeof(*key), device->cache_hash); }