From 2b6c75423ec7827daac89286b1abf02c91bd4a34 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 16 Oct 2025 17:16:27 +0300 Subject: [PATCH] anv: reenable VK_KHR_maintenance8 on pre-Xe2 platforms Signed-off-by: Lionel Landwerlin Reviewed-by: Alyssa Rosenzweig Part-of: --- src/intel/vulkan/anv_physical_device.c | 2 +- src/intel/vulkan/anv_shader_compile.c | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_physical_device.c b/src/intel/vulkan/anv_physical_device.c index db0db7ee66c..198c693379e 100644 --- a/src/intel/vulkan/anv_physical_device.c +++ b/src/intel/vulkan/anv_physical_device.c @@ -197,7 +197,7 @@ get_device_extensions(const struct anv_physical_device *device, .KHR_maintenance5 = true, .KHR_maintenance6 = true, .KHR_maintenance7 = true, - .KHR_maintenance8 = device->info.ver >= 20, + .KHR_maintenance8 = true, .KHR_maintenance9 = true, .KHR_map_memory2 = true, .KHR_multiview = true, diff --git a/src/intel/vulkan/anv_shader_compile.c b/src/intel/vulkan/anv_shader_compile.c index 4e96551a5da..a32c42cc51a 100644 --- a/src/intel/vulkan/anv_shader_compile.c +++ b/src/intel/vulkan/anv_shader_compile.c @@ -1389,10 +1389,24 @@ anv_shader_lower_nir(struct anv_device *device, NIR_PASS(_, nir, nir_opt_remove_phis); + const bool lower_non_uniform_texture_offsets = device->info->ver < 20; + enum nir_lower_non_uniform_access_type lower_non_uniform_access_types = nir_lower_non_uniform_texture_access | nir_lower_non_uniform_image_access | - nir_lower_non_uniform_get_ssbo_size; + nir_lower_non_uniform_get_ssbo_size | + (lower_non_uniform_texture_offsets ? + nir_lower_non_uniform_texture_offset_access : 0); + + /* Pre-Xe2 platforms don't have native support for dynamic programmable + * offsets. Since support includes non-uniform programmable offsets, we + * need to lower those texture messages in the same way we lower + * non-uniform texture/sampler handles. + */ + if (lower_non_uniform_texture_offsets) { + nir_foreach_function_impl(impl, nir) + nir_metadata_require(impl, nir_metadata_divergence); + } /* In practice, most shaders do not have non-uniform-qualified * accesses (see