pvr: enable VK_KHR_maintenance4

This commit adds support for VK_KHR_maintenance4 extension by
implementing the required function.

Makes the following tests to pass/be supported:
dEQP-VK.api.info.get_physical_device_properties2.features.maintenance4_features
dEQP-VK.api.info.vulkan1p3_limits_validation.khr_maintenance4
dEQP-VK.api.device_init.create_device_unsupported_features.maintenance4_features
dEQP-VK.memory.requirements.create_info.buffer.regular
dEQP-VK.memory.requirements.create_info.image.regular_tiling_linear
dEQP-VK.memory.requirements.create_info.image.regular_tiling_optimal
dEQP-VK.memory.requirements.create_info.image.transient_tiling_linear
dEQP-VK.memory.requirements.create_info.image.transient_tiling_optimal

Signed-off-by: Leon Perianu <leon.perianu@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39776>
This commit is contained in:
Leon Perianu 2026-01-27 14:30:35 +02:00 committed by Marge Bot
parent 14651e82f8
commit 7e3aa7e627
4 changed files with 64 additions and 1 deletions

View file

@ -494,7 +494,7 @@ Vulkan 1.3 -- all DONE: anv, hk, kk, lvp, nvk, panvk/v10+, radv, tu, vn, v3dv
VK_KHR_copy_commands2 DONE (anv, hasvk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
VK_KHR_dynamic_rendering DONE (anv, dzn, hasvk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
VK_KHR_format_feature_flags2 DONE (anv, hasvk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
VK_KHR_maintenance4 DONE (anv, hasvk, lvp, nvk, panvk/v10+, radv, tu, v3dv, vn)
VK_KHR_maintenance4 DONE (anv, hasvk, lvp, nvk, panvk/v10+, pvr, radv, tu, v3dv, vn)
VK_KHR_shader_integer_dot_product DONE (anv, dzn, hasvk, lvp, nvk, panvk, radv, tu, v3dv, vn)
VK_KHR_shader_non_semantic_info DONE (anv, hasvk, nvk, panvk, pvr, radv, tu, v3dv, vn)
VK_KHR_shader_terminate_invocation DONE (anv, hasvk, lvp, nvk, panvk, radv, tu, v3dv, vn)

View file

@ -21,3 +21,4 @@ VK_EXT_depth_clamp_control on panvk
VK_VALVE_shader_mixed_float_dot_product on RADV (Vega20, Navi14, RDNA2+)
VK_EXT_legacy_dithering on panvk
GL_ARB_sample_shading on v3d
VK_KHR_maintenance4 on pvr

View file

@ -1007,6 +1007,61 @@ void pvr_GetBufferMemoryRequirements2(
}
}
void pvr_GetDeviceBufferMemoryRequirements(
VkDevice _device,
const VkDeviceBufferMemoryRequirements *pInfo,
VkMemoryRequirements2 *pMemoryRequirements)
{
VK_FROM_HANDLE(pvr_device, device, _device);
struct pvr_buffer buffer = { 0 };
/* Initialize a minimal buffer structure */
vk_buffer_init(&device->vk, &buffer.vk, pInfo->pCreateInfo);
buffer.alignment = device->pdevice->ws->page_size;
VkBufferMemoryRequirementsInfo2 buffer_info = {
.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2,
.buffer = pvr_buffer_to_handle(&buffer),
};
pvr_GetBufferMemoryRequirements2(_device, &buffer_info, pMemoryRequirements);
/* Clean up the temporary buffer */
vk_buffer_finish(&buffer.vk);
}
void pvr_GetDeviceImageMemoryRequirements(
VkDevice _device,
const VkDeviceImageMemoryRequirements *pInfo,
VkMemoryRequirements2 *pMemoryRequirements)
{
VK_FROM_HANDLE(pvr_device, device, _device);
struct pvr_image image = { 0 };
vk_image_init(&device->vk, &image.vk, pInfo->pCreateInfo);
pvr_image_init(device, pInfo->pCreateInfo, &image);
VkImageMemoryRequirementsInfo2 image_info = {
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2,
.image = pvr_image_to_handle(&image),
};
pvr_GetImageMemoryRequirements2(_device, &image_info, pMemoryRequirements);
pvr_image_fini(device, &image);
vk_image_finish(&image.vk);
}
void pvr_GetDeviceImageSparseMemoryRequirements(
VkDevice device,
const VkDeviceImageMemoryRequirements *pInfo,
uint32_t *pSparseMemoryRequirementCount,
VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements)
{
/* Sparse images are not yet supported */
*pSparseMemoryRequirementCount = 0;
}
void pvr_GetImageMemoryRequirements2(VkDevice _device,
const VkImageMemoryRequirementsInfo2 *pInfo,
VkMemoryRequirements2 *pMemoryRequirements)

View file

@ -148,6 +148,7 @@ static void pvr_physical_device_get_supported_extensions(
.KHR_maintenance1 = true,
.KHR_maintenance2 = true,
.KHR_maintenance3 = true,
.KHR_maintenance4 = true,
.KHR_map_memory2 = true,
.KHR_multiview = true,
.KHR_pipeline_executable_properties = true,
@ -328,6 +329,9 @@ static void pvr_physical_device_get_supported_features(
.multiviewGeometryShader = false,
.multiviewTessellationShader = false,
/* Vulkan 1.3 / VK_KHR_maintenance4 */
.maintenance4 = true,
/* Vulkan 1.1 / VK_KHR_shader_draw_parameters */
.shaderDrawParameters = true,
@ -804,6 +808,9 @@ static bool pvr_physical_device_get_properties(
.uniformTexelBufferOffsetAlignmentBytes = PVR_TEXEL_BUFFER_OFFSET_ALIGNMENT,
.uniformTexelBufferOffsetSingleTexelAlignment = false,
/* Vulkan 1.3 / VK_KHR_maintenance4 */
.maxBufferSize = max_memory_alloc_size,
/* Vulkan 1.4 / VK_EXT_vertex_attribute_divisor / VK_KHR_vertex_attribute_divisor */
.maxVertexAttribDivisor = UINT32_MAX,
.supportsNonZeroFirstInstance = true,