From a16d36304ecf432528dd7ee821aecf3880449bca Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Tue, 10 Feb 2026 00:07:27 +0100 Subject: [PATCH] panvk: Support VK_EXT_astc_decode_mode The Panfrost hardware already supports controlling ASTC decode precision via the Decode Wide plane descriptor field. Wire up the Vulkan extension by parsing VkImageViewASTCDecodeModeEXT from the image view pNext chain and setting astc.narrow when the application requests VK_FORMAT_R8G8B8A8_UNORM decode mode. The extension is limited to v9+ since the ASTC plane descriptors with Decode Wide/HDR fields only exist from Valhall onwards. decodeModeSharedExponent is not supported. Signed-off-by: Christian Gmeiner Reviewed-by: Erik Faye-Lund Part-of: --- docs/features.txt | 1 + docs/relnotes/new_features.txt | 1 + src/panfrost/vulkan/panvk_vX_image_view.c | 5 +++++ src/panfrost/vulkan/panvk_vX_physical_device.c | 5 +++++ 4 files changed, 12 insertions(+) diff --git a/docs/features.txt b/docs/features.txt index aa0634a4467..bf08859eefc 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -597,6 +597,7 @@ Khronos extensions that are not part of any Vulkan version: VK_KHR_swapchain_maintenance1 DONE (anv, hk, lvp, nvk, radv, tu, v3dv, vn) VK_EXT_acquire_xlib_display DONE (anv, hk, lvp, nvk, panvk, radv, tu, v3dv, vn) VK_EXT_attachment_feedback_loop_dynamic_state DONE (anv, lvp, radv, tu, vn) + VK_EXT_astc_decode_mode DONE (panvk) VK_EXT_attachment_feedback_loop_layout DONE (anv, hk, lvp, nvk, radv, tu, v3dv, vn) VK_EXT_blend_operation_advanced DONE (hk, lvp, vn) VK_EXT_border_color_swizzle DONE (anv, hasvk, hk, lvp, nvk, panvk, pvr, radv/gfx10+, tu, v3dv, vn) diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index 3590f183454..50dc41192c3 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -13,3 +13,4 @@ VK_KHR_pipeline_executable_properties on pvr VK_EXT_zero_initialize_device_memory on panvk GL_EXT_shader_image_load_store on panfrost VK_KHR_swapchain_mutable_format on panvk +VK_EXT_astc_decode_mode on panvk diff --git a/src/panfrost/vulkan/panvk_vX_image_view.c b/src/panfrost/vulkan/panvk_vX_image_view.c index 860bf1f0b4f..11416b8de52 100644 --- a/src/panfrost/vulkan/panvk_vX_image_view.c +++ b/src/panfrost/vulkan/panvk_vX_image_view.c @@ -343,9 +343,14 @@ panvk_per_arch(CreateImageView)(VkDevice _device, } enum pipe_format pfmt = vk_format_to_pipe_format(view->vk.view_format); + const VkImageViewASTCDecodeModeEXT *astc_decode = + vk_find_struct_const(pCreateInfo->pNext, IMAGE_VIEW_ASTC_DECODE_MODE_EXT); + view->pview = (struct pan_image_view){ .format = pfmt, .astc.hdr = util_format_is_astc_hdr(pfmt), + .astc.narrow = astc_decode && + astc_decode->decodeMode == VK_FORMAT_R8G8B8A8_UNORM, .dim = panvk_view_type_to_mali_tex_dim(view->vk.view_type), .nr_samples = image->vk.samples, .first_level = view->vk.base_mip_level, diff --git a/src/panfrost/vulkan/panvk_vX_physical_device.c b/src/panfrost/vulkan/panvk_vX_physical_device.c index f7a0003fbd7..b5a5f215921 100644 --- a/src/panfrost/vulkan/panvk_vX_physical_device.c +++ b/src/panfrost/vulkan/panvk_vX_physical_device.c @@ -186,6 +186,7 @@ panvk_per_arch(get_physical_device_extensions)( .EXT_shader_subgroup_vote = true, .EXT_subgroup_size_control = has_vk1_1, .EXT_texel_buffer_alignment = true, + .EXT_astc_decode_mode = PAN_ARCH >= 9, .EXT_texture_compression_astc_hdr = true, .EXT_tooling_info = true, .EXT_vertex_attribute_divisor = true, @@ -397,6 +398,10 @@ panvk_per_arch(get_physical_device_features)( .synchronization2 = true, .textureCompressionASTC_HDR = has_texture_compression_astc_hdr(device), .shaderZeroInitializeWorkgroupMemory = true, + + /* VK_EXT_astc_decode_mode */ + .decodeModeSharedExponent = false, + .dynamicRendering = true, .shaderIntegerDotProduct = true, .maintenance4 = true,