venus: support VK_KHR_maintenance6

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33690>
This commit is contained in:
Yiwei Zhang
2025-02-21 22:08:06 -08:00
committed by Marge Bot
parent e46bb404bd
commit d26643c6c2
5 changed files with 112 additions and 1 deletions

View File

@@ -517,7 +517,7 @@ Vulkan 1.4 -- all DONE: anv, lvp, nvk, radv/gfx8+, tu/a7xx+
VK_KHR_line_rasterization DONE (anv, lvp, nvk, radv, tu, v3dv, vn)
VK_KHR_load_store_op_none DONE (anv, lvp, nvk, radv, tu, v3dv, vn)
VK_KHR_maintenance5 DONE (anv, lvp, nvk, radv, tu, v3dv, vn)
VK_KHR_maintenance6 DONE (anv, lvp, nvk, radv, tu)
VK_KHR_maintenance6 DONE (anv, lvp, nvk, radv, tu, vn)
VK_KHR_map_memory2 DONE (anv, lvp, nvk, panvk, radv, tu, vn)
VK_KHR_push_descriptor DONE (anv, hasvk, lvp, nvk, panvk, radv, tu, vn)
VK_KHR_shader_expect_assume DONE (anv, dzn, hasvk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)

View File

@@ -458,6 +458,13 @@ vn_BindBufferMemory2(VkDevice device,
vn_async_vkBindBufferMemory2(dev->primary_ring, device, bindInfoCount,
pBindInfos);
for (uint32_t i = 0; i < bindInfoCount; i++) {
const VkBindMemoryStatus *bind_status =
vk_find_struct((void *)pBindInfos[i].pNext, BIND_MEMORY_STATUS);
if (bind_status)
*bind_status->pResult = VK_SUCCESS;
}
return VK_SUCCESS;
}

View File

@@ -1249,6 +1249,15 @@ vn_CmdBindDescriptorSets(VkCommandBuffer commandBuffer,
dynamicOffsetCount, pDynamicOffsets);
}
void
vn_CmdBindDescriptorSets2(
VkCommandBuffer commandBuffer,
const VkBindDescriptorSetsInfo *pBindDescriptorSetsInfo)
{
VN_CMD_ENQUEUE(vkCmdBindDescriptorSets2, commandBuffer,
pBindDescriptorSetsInfo);
}
void
vn_CmdBindIndexBuffer(VkCommandBuffer commandBuffer,
VkBuffer buffer,
@@ -1906,6 +1915,13 @@ vn_CmdPushConstants(VkCommandBuffer commandBuffer,
offset, size, pValues);
}
void
vn_CmdPushConstants2(VkCommandBuffer commandBuffer,
const VkPushConstantsInfo *pPushConstantsInfo)
{
VN_CMD_ENQUEUE(vkCmdPushConstants2, commandBuffer, pPushConstantsInfo);
}
void
vn_CmdBeginRenderPass(VkCommandBuffer commandBuffer,
const VkRenderPassBeginInfo *pRenderPassBegin,
@@ -2309,6 +2325,33 @@ vn_CmdPushDescriptorSet(VkCommandBuffer commandBuffer,
STACK_ARRAY_FINISH(img_infos);
}
void
vkCmdPushDescriptorSet2(VkCommandBuffer commandBuffer,
const VkPushDescriptorSetInfo *pPushDescriptorSetInfo)
{
const uint32_t write_count = pPushDescriptorSetInfo->descriptorWriteCount;
const VkWriteDescriptorSet *desc_writes =
pPushDescriptorSetInfo->pDescriptorWrites;
const uint32_t img_info_count =
vn_descriptor_set_count_write_images(write_count, desc_writes);
STACK_ARRAY(VkWriteDescriptorSet, writes, write_count);
STACK_ARRAY(VkDescriptorImageInfo, img_infos, img_info_count);
struct vn_descriptor_set_writes local = {
.writes = writes,
.img_infos = img_infos,
};
desc_writes = vn_descriptor_set_get_writes(
write_count, desc_writes, pPushDescriptorSetInfo->layout, &local);
VkPushDescriptorSetInfo info = *pPushDescriptorSetInfo;
info.pDescriptorWrites = desc_writes;
VN_CMD_ENQUEUE(vkCmdPushDescriptorSet2, commandBuffer, &info);
STACK_ARRAY_FINISH(writes);
STACK_ARRAY_FINISH(img_infos);
}
void
vn_CmdPushDescriptorSetWithTemplate(
VkCommandBuffer commandBuffer,
@@ -2347,6 +2390,53 @@ vn_CmdPushDescriptorSetWithTemplate(
STACK_ARRAY_FINISH(iubs);
}
void
vkCmdPushDescriptorSetWithTemplate2(VkCommandBuffer commandBuffer,
const VkPushDescriptorSetWithTemplateInfo
*pPushDescriptorSetWithTemplateInfo)
{
struct vn_descriptor_update_template *templ =
vn_descriptor_update_template_from_handle(
pPushDescriptorSetWithTemplateInfo->descriptorUpdateTemplate);
STACK_ARRAY(VkWriteDescriptorSet, writes, templ->entry_count);
STACK_ARRAY(VkDescriptorImageInfo, img_infos, templ->img_info_count);
STACK_ARRAY(VkDescriptorBufferInfo, buf_infos, templ->buf_info_count);
STACK_ARRAY(VkBufferView, bview_handles, templ->bview_count);
STACK_ARRAY(VkWriteDescriptorSetInlineUniformBlock, iubs,
templ->iub_count);
struct vn_descriptor_set_update update = {
.writes = writes,
.img_infos = img_infos,
.buf_infos = buf_infos,
.bview_handles = bview_handles,
.iubs = iubs,
};
vn_descriptor_set_fill_update_with_template(
templ, VK_NULL_HANDLE, pPushDescriptorSetWithTemplateInfo->pData,
&update);
const VkPushDescriptorSetInfo info = {
.sType = VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO,
.pNext = pPushDescriptorSetWithTemplateInfo->pNext,
.stageFlags =
templ->push.pipeline_bind_point == VK_PIPELINE_BIND_POINT_GRAPHICS
? VK_SHADER_STAGE_ALL_GRAPHICS
: VK_SHADER_STAGE_COMPUTE_BIT,
.layout = pPushDescriptorSetWithTemplateInfo->layout,
.set = pPushDescriptorSetWithTemplateInfo->set,
.descriptorWriteCount = update.write_count,
.pDescriptorWrites = update.writes,
};
VN_CMD_ENQUEUE(vkCmdPushDescriptorSet2, commandBuffer, &info);
STACK_ARRAY_FINISH(writes);
STACK_ARRAY_FINISH(img_infos);
STACK_ARRAY_FINISH(buf_infos);
STACK_ARRAY_FINISH(bview_handles);
STACK_ARRAY_FINISH(iubs);
}
void
vn_CmdSetVertexInputEXT(
VkCommandBuffer commandBuffer,

View File

@@ -839,6 +839,14 @@ vn_BindImageMemory2(VkDevice device,
vn_async_vkBindImageMemory2(dev->primary_ring, device, bindInfoCount,
pBindInfos);
for (uint32_t i = 0; i < bindInfoCount; i++) {
const VkBindMemoryStatus *bind_status =
vk_find_struct((void *)pBindInfos[i].pNext, BIND_MEMORY_STATUS);
if (bind_status)
*bind_status->pResult = VK_SUCCESS;
}
return VK_SUCCESS;
}

View File

@@ -167,6 +167,7 @@ vn_physical_device_init_features(struct vn_physical_device *physical_dev)
VkPhysicalDeviceIndexTypeUint8Features index_type_uint8;
VkPhysicalDeviceLineRasterizationFeatures line_rasterization;
VkPhysicalDeviceMaintenance5Features maintenance_5;
VkPhysicalDeviceMaintenance6Features maintenance_6;
VkPhysicalDevicePipelineProtectedAccessFeatures
pipeline_protected_access;
VkPhysicalDevicePipelineRobustnessFeatures pipeline_robustness;
@@ -283,6 +284,7 @@ vn_physical_device_init_features(struct vn_physical_device *physical_dev)
VN_ADD_PNEXT_EXT(feats2, INDEX_TYPE_UINT8_FEATURES, local_feats.index_type_uint8, exts->KHR_index_type_uint8 || exts->EXT_index_type_uint8);
VN_ADD_PNEXT_EXT(feats2, LINE_RASTERIZATION_FEATURES, local_feats.line_rasterization, exts->KHR_line_rasterization || exts->EXT_line_rasterization);
VN_ADD_PNEXT_EXT(feats2, MAINTENANCE_5_FEATURES, local_feats.maintenance_5, exts->KHR_maintenance5);
VN_ADD_PNEXT_EXT(feats2, MAINTENANCE_6_FEATURES, local_feats.maintenance_6, exts->KHR_maintenance6);
VN_ADD_PNEXT_EXT(feats2, PIPELINE_PROTECTED_ACCESS_FEATURES, local_feats.pipeline_protected_access, exts->EXT_pipeline_protected_access);
VN_ADD_PNEXT_EXT(feats2, PIPELINE_ROBUSTNESS_FEATURES, local_feats.pipeline_robustness, exts->EXT_pipeline_robustness);
VN_ADD_PNEXT_EXT(feats2, SHADER_EXPECT_ASSUME_FEATURES, local_feats.shader_expect_assume, exts->KHR_shader_expect_assume);
@@ -499,6 +501,7 @@ vn_physical_device_init_properties(struct vn_physical_device *physical_dev)
/* Vulkan 1.4 */
VkPhysicalDeviceLineRasterizationProperties line_rasterization;
VkPhysicalDeviceMaintenance5Properties maintenance_5;
VkPhysicalDeviceMaintenance6Properties maintenance_6;
VkPhysicalDevicePipelineRobustnessProperties pipeline_robustness;
VkPhysicalDevicePushDescriptorProperties push_descriptor;
VkPhysicalDeviceVertexAttributeDivisorProperties
@@ -568,6 +571,7 @@ vn_physical_device_init_properties(struct vn_physical_device *physical_dev)
/* Vulkan 1.4 */
VN_ADD_PNEXT_EXT(props2, LINE_RASTERIZATION_PROPERTIES, local_props.line_rasterization, exts->KHR_line_rasterization || exts->EXT_line_rasterization);
VN_ADD_PNEXT_EXT(props2, MAINTENANCE_5_PROPERTIES, local_props.maintenance_5, exts->KHR_maintenance5);
VN_ADD_PNEXT_EXT(props2, MAINTENANCE_6_PROPERTIES, local_props.maintenance_6, exts->KHR_maintenance6);
VN_ADD_PNEXT_EXT(props2, PIPELINE_ROBUSTNESS_PROPERTIES, local_props.pipeline_robustness, exts->EXT_pipeline_robustness);
VN_ADD_PNEXT_EXT(props2, PUSH_DESCRIPTOR_PROPERTIES, local_props.push_descriptor, exts->KHR_push_descriptor);
VN_ADD_PNEXT_EXT(props2, VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES, local_props.vertex_attribute_divisor, exts->KHR_vertex_attribute_divisor);
@@ -636,6 +640,7 @@ vn_physical_device_init_properties(struct vn_physical_device *physical_dev)
/* Vulkan 1.4 */
VN_SET_VK_PROPS_EXT(props, &local_props.line_rasterization, exts->KHR_line_rasterization || exts->EXT_line_rasterization);
VN_SET_VK_PROPS_EXT(props, &local_props.maintenance_5, exts->KHR_maintenance5);
VN_SET_VK_PROPS_EXT(props, &local_props.maintenance_6, exts->KHR_maintenance6);
VN_SET_VK_PROPS_EXT(props, &local_props.pipeline_robustness, exts->EXT_pipeline_robustness);
VN_SET_VK_PROPS_EXT(props, &local_props.push_descriptor, exts->KHR_push_descriptor);
VN_SET_VK_PROPS_EXT(props, &local_props.vertex_attribute_divisor, exts->KHR_vertex_attribute_divisor);
@@ -1124,6 +1129,7 @@ vn_physical_device_get_passthrough_extensions(
.KHR_line_rasterization = true,
.KHR_load_store_op_none = true,
.KHR_maintenance5 = true,
.KHR_maintenance6 = true,
.KHR_push_descriptor = true,
.KHR_shader_expect_assume = true,
.KHR_shader_float_controls2 = true,