1 /* This file is generated by venus-protocol. See vn_protocol_driver.h. */
2
3 /*
4 * Copyright 2020 Google LLC
5 * SPDX-License-Identifier: MIT
6 */
7
8 #ifndef VN_PROTOCOL_DRIVER_INFO_H
9 #define VN_PROTOCOL_DRIVER_INFO_H
10
11 #include "vn_protocol_driver_defines.h"
12
13 #define VN_INFO_EXTENSION_MAX_NUMBER (500)
14
15 struct vn_info_extension {
16 const char *name;
17 uint32_t number;
18 uint32_t spec_version;
19 };
20
21 /* sorted by extension names for bsearch */
22 static const uint32_t _vn_info_extension_count = 118;
23 static const struct vn_info_extension _vn_info_extensions[118] = {
24 { "VK_EXT_4444_formats", 341, 1 },
25 { "VK_EXT_attachment_feedback_loop_layout", 340, 2 },
26 { "VK_EXT_border_color_swizzle", 412, 1 },
27 { "VK_EXT_calibrated_timestamps", 185, 2 },
28 { "VK_EXT_color_write_enable", 382, 1 },
29 { "VK_EXT_command_serialization", 384, 1 },
30 { "VK_EXT_conditional_rendering", 82, 2 },
31 { "VK_EXT_conservative_rasterization", 102, 1 },
32 { "VK_EXT_custom_border_color", 288, 12 },
33 { "VK_EXT_depth_clip_control", 356, 1 },
34 { "VK_EXT_depth_clip_enable", 103, 1 },
35 { "VK_EXT_descriptor_indexing", 162, 2 },
36 { "VK_EXT_dynamic_rendering_unused_attachments", 500, 1 },
37 { "VK_EXT_extended_dynamic_state", 268, 1 },
38 { "VK_EXT_extended_dynamic_state2", 378, 1 },
39 { "VK_EXT_extended_dynamic_state3", 456, 2 },
40 { "VK_EXT_external_memory_acquire_unmodified", 454, 1 },
41 { "VK_EXT_external_memory_dma_buf", 126, 1 },
42 { "VK_EXT_fragment_shader_interlock", 252, 1 },
43 { "VK_EXT_graphics_pipeline_library", 321, 1 },
44 { "VK_EXT_host_query_reset", 262, 1 },
45 { "VK_EXT_image_2d_view_of_3d", 394, 1 },
46 { "VK_EXT_image_drm_format_modifier", 159, 2 },
47 { "VK_EXT_image_robustness", 336, 1 },
48 { "VK_EXT_image_view_min_lod", 392, 1 },
49 { "VK_EXT_index_type_uint8", 266, 1 },
50 { "VK_EXT_inline_uniform_block", 139, 1 },
51 { "VK_EXT_line_rasterization", 260, 1 },
52 { "VK_EXT_load_store_op_none", 401, 1 },
53 { "VK_EXT_memory_budget", 238, 1 },
54 { "VK_EXT_multi_draw", 393, 1 },
55 { "VK_EXT_mutable_descriptor_type", 495, 1 },
56 { "VK_EXT_non_seamless_cube_map", 423, 1 },
57 { "VK_EXT_pci_bus_info", 213, 2 },
58 { "VK_EXT_pipeline_creation_cache_control", 298, 3 },
59 { "VK_EXT_pipeline_creation_feedback", 193, 1 },
60 { "VK_EXT_primitive_topology_list_restart", 357, 1 },
61 { "VK_EXT_primitives_generated_query", 383, 1 },
62 { "VK_EXT_private_data", 296, 1 },
63 { "VK_EXT_provoking_vertex", 255, 1 },
64 { "VK_EXT_queue_family_foreign", 127, 1 },
65 { "VK_EXT_rasterization_order_attachment_access", 464, 1 },
66 { "VK_EXT_robustness2", 287, 1 },
67 { "VK_EXT_sampler_filter_minmax", 131, 2 },
68 { "VK_EXT_scalar_block_layout", 222, 1 },
69 { "VK_EXT_separate_stencil_usage", 247, 1 },
70 { "VK_EXT_shader_demote_to_helper_invocation", 277, 1 },
71 { "VK_EXT_shader_stencil_export", 141, 1 },
72 { "VK_EXT_shader_subgroup_ballot", 65, 1 },
73 { "VK_EXT_shader_viewport_index_layer", 163, 1 },
74 { "VK_EXT_subgroup_size_control", 226, 2 },
75 { "VK_EXT_texel_buffer_alignment", 282, 1 },
76 { "VK_EXT_texture_compression_astc_hdr", 67, 1 },
77 { "VK_EXT_tooling_info", 246, 1 },
78 { "VK_EXT_transform_feedback", 29, 1 },
79 { "VK_EXT_vertex_attribute_divisor", 191, 3 },
80 { "VK_EXT_vertex_input_dynamic_state", 353, 2 },
81 { "VK_EXT_ycbcr_2plane_444_formats", 331, 1 },
82 { "VK_KHR_16bit_storage", 84, 1 },
83 { "VK_KHR_8bit_storage", 178, 1 },
84 { "VK_KHR_bind_memory2", 158, 1 },
85 { "VK_KHR_buffer_device_address", 258, 1 },
86 { "VK_KHR_copy_commands2", 338, 1 },
87 { "VK_KHR_create_renderpass2", 110, 1 },
88 { "VK_KHR_dedicated_allocation", 128, 3 },
89 { "VK_KHR_depth_stencil_resolve", 200, 1 },
90 { "VK_KHR_descriptor_update_template", 86, 1 },
91 { "VK_KHR_device_group", 61, 4 },
92 { "VK_KHR_device_group_creation", 71, 1 },
93 { "VK_KHR_draw_indirect_count", 170, 1 },
94 { "VK_KHR_driver_properties", 197, 1 },
95 { "VK_KHR_dynamic_rendering", 45, 1 },
96 { "VK_KHR_external_fence", 114, 1 },
97 { "VK_KHR_external_fence_capabilities", 113, 1 },
98 { "VK_KHR_external_fence_fd", 116, 1 },
99 { "VK_KHR_external_memory", 73, 1 },
100 { "VK_KHR_external_memory_capabilities", 72, 1 },
101 { "VK_KHR_external_memory_fd", 75, 1 },
102 { "VK_KHR_external_semaphore", 78, 1 },
103 { "VK_KHR_external_semaphore_capabilities", 77, 1 },
104 { "VK_KHR_external_semaphore_fd", 80, 1 },
105 { "VK_KHR_format_feature_flags2", 361, 2 },
106 { "VK_KHR_fragment_shading_rate", 227, 2 },
107 { "VK_KHR_get_memory_requirements2", 147, 1 },
108 { "VK_KHR_get_physical_device_properties2", 60, 2 },
109 { "VK_KHR_image_format_list", 148, 1 },
110 { "VK_KHR_imageless_framebuffer", 109, 1 },
111 { "VK_KHR_maintenance1", 70, 2 },
112 { "VK_KHR_maintenance2", 118, 1 },
113 { "VK_KHR_maintenance3", 169, 1 },
114 { "VK_KHR_maintenance4", 414, 2 },
115 { "VK_KHR_maintenance5", 471, 1 },
116 { "VK_KHR_multiview", 54, 1 },
117 { "VK_KHR_pipeline_library", 291, 1 },
118 { "VK_KHR_push_descriptor", 81, 2 },
119 { "VK_KHR_relaxed_block_layout", 145, 1 },
120 { "VK_KHR_sampler_mirror_clamp_to_edge", 15, 3 },
121 { "VK_KHR_sampler_ycbcr_conversion", 157, 14 },
122 { "VK_KHR_separate_depth_stencil_layouts", 242, 1 },
123 { "VK_KHR_shader_atomic_int64", 181, 1 },
124 { "VK_KHR_shader_clock", 182, 1 },
125 { "VK_KHR_shader_draw_parameters", 64, 1 },
126 { "VK_KHR_shader_float16_int8", 83, 1 },
127 { "VK_KHR_shader_float_controls", 198, 4 },
128 { "VK_KHR_shader_integer_dot_product", 281, 1 },
129 { "VK_KHR_shader_non_semantic_info", 294, 1 },
130 { "VK_KHR_shader_subgroup_extended_types", 176, 1 },
131 { "VK_KHR_shader_terminate_invocation", 216, 1 },
132 { "VK_KHR_spirv_1_4", 237, 1 },
133 { "VK_KHR_storage_buffer_storage_class", 132, 1 },
134 { "VK_KHR_synchronization2", 315, 1 },
135 { "VK_KHR_timeline_semaphore", 208, 2 },
136 { "VK_KHR_uniform_buffer_standard_layout", 254, 1 },
137 { "VK_KHR_variable_pointers", 121, 1 },
138 { "VK_KHR_vulkan_memory_model", 212, 3 },
139 { "VK_KHR_zero_initialize_workgroup_memory", 326, 1 },
140 { "VK_MESA_venus_protocol", 385, 2 },
141 { "VK_VALVE_mutable_descriptor_type", 352, 1 },
142 };
143
144 static inline uint32_t
vn_info_wire_format_version(void)145 vn_info_wire_format_version(void)
146 {
147 return 1;
148 }
149
150 static inline uint32_t
vn_info_vk_xml_version(void)151 vn_info_vk_xml_version(void)
152 {
153 return VK_MAKE_API_VERSION(0, 1, 3, 269);
154 }
155
156 static inline int
vn_info_extension_compare(const void * name,const void * ext)157 vn_info_extension_compare(const void *name, const void *ext)
158 {
159 return strcmp(name, ((const struct vn_info_extension *)ext)->name);
160 }
161
162 static inline int32_t
vn_info_extension_index(const char * name)163 vn_info_extension_index(const char *name)
164 {
165 const struct vn_info_extension *ext = bsearch(name, _vn_info_extensions,
166 _vn_info_extension_count, sizeof(*_vn_info_extensions),
167 vn_info_extension_compare);
168 return ext ? ext - _vn_info_extensions : -1;
169 }
170
171 static inline const struct vn_info_extension *
vn_info_extension_get(int32_t index)172 vn_info_extension_get(int32_t index)
173 {
174 assert(index >= 0 && (uint32_t)index < _vn_info_extension_count);
175 return &_vn_info_extensions[index];
176 }
177
178 static inline bool
vn_info_extension_mask_test(const uint32_t * mask,uint32_t ext_number)179 vn_info_extension_mask_test(const uint32_t *mask, uint32_t ext_number)
180 {
181 return mask[ext_number / 32] & (1 << (ext_number % 32));
182 }
183
184 #endif /* VN_PROTOCOL_DRIVER_INFO_H */
185