venus: enable VK_KHR_maintenance5

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29058>
This commit is contained in:
Corentin Noël 2024-05-06 11:33:22 +02:00 committed by Marge Bot
parent 3359fbc25b
commit be6fece6e1
5 changed files with 83 additions and 1 deletions

View file

@ -524,7 +524,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_KHR_index_type_uint8 DONE (anv, nvk, pvr, radv, tu, v3dv)
VK_KHR_line_rasterization DONE (anv, nvk, radv, tu, v3dv)
VK_KHR_load_store_op_none DONE (anv, nvk, radv, tu, v3dv)
VK_KHR_maintenance5 DONE (anv, lvp, nvk, radv, tu)
VK_KHR_maintenance5 DONE (anv, lvp, nvk, radv, tu, vn)
VK_KHR_maintenance6 DONE (anv, lvp, nvk, radv)
VK_KHR_performance_query DONE (anv, radv/gfx10.3+, tu, v3dv)
VK_KHR_pipeline_executable_properties DONE (anv, nvk, hasvk, radv, tu, v3dv)

View file

@ -1190,6 +1190,17 @@ vn_CmdBindIndexBuffer(VkCommandBuffer commandBuffer,
indexType);
}
void
vn_CmdBindIndexBuffer2KHR(VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
VkDeviceSize size,
VkIndexType indexType)
{
VN_CMD_ENQUEUE(vkCmdBindIndexBuffer2KHR, commandBuffer, buffer, offset,
size, indexType);
}
void
vn_CmdBindVertexBuffers(VkCommandBuffer commandBuffer,
uint32_t firstBinding,

View file

@ -1144,3 +1144,59 @@ vn_GetDeviceImageSparseMemoryRequirements(
dev->primary_ring, device, pInfo, pSparseMemoryRequirementCount,
pSparseMemoryRequirements);
}
void
vn_GetDeviceImageSubresourceLayoutKHR(VkDevice device,
const VkDeviceImageSubresourceInfoKHR *pInfo,
VkSubresourceLayout2KHR *pLayout)
{
struct vn_device *dev = vn_device_from_handle(device);
/* TODO per-device cache */
vn_call_vkGetDeviceImageSubresourceLayoutKHR(
dev->primary_ring, device, pInfo, pLayout);
}
void
vn_GetImageSubresourceLayout2KHR(VkDevice device,
VkImage image,
const VkImageSubresource2KHR *pSubresource,
VkSubresourceLayout2KHR *pLayout)
{
struct vn_device *dev = vn_device_from_handle(device);
struct vn_image *img = vn_image_from_handle(image);
/* override aspect mask for wsi/ahb images with tiling modifier */
VkImageSubresource2KHR local_subresource;
if ((img->wsi.is_wsi && img->wsi.tiling_override ==
VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) ||
img->deferred_info) {
VkImageAspectFlags aspect = pSubresource->imageSubresource.aspectMask;
switch (aspect) {
case VK_IMAGE_ASPECT_COLOR_BIT:
case VK_IMAGE_ASPECT_DEPTH_BIT:
case VK_IMAGE_ASPECT_STENCIL_BIT:
case VK_IMAGE_ASPECT_PLANE_0_BIT:
aspect = VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT;
break;
case VK_IMAGE_ASPECT_PLANE_1_BIT:
aspect = VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT;
break;
case VK_IMAGE_ASPECT_PLANE_2_BIT:
aspect = VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT;
break;
default:
break;
}
/* only handle supported aspect override */
if (aspect != pSubresource->imageSubresource.aspectMask) {
local_subresource = *pSubresource;
local_subresource.imageSubresource.aspectMask = aspect;
pSubresource = &local_subresource;
}
}
vn_call_vkGetImageSubresourceLayout2KHR(
dev->primary_ring, device, image, pSubresource, pLayout);
}

View file

@ -162,6 +162,7 @@ vn_physical_device_init_features(struct vn_physical_device *physical_dev)
/* KHR */
VkPhysicalDeviceFragmentShadingRateFeaturesKHR fragment_shading_rate;
VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5;
VkPhysicalDeviceShaderClockFeaturesKHR shader_clock;
VkPhysicalDeviceShaderExpectAssumeFeaturesKHR expect_assume;
@ -269,6 +270,7 @@ vn_physical_device_init_features(struct vn_physical_device *physical_dev)
VN_ADD_PNEXT_EXT(feats2, FRAGMENT_SHADING_RATE_FEATURES_KHR, local_feats.fragment_shading_rate, exts->KHR_fragment_shading_rate);
VN_ADD_PNEXT_EXT(feats2, SHADER_CLOCK_FEATURES_KHR, local_feats.shader_clock, exts->KHR_shader_clock);
VN_ADD_PNEXT_EXT(feats2, SHADER_EXPECT_ASSUME_FEATURES_KHR, local_feats.expect_assume, exts->KHR_shader_expect_assume);
VN_ADD_PNEXT_EXT(feats2, MAINTENANCE_5_FEATURES_KHR, local_feats.maintenance5, exts->KHR_maintenance5);
/* EXT */
VN_ADD_PNEXT_EXT(feats2, ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT, local_feats.attachment_feedback_loop_layout, exts->EXT_attachment_feedback_loop_layout);
@ -1090,6 +1092,7 @@ vn_physical_device_get_passthrough_extensions(
/* KHR */
.KHR_fragment_shading_rate = true,
.KHR_maintenance5 = true,
.KHR_pipeline_library = true,
.KHR_push_descriptor = true,
.KHR_shader_clock = true,

View file

@ -334,6 +334,18 @@ vn_GetRenderAreaGranularity(VkDevice device,
*pGranularity = pass->granularity;
}
void
vn_GetRenderingAreaGranularityKHR(VkDevice device,
const VkRenderingAreaInfoKHR *pRenderingAreaInfo,
VkExtent2D *pGranularity)
{
struct vn_device *dev = vn_device_from_handle(device);
/* TODO per-device cache */
vn_call_vkGetRenderingAreaGranularityKHR(dev->primary_ring, device,
pRenderingAreaInfo, pGranularity);
}
/* framebuffer commands */
VkResult