venus: Enable VK_EXT_private_data

Implement it as hybrid native/passthrough as a workaround until venus
learns how to deep surgery on pNext chains. Eventually, we want to
implement it purely natively. For details, see the big code comment.

See: https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/908
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Signed-off-by: Chad Versace <chadversary@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
This commit is contained in:
Chad Versace
2022-08-10 17:03:07 -07:00
committed by Marge Bot
parent 4d80ccbf2d
commit 2bf2a05312
3 changed files with 22 additions and 1 deletions

View File

@@ -488,7 +488,7 @@ Vulkan 1.3 -- all DONE: anv, radv, lvp
VK_EXT_inline_uniform_block DONE (anv, lvp, radv, v3dv, vn)
VK_EXT_pipeline_creation_cache_control DONE (anv, lvp, radv, tu, v3dv, vn)
VK_EXT_pipeline_creation_feedback DONE (anv, lvp, radv, tu, v3dv)
VK_EXT_private_data DONE (anv, lvp, pvr, radv, tu, v3dv)
VK_EXT_private_data DONE (anv, lvp, pvr, radv, tu, v3dv, vn)
VK_EXT_image_robustness DONE (anv, lvp, radv, tu, vn)
VK_EXT_shader_demote_to_helper_invocation DONE (anv, lvp, radv, tu, vn)
VK_EXT_subgroup_size_control DONE (anv, lvp, radv, tu, vn)

View File

@@ -178,6 +178,8 @@ vn_physical_device_init_features(struct vn_physical_device *physical_dev)
VN_ADD_EXT_TO_PNEXT(exts->EXT_primitive_topology_list_restart,
feats->primitive_topology_list_restart,
PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT, features2);
VN_ADD_EXT_TO_PNEXT(exts->EXT_private_data, feats->private_data,
PRIVATE_DATA_FEATURES, features2);
VN_ADD_EXT_TO_PNEXT(exts->EXT_provoking_vertex, feats->provoking_vertex,
PROVOKING_VERTEX_FEATURES_EXT, features2);
VN_ADD_EXT_TO_PNEXT(exts->EXT_robustness2, feats->robustness_2,
@@ -1098,6 +1100,23 @@ vn_physical_device_get_passthrough_extensions(
.EXT_index_type_uint8 = true,
.EXT_line_rasterization = true,
.EXT_primitive_topology_list_restart = true,
/* TODO(VK_EXT_private_data): Support natively.
*
* We support this extension with a hybrid native/passthrough model
* until we teach venus how to do deep surgery on pNext
* chains to (a) remove VkDevicePrivateDataCreateInfoEXT, (b) remove Vk
* VkPhysicalDevicePrivateDataFeaturesEXT, and (c) modify its bits in
* VkPhysicalDeviceVulkan13Features.
*
* For now, we implement the extension functions natively by using Mesa's
* commong implementation. We passthrough VkDevicePrivateDataCreateInfoEXT
* to the renderer, which is harmless. We passthrough the extension
* enablement and feature bits to the renderer because otherwise
* VkDevicePrivateDataCreateInfoEXT would cause invalid usage in the
* renderer. Therefore, even though we implement the extension natively,
* we expose the extension only if the renderer supports it too.
*/
.EXT_private_data = true,
.EXT_provoking_vertex = true,
.EXT_queue_family_foreign = true,
.EXT_robustness2 = true,
@@ -1697,6 +1716,7 @@ vn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
CASE(INLINE_UNIFORM_BLOCK_FEATURES, inline_uniform_block);
CASE(MAINTENANCE_4_FEATURES, maintenance4);
CASE(PIPELINE_CREATION_CACHE_CONTROL_FEATURES, pipeline_creation_cache_control);
CASE(PRIVATE_DATA_FEATURES, private_data);
CASE(SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES, shader_demote_to_helper_invocation);
CASE(SHADER_INTEGER_DOT_PRODUCT_FEATURES, shader_integer_dot_product);
CASE(SHADER_TERMINATE_INVOCATION_FEATURES, shader_terminate_invocation);

View File

@@ -32,6 +32,7 @@ struct vn_physical_device_features {
VkPhysicalDeviceMaintenance4Features maintenance4;
VkPhysicalDevicePipelineCreationCacheControlFeatures
pipeline_creation_cache_control;
VkPhysicalDevicePrivateDataFeatures private_data;
VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures
shader_demote_to_helper_invocation;
VkPhysicalDeviceShaderIntegerDotProductFeatures shader_integer_dot_product;