Commit ce84b1c3 authored by Chia-I Wu's avatar Chia-I Wu Committed by Marge Bot
Browse files

venus: update venus-protocol headers

This requires vn_extension_get_spec_version to be updated as well.

Part-of: <mesa/mesa!15498>
parent 5d188274
/* This file is generated by venus-protocol git-2f119241. */
/* This file is generated by venus-protocol git-3f642c37. */
/*
* Copyright 2020 Google LLC
......
......@@ -325,6 +325,8 @@ typedef enum VkCommandTypeEXT {
VK_COMMAND_TYPE_vkCmdDrawIndirectByteCountEXT_EXT = 186,
VK_COMMAND_TYPE_vkGetMemoryFdKHR_EXT = 193,
VK_COMMAND_TYPE_vkGetMemoryFdPropertiesKHR_EXT = 194,
VK_COMMAND_TYPE_vkImportFenceFdKHR_EXT = 238,
VK_COMMAND_TYPE_vkGetFenceFdKHR_EXT = 239,
VK_COMMAND_TYPE_vkGetImageDrmFormatModifierPropertiesEXT_EXT = 187,
VK_COMMAND_TYPE_vkCmdSetPatchControlPointsEXT_EXT = 233,
VK_COMMAND_TYPE_vkCmdSetLogicOpEXT_EXT = 234,
......
......@@ -11,6 +11,12 @@
#include "vn_instance.h"
#include "vn_protocol_driver_structs.h"
/*
* These structs/unions/commands are not included
*
* vkGetFenceFdKHR
*/
/* struct VkExportFenceCreateInfo chain */
static inline size_t
......
......@@ -11,12 +11,103 @@
#include "vn_protocol_driver_defines.h"
struct vn_info_extension {
uint32_t index;
const char *name;
uint32_t number;
uint32_t spec_version;
};
/* sorted by extension names for bsearch */
static const uint32_t _vn_info_extension_count = 87;
static const struct vn_info_extension _vn_info_extensions[87] = {
{ "VK_EXT_4444_formats", 341, 1 },
{ "VK_EXT_calibrated_timestamps", 185, 2 },
{ "VK_EXT_command_serialization", 384, 0 },
{ "VK_EXT_conservative_rasterization", 102, 1 },
{ "VK_EXT_custom_border_color", 288, 12 },
{ "VK_EXT_depth_clip_enable", 103, 1 },
{ "VK_EXT_descriptor_indexing", 162, 2 },
{ "VK_EXT_extended_dynamic_state", 268, 1 },
{ "VK_EXT_extended_dynamic_state2", 378, 1 },
{ "VK_EXT_external_memory_dma_buf", 126, 1 },
{ "VK_EXT_host_query_reset", 262, 1 },
{ "VK_EXT_image_drm_format_modifier", 159, 2 },
{ "VK_EXT_image_robustness", 336, 1 },
{ "VK_EXT_inline_uniform_block", 139, 1 },
{ "VK_EXT_line_rasterization", 260, 1 },
{ "VK_EXT_pipeline_creation_cache_control", 298, 3 },
{ "VK_EXT_pipeline_creation_feedback", 193, 1 },
{ "VK_EXT_private_data", 296, 1 },
{ "VK_EXT_provoking_vertex", 255, 1 },
{ "VK_EXT_queue_family_foreign", 127, 1 },
{ "VK_EXT_robustness2", 287, 1 },
{ "VK_EXT_sampler_filter_minmax", 131, 2 },
{ "VK_EXT_scalar_block_layout", 222, 1 },
{ "VK_EXT_separate_stencil_usage", 247, 1 },
{ "VK_EXT_shader_demote_to_helper_invocation", 277, 1 },
{ "VK_EXT_shader_stencil_export", 141, 1 },
{ "VK_EXT_shader_viewport_index_layer", 163, 1 },
{ "VK_EXT_subgroup_size_control", 226, 2 },
{ "VK_EXT_texel_buffer_alignment", 282, 1 },
{ "VK_EXT_texture_compression_astc_hdr", 67, 1 },
{ "VK_EXT_tooling_info", 246, 1 },
{ "VK_EXT_transform_feedback", 29, 1 },
{ "VK_EXT_vertex_attribute_divisor", 191, 3 },
{ "VK_EXT_ycbcr_2plane_444_formats", 331, 1 },
{ "VK_KHR_16bit_storage", 84, 1 },
{ "VK_KHR_8bit_storage", 178, 1 },
{ "VK_KHR_bind_memory2", 158, 1 },
{ "VK_KHR_buffer_device_address", 258, 1 },
{ "VK_KHR_copy_commands2", 338, 1 },
{ "VK_KHR_create_renderpass2", 110, 1 },
{ "VK_KHR_dedicated_allocation", 128, 3 },
{ "VK_KHR_depth_stencil_resolve", 200, 1 },
{ "VK_KHR_descriptor_update_template", 86, 1 },
{ "VK_KHR_device_group", 61, 4 },
{ "VK_KHR_device_group_creation", 71, 1 },
{ "VK_KHR_draw_indirect_count", 170, 1 },
{ "VK_KHR_driver_properties", 197, 1 },
{ "VK_KHR_dynamic_rendering", 45, 1 },
{ "VK_KHR_external_fence", 114, 1 },
{ "VK_KHR_external_fence_capabilities", 113, 1 },
{ "VK_KHR_external_fence_fd", 116, 1 },
{ "VK_KHR_external_memory", 73, 1 },
{ "VK_KHR_external_memory_capabilities", 72, 1 },
{ "VK_KHR_external_memory_fd", 75, 1 },
{ "VK_KHR_external_semaphore", 78, 1 },
{ "VK_KHR_external_semaphore_capabilities", 77, 1 },
{ "VK_KHR_format_feature_flags2", 361, 1 },
{ "VK_KHR_get_memory_requirements2", 147, 1 },
{ "VK_KHR_get_physical_device_properties2", 60, 2 },
{ "VK_KHR_image_format_list", 148, 1 },
{ "VK_KHR_imageless_framebuffer", 109, 1 },
{ "VK_KHR_maintenance1", 70, 2 },
{ "VK_KHR_maintenance2", 118, 1 },
{ "VK_KHR_maintenance3", 169, 1 },
{ "VK_KHR_maintenance4", 414, 2 },
{ "VK_KHR_multiview", 54, 1 },
{ "VK_KHR_relaxed_block_layout", 145, 1 },
{ "VK_KHR_sampler_mirror_clamp_to_edge", 15, 3 },
{ "VK_KHR_sampler_ycbcr_conversion", 157, 14 },
{ "VK_KHR_separate_depth_stencil_layouts", 242, 1 },
{ "VK_KHR_shader_atomic_int64", 181, 1 },
{ "VK_KHR_shader_draw_parameters", 64, 1 },
{ "VK_KHR_shader_float16_int8", 83, 1 },
{ "VK_KHR_shader_float_controls", 198, 4 },
{ "VK_KHR_shader_integer_dot_product", 281, 1 },
{ "VK_KHR_shader_non_semantic_info", 294, 1 },
{ "VK_KHR_shader_subgroup_extended_types", 176, 1 },
{ "VK_KHR_shader_terminate_invocation", 216, 1 },
{ "VK_KHR_spirv_1_4", 237, 1 },
{ "VK_KHR_storage_buffer_storage_class", 132, 1 },
{ "VK_KHR_synchronization2", 315, 1 },
{ "VK_KHR_timeline_semaphore", 208, 2 },
{ "VK_KHR_uniform_buffer_standard_layout", 254, 1 },
{ "VK_KHR_variable_pointers", 121, 1 },
{ "VK_KHR_vulkan_memory_model", 212, 3 },
{ "VK_KHR_zero_initialize_workgroup_memory", 326, 1 },
{ "VK_MESA_venus_protocol", 385, 100000 },
};
static inline uint32_t
vn_info_wire_format_version(void)
{
......@@ -35,100 +126,20 @@ vn_info_extension_compare(const void *name, const void *ext)
return strcmp(name, ((const struct vn_info_extension *)ext)->name);
}
static inline const struct vn_info_extension *
vn_info_extension_get(const char *name)
static inline int32_t
vn_info_extension_index(const char *name)
{
static const struct vn_info_extension vn_info_extensions[86] = {
{ 0, "VK_EXT_4444_formats", 1 },
{ 1, "VK_EXT_calibrated_timestamps", 2 },
{ 2, "VK_EXT_command_serialization", 0 },
{ 3, "VK_EXT_conservative_rasterization", 1 },
{ 4, "VK_EXT_custom_border_color", 12 },
{ 5, "VK_EXT_depth_clip_enable", 1 },
{ 6, "VK_EXT_descriptor_indexing", 2 },
{ 7, "VK_EXT_extended_dynamic_state", 1 },
{ 8, "VK_EXT_extended_dynamic_state2", 1 },
{ 9, "VK_EXT_external_memory_dma_buf", 1 },
{ 10, "VK_EXT_host_query_reset", 1 },
{ 11, "VK_EXT_image_drm_format_modifier", 2 },
{ 12, "VK_EXT_image_robustness", 1 },
{ 13, "VK_EXT_inline_uniform_block", 1 },
{ 14, "VK_EXT_line_rasterization", 1 },
{ 15, "VK_EXT_pipeline_creation_cache_control", 3 },
{ 16, "VK_EXT_pipeline_creation_feedback", 1 },
{ 17, "VK_EXT_private_data", 1 },
{ 18, "VK_EXT_provoking_vertex", 1 },
{ 19, "VK_EXT_queue_family_foreign", 1 },
{ 20, "VK_EXT_robustness2", 1 },
{ 21, "VK_EXT_sampler_filter_minmax", 2 },
{ 22, "VK_EXT_scalar_block_layout", 1 },
{ 23, "VK_EXT_separate_stencil_usage", 1 },
{ 24, "VK_EXT_shader_demote_to_helper_invocation", 1 },
{ 25, "VK_EXT_shader_stencil_export", 1 },
{ 26, "VK_EXT_shader_viewport_index_layer", 1 },
{ 27, "VK_EXT_subgroup_size_control", 2 },
{ 28, "VK_EXT_texel_buffer_alignment", 1 },
{ 29, "VK_EXT_texture_compression_astc_hdr", 1 },
{ 30, "VK_EXT_tooling_info", 1 },
{ 31, "VK_EXT_transform_feedback", 1 },
{ 32, "VK_EXT_vertex_attribute_divisor", 3 },
{ 33, "VK_EXT_ycbcr_2plane_444_formats", 1 },
{ 34, "VK_KHR_16bit_storage", 1 },
{ 35, "VK_KHR_8bit_storage", 1 },
{ 36, "VK_KHR_bind_memory2", 1 },
{ 37, "VK_KHR_buffer_device_address", 1 },
{ 38, "VK_KHR_copy_commands2", 1 },
{ 39, "VK_KHR_create_renderpass2", 1 },
{ 40, "VK_KHR_dedicated_allocation", 3 },
{ 41, "VK_KHR_depth_stencil_resolve", 1 },
{ 42, "VK_KHR_descriptor_update_template", 1 },
{ 43, "VK_KHR_device_group", 4 },
{ 44, "VK_KHR_device_group_creation", 1 },
{ 45, "VK_KHR_draw_indirect_count", 1 },
{ 46, "VK_KHR_driver_properties", 1 },
{ 47, "VK_KHR_dynamic_rendering", 1 },
{ 48, "VK_KHR_external_fence", 1 },
{ 49, "VK_KHR_external_fence_capabilities", 1 },
{ 50, "VK_KHR_external_memory", 1 },
{ 51, "VK_KHR_external_memory_capabilities", 1 },
{ 52, "VK_KHR_external_memory_fd", 1 },
{ 53, "VK_KHR_external_semaphore", 1 },
{ 54, "VK_KHR_external_semaphore_capabilities", 1 },
{ 55, "VK_KHR_format_feature_flags2", 1 },
{ 56, "VK_KHR_get_memory_requirements2", 1 },
{ 57, "VK_KHR_get_physical_device_properties2", 2 },
{ 58, "VK_KHR_image_format_list", 1 },
{ 59, "VK_KHR_imageless_framebuffer", 1 },
{ 60, "VK_KHR_maintenance1", 2 },
{ 61, "VK_KHR_maintenance2", 1 },
{ 62, "VK_KHR_maintenance3", 1 },
{ 63, "VK_KHR_maintenance4", 2 },
{ 64, "VK_KHR_multiview", 1 },
{ 65, "VK_KHR_relaxed_block_layout", 1 },
{ 66, "VK_KHR_sampler_mirror_clamp_to_edge", 3 },
{ 67, "VK_KHR_sampler_ycbcr_conversion", 14 },
{ 68, "VK_KHR_separate_depth_stencil_layouts", 1 },
{ 69, "VK_KHR_shader_atomic_int64", 1 },
{ 70, "VK_KHR_shader_draw_parameters", 1 },
{ 71, "VK_KHR_shader_float16_int8", 1 },
{ 72, "VK_KHR_shader_float_controls", 4 },
{ 73, "VK_KHR_shader_integer_dot_product", 1 },
{ 74, "VK_KHR_shader_non_semantic_info", 1 },
{ 75, "VK_KHR_shader_subgroup_extended_types", 1 },
{ 76, "VK_KHR_shader_terminate_invocation", 1 },
{ 77, "VK_KHR_spirv_1_4", 1 },
{ 78, "VK_KHR_storage_buffer_storage_class", 1 },
{ 79, "VK_KHR_synchronization2", 1 },
{ 80, "VK_KHR_timeline_semaphore", 2 },
{ 81, "VK_KHR_uniform_buffer_standard_layout", 1 },
{ 82, "VK_KHR_variable_pointers", 1 },
{ 83, "VK_KHR_vulkan_memory_model", 3 },
{ 84, "VK_KHR_zero_initialize_workgroup_memory", 1 },
{ 85, "VK_MESA_venus_protocol", 100000 },
};
const struct vn_info_extension *ext = bsearch(name, _vn_info_extensions,
_vn_info_extension_count, sizeof(*_vn_info_extensions),
vn_info_extension_compare);
return ext ? ext - _vn_info_extensions : -1;
}
return bsearch(name, vn_info_extensions, 86,
sizeof(*vn_info_extensions), vn_info_extension_compare);
static inline const struct vn_info_extension *
vn_info_extension_get(int32_t index)
{
assert(index >= 0 && (uint32_t)index < _vn_info_extension_count);
return &_vn_info_extensions[index];
}
#endif /* VN_PROTOCOL_DRIVER_INFO_H */
......@@ -74,8 +74,8 @@ vn_log_result(struct vn_instance *instance,
uint32_t
vn_extension_get_spec_version(const char *name)
{
const struct vn_info_extension *ext = vn_info_extension_get(name);
return ext ? ext->spec_version : 0;
const int32_t index = vn_info_extension_index(name);
return index >= 0 ? vn_info_extension_get(index)->spec_version : 0;
}
void
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment