panvk: Implement VK_EXT_sampler_filter_minmax for v10

This is supported by the hardware since v10.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32215>
This commit is contained in:
Mary Guillemard 2024-11-19 11:15:58 +01:00
parent a5bcf566a9
commit 1fc454673a
3 changed files with 23 additions and 5 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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);