diff --git a/docs/features.txt b/docs/features.txt index b6264427042..c566682c8e9 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -473,7 +473,7 @@ Vulkan 1.2 -- all DONE: anv, nvk, tu, vn VK_KHR_vulkan_memory_model DONE (anv, hasvk, lvp, nvk, radv, tu, v3dv, vn) VK_EXT_descriptor_indexing DONE (anv, dzn, lvp, nvk, radv, tu, vn) VK_EXT_host_query_reset DONE (anv, hasvk, lvp, nvk, pvr, radv, tu, v3dv, vn) - VK_EXT_sampler_filter_minmax DONE (anv, lvp, nvk, radv, tu, vn) + VK_EXT_sampler_filter_minmax DONE (anv, lvp, nvk, panvk/v10+, radv, tu, vn) VK_EXT_scalar_block_layout DONE (anv, dzn, hasvk, lvp, nvk, pvr, radv/gfx7+, tu, vn, v3dv/vc7+) VK_EXT_separate_stencil_usage DONE (anv, dzn, hasvk, lvp, nvk, radv, tu, v3dv, vn) VK_EXT_shader_viewport_index_layer DONE (anv, hasvk, lvp, nvk, radv, tu, vn) diff --git a/src/panfrost/vulkan/panvk_physical_device.c b/src/panfrost/vulkan/panvk_physical_device.c index 22d2de390d1..ac01c3828a6 100644 --- a/src/panfrost/vulkan/panvk_physical_device.c +++ b/src/panfrost/vulkan/panvk_physical_device.c @@ -184,6 +184,8 @@ static void get_device_extensions(const struct panvk_physical_device *device, struct vk_device_extension_table *ext) { + const unsigned arch = pan_arch(device->kmod.props.gpu_prod_id); + *ext = (struct vk_device_extension_table){ .KHR_16bit_storage = true, .KHR_bind_memory2 = true, @@ -236,6 +238,7 @@ get_device_extensions(const struct panvk_physical_device *device, .EXT_pipeline_creation_feedback = true, .EXT_private_data = true, .EXT_queue_family_foreign = true, + .EXT_sampler_filter_minmax = arch >= 10, .EXT_shader_module_identifier = true, .EXT_tooling_info = true, .EXT_vertex_attribute_divisor = true, @@ -315,7 +318,7 @@ get_features(const struct panvk_physical_device *device, .descriptorBindingVariableDescriptorCount = false, .runtimeDescriptorArray = false, - .samplerFilterMinmax = false, + .samplerFilterMinmax = arch >= 10, .scalarBlockLayout = false, .imagelessFramebuffer = false, .uniformBufferStandardLayout = false, @@ -712,9 +715,8 @@ get_device_properties(const struct panvk_instance *instance, .maxDescriptorSetUpdateAfterBindSampledImages = 0, .maxDescriptorSetUpdateAfterBindStorageImages = 0, .maxDescriptorSetUpdateAfterBindInputAttachments = 0, - /* XXX: VK_EXT_sampler_filter_minmax */ - .filterMinmaxSingleComponentFormats = false, - .filterMinmaxImageComponentMapping = false, + .filterMinmaxSingleComponentFormats = arch >= 10, + .filterMinmaxImageComponentMapping = arch >= 10, .maxTimelineSemaphoreValueDifference = INT64_MAX, .framebufferIntegerColorSampleCounts = sample_counts, diff --git a/src/panfrost/vulkan/panvk_vX_sampler.c b/src/panfrost/vulkan/panvk_vX_sampler.c index fb6251f2198..bb3ec406a06 100644 --- a/src/panfrost/vulkan/panvk_vX_sampler.c +++ b/src/panfrost/vulkan/panvk_vX_sampler.c @@ -140,6 +140,22 @@ panvk_per_arch(CreateSampler)(VkDevice _device, cfg.maximum_anisotropy = pCreateInfo->maxAnisotropy; cfg.lod_algorithm = MALI_LOD_ALGORITHM_ANISOTROPIC; } + +#if PAN_ARCH >= 10 + switch (sampler->vk.reduction_mode) { + case VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE: + cfg.reduction_mode = MALI_REDUCTION_MODE_AVERAGE; + break; + case VK_SAMPLER_REDUCTION_MODE_MIN: + cfg.reduction_mode = MALI_REDUCTION_MODE_MINIMUM; + break; + case VK_SAMPLER_REDUCTION_MODE_MAX: + cfg.reduction_mode = MALI_REDUCTION_MODE_MAXIMUM; + break; + default: + unreachable("Invalid reduction mode"); + } +#endif } *pSampler = panvk_sampler_to_handle(sampler);