From d2732faac076e40389a0c0e06e031aa9da595e68 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 16 Mar 2026 10:13:34 +0200 Subject: [PATCH] anv: enable VK_EXT_swapchain_compression_control when possible Signed-off-by: Lionel Landwerlin Reviewed-by: Nanley Chery Part-of: --- src/intel/vulkan/anv_physical_device.c | 20 +++++++++++++------- src/intel/vulkan/anv_private.h | 3 +++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/intel/vulkan/anv_physical_device.c b/src/intel/vulkan/anv_physical_device.c index 5b723093e86..d03358414ff 100644 --- a/src/intel/vulkan/anv_physical_device.c +++ b/src/intel/vulkan/anv_physical_device.c @@ -328,12 +328,7 @@ get_device_extensions(const struct anv_physical_device *device, .EXT_host_image_copy = true, .EXT_host_query_reset = true, .EXT_image_2d_view_of_3d = true, - /* Because of Xe2 PAT selected compression and the Vulkan spec - * requirement to always return the same memory types for Images with - * same properties we can't support EXT_image_compression_control on Xe2+ - */ - .EXT_image_compression_control = device->instance->compression_control_enabled && - device->info.ver < 20, + .EXT_image_compression_control = device->has_compression_control, .EXT_image_drm_format_modifier = true, .EXT_image_robustness = true, .EXT_image_sliced_view_of_3d = true, @@ -392,6 +387,7 @@ get_device_extensions(const struct anv_physical_device *device, .EXT_shader_uniform_buffer_unsized_array = true, .EXT_subgroup_size_control = !device->brw_disable_subgroup_size_control, #ifdef ANV_USE_WSI_PLATFORM + .EXT_image_compression_control_swapchain = device->has_compression_control, .EXT_swapchain_maintenance1 = true, #endif .EXT_texel_buffer_alignment = true, @@ -951,7 +947,7 @@ get_features(const struct anv_physical_device *pdevice, .videoDecodeVP9 = true, /* VK_EXT_image_compression_control */ - .imageCompressionControl = true, + .imageCompressionControl = pdevice->has_compression_control, /* VK_KHR_shader_float_controls2 */ .shaderFloatControls2 = true, @@ -1055,6 +1051,9 @@ get_features(const struct anv_physical_device *pdevice, /* VK_KHR_device_address_commands */ .deviceAddressCommands = true, + + /* VK_EXT_swapchain_compression_control */ + .imageCompressionControlSwapchain = pdevice->has_compression_control, }; /* The new DOOM and Wolfenstein games require depthBounds without @@ -2883,6 +2882,13 @@ anv_physical_device_try_create(struct vk_instance *vk_instance, device->info.cooperative_matrix_configurations[0].scope != INTEL_CMAT_SCOPE_NONE && !intel_use_jay_any_stage(&device->info); + /* Because of Xe2 PAT selected compression and the Vulkan spec requirement + * to always return the same memory types for Images with same properties + * we can't support EXT_image_compression_control on Xe2+. + */ + device->has_compression_control = + instance->compression_control_enabled && device->info.ver < 20; + if (is_virtio) { struct util_sync_provider *sync = intel_virtio_sync_provider(fd); device->sync_syncobj_type = vk_drm_syncobj_get_type_from_provider(sync); diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 5bbc06bbdf8..519be0f3654 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1549,6 +1549,9 @@ struct anv_physical_device { bool has_scratch_page; + /** Whether we allow the application to control compression */ + bool has_compression_control; + struct { uint32_t family_count; struct anv_queue_family families[ANV_MAX_QUEUE_FAMILIES];