• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* This file is generated by venus-protocol.  See vn_protocol_renderer.h. */
2 
3 /*
4  * Copyright 2020 Google LLC
5  * SPDX-License-Identifier: MIT
6  */
7 
8 #ifndef VN_PROTOCOL_RENDERER_INFO_H
9 #define VN_PROTOCOL_RENDERER_INFO_H
10 
11 #include "vn_protocol_renderer_defines.h"
12 
13 struct vn_info_extension_table {
14    union {
15       bool enabled[99];
16       struct {
17          bool EXT_4444_formats;
18          bool EXT_calibrated_timestamps;
19          bool EXT_command_serialization;
20          bool EXT_conditional_rendering;
21          bool EXT_conservative_rasterization;
22          bool EXT_custom_border_color;
23          bool EXT_depth_clip_control;
24          bool EXT_depth_clip_enable;
25          bool EXT_descriptor_indexing;
26          bool EXT_extended_dynamic_state;
27          bool EXT_extended_dynamic_state2;
28          bool EXT_external_memory_dma_buf;
29          bool EXT_host_query_reset;
30          bool EXT_image_drm_format_modifier;
31          bool EXT_image_robustness;
32          bool EXT_image_view_min_lod;
33          bool EXT_index_type_uint8;
34          bool EXT_inline_uniform_block;
35          bool EXT_line_rasterization;
36          bool EXT_multi_draw;
37          bool EXT_mutable_descriptor_type;
38          bool EXT_pci_bus_info;
39          bool EXT_pipeline_creation_cache_control;
40          bool EXT_pipeline_creation_feedback;
41          bool EXT_primitive_topology_list_restart;
42          bool EXT_primitives_generated_query;
43          bool EXT_private_data;
44          bool EXT_provoking_vertex;
45          bool EXT_queue_family_foreign;
46          bool EXT_robustness2;
47          bool EXT_sampler_filter_minmax;
48          bool EXT_scalar_block_layout;
49          bool EXT_separate_stencil_usage;
50          bool EXT_shader_demote_to_helper_invocation;
51          bool EXT_shader_stencil_export;
52          bool EXT_shader_viewport_index_layer;
53          bool EXT_subgroup_size_control;
54          bool EXT_texel_buffer_alignment;
55          bool EXT_texture_compression_astc_hdr;
56          bool EXT_tooling_info;
57          bool EXT_transform_feedback;
58          bool EXT_vertex_attribute_divisor;
59          bool EXT_ycbcr_2plane_444_formats;
60          bool KHR_16bit_storage;
61          bool KHR_8bit_storage;
62          bool KHR_bind_memory2;
63          bool KHR_buffer_device_address;
64          bool KHR_copy_commands2;
65          bool KHR_create_renderpass2;
66          bool KHR_dedicated_allocation;
67          bool KHR_depth_stencil_resolve;
68          bool KHR_descriptor_update_template;
69          bool KHR_device_group;
70          bool KHR_device_group_creation;
71          bool KHR_draw_indirect_count;
72          bool KHR_driver_properties;
73          bool KHR_dynamic_rendering;
74          bool KHR_external_fence;
75          bool KHR_external_fence_capabilities;
76          bool KHR_external_fence_fd;
77          bool KHR_external_memory;
78          bool KHR_external_memory_capabilities;
79          bool KHR_external_memory_fd;
80          bool KHR_external_semaphore;
81          bool KHR_external_semaphore_capabilities;
82          bool KHR_external_semaphore_fd;
83          bool KHR_format_feature_flags2;
84          bool KHR_get_memory_requirements2;
85          bool KHR_get_physical_device_properties2;
86          bool KHR_image_format_list;
87          bool KHR_imageless_framebuffer;
88          bool KHR_maintenance1;
89          bool KHR_maintenance2;
90          bool KHR_maintenance3;
91          bool KHR_maintenance4;
92          bool KHR_multiview;
93          bool KHR_push_descriptor;
94          bool KHR_relaxed_block_layout;
95          bool KHR_sampler_mirror_clamp_to_edge;
96          bool KHR_sampler_ycbcr_conversion;
97          bool KHR_separate_depth_stencil_layouts;
98          bool KHR_shader_atomic_int64;
99          bool KHR_shader_draw_parameters;
100          bool KHR_shader_float16_int8;
101          bool KHR_shader_float_controls;
102          bool KHR_shader_integer_dot_product;
103          bool KHR_shader_non_semantic_info;
104          bool KHR_shader_subgroup_extended_types;
105          bool KHR_shader_terminate_invocation;
106          bool KHR_spirv_1_4;
107          bool KHR_storage_buffer_storage_class;
108          bool KHR_synchronization2;
109          bool KHR_timeline_semaphore;
110          bool KHR_uniform_buffer_standard_layout;
111          bool KHR_variable_pointers;
112          bool KHR_vulkan_memory_model;
113          bool KHR_zero_initialize_workgroup_memory;
114          bool MESA_venus_protocol;
115          bool VALVE_mutable_descriptor_type;
116       };
117    };
118 };
119 
120 #define VN_INFO_EXTENSION_MAX_NUMBER (495)
121 
122 struct vn_info_extension {
123    const char *name;
124    uint32_t number;
125    uint32_t spec_version;
126 };
127 
128 /* sorted by extension names for bsearch */
129 static const uint32_t _vn_info_extension_count = 99;
130 static const struct vn_info_extension _vn_info_extensions[99] = {
131    { "VK_EXT_4444_formats", 341, 1 },
132    { "VK_EXT_calibrated_timestamps", 185, 2 },
133    { "VK_EXT_command_serialization", 384, 0 },
134    { "VK_EXT_conditional_rendering", 82, 2 },
135    { "VK_EXT_conservative_rasterization", 102, 1 },
136    { "VK_EXT_custom_border_color", 288, 12 },
137    { "VK_EXT_depth_clip_control", 356, 1 },
138    { "VK_EXT_depth_clip_enable", 103, 1 },
139    { "VK_EXT_descriptor_indexing", 162, 2 },
140    { "VK_EXT_extended_dynamic_state", 268, 1 },
141    { "VK_EXT_extended_dynamic_state2", 378, 1 },
142    { "VK_EXT_external_memory_dma_buf", 126, 1 },
143    { "VK_EXT_host_query_reset", 262, 1 },
144    { "VK_EXT_image_drm_format_modifier", 159, 2 },
145    { "VK_EXT_image_robustness", 336, 1 },
146    { "VK_EXT_image_view_min_lod", 392, 1 },
147    { "VK_EXT_index_type_uint8", 266, 1 },
148    { "VK_EXT_inline_uniform_block", 139, 1 },
149    { "VK_EXT_line_rasterization", 260, 1 },
150    { "VK_EXT_multi_draw", 393, 1 },
151    { "VK_EXT_mutable_descriptor_type", 495, 1 },
152    { "VK_EXT_pci_bus_info", 213, 2 },
153    { "VK_EXT_pipeline_creation_cache_control", 298, 3 },
154    { "VK_EXT_pipeline_creation_feedback", 193, 1 },
155    { "VK_EXT_primitive_topology_list_restart", 357, 1 },
156    { "VK_EXT_primitives_generated_query", 383, 1 },
157    { "VK_EXT_private_data", 296, 1 },
158    { "VK_EXT_provoking_vertex", 255, 1 },
159    { "VK_EXT_queue_family_foreign", 127, 1 },
160    { "VK_EXT_robustness2", 287, 1 },
161    { "VK_EXT_sampler_filter_minmax", 131, 2 },
162    { "VK_EXT_scalar_block_layout", 222, 1 },
163    { "VK_EXT_separate_stencil_usage", 247, 1 },
164    { "VK_EXT_shader_demote_to_helper_invocation", 277, 1 },
165    { "VK_EXT_shader_stencil_export", 141, 1 },
166    { "VK_EXT_shader_viewport_index_layer", 163, 1 },
167    { "VK_EXT_subgroup_size_control", 226, 2 },
168    { "VK_EXT_texel_buffer_alignment", 282, 1 },
169    { "VK_EXT_texture_compression_astc_hdr", 67, 1 },
170    { "VK_EXT_tooling_info", 246, 1 },
171    { "VK_EXT_transform_feedback", 29, 1 },
172    { "VK_EXT_vertex_attribute_divisor", 191, 3 },
173    { "VK_EXT_ycbcr_2plane_444_formats", 331, 1 },
174    { "VK_KHR_16bit_storage", 84, 1 },
175    { "VK_KHR_8bit_storage", 178, 1 },
176    { "VK_KHR_bind_memory2", 158, 1 },
177    { "VK_KHR_buffer_device_address", 258, 1 },
178    { "VK_KHR_copy_commands2", 338, 1 },
179    { "VK_KHR_create_renderpass2", 110, 1 },
180    { "VK_KHR_dedicated_allocation", 128, 3 },
181    { "VK_KHR_depth_stencil_resolve", 200, 1 },
182    { "VK_KHR_descriptor_update_template", 86, 1 },
183    { "VK_KHR_device_group", 61, 4 },
184    { "VK_KHR_device_group_creation", 71, 1 },
185    { "VK_KHR_draw_indirect_count", 170, 1 },
186    { "VK_KHR_driver_properties", 197, 1 },
187    { "VK_KHR_dynamic_rendering", 45, 1 },
188    { "VK_KHR_external_fence", 114, 1 },
189    { "VK_KHR_external_fence_capabilities", 113, 1 },
190    { "VK_KHR_external_fence_fd", 116, 1 },
191    { "VK_KHR_external_memory", 73, 1 },
192    { "VK_KHR_external_memory_capabilities", 72, 1 },
193    { "VK_KHR_external_memory_fd", 75, 1 },
194    { "VK_KHR_external_semaphore", 78, 1 },
195    { "VK_KHR_external_semaphore_capabilities", 77, 1 },
196    { "VK_KHR_external_semaphore_fd", 80, 1 },
197    { "VK_KHR_format_feature_flags2", 361, 2 },
198    { "VK_KHR_get_memory_requirements2", 147, 1 },
199    { "VK_KHR_get_physical_device_properties2", 60, 2 },
200    { "VK_KHR_image_format_list", 148, 1 },
201    { "VK_KHR_imageless_framebuffer", 109, 1 },
202    { "VK_KHR_maintenance1", 70, 2 },
203    { "VK_KHR_maintenance2", 118, 1 },
204    { "VK_KHR_maintenance3", 169, 1 },
205    { "VK_KHR_maintenance4", 414, 2 },
206    { "VK_KHR_multiview", 54, 1 },
207    { "VK_KHR_push_descriptor", 81, 2 },
208    { "VK_KHR_relaxed_block_layout", 145, 1 },
209    { "VK_KHR_sampler_mirror_clamp_to_edge", 15, 3 },
210    { "VK_KHR_sampler_ycbcr_conversion", 157, 14 },
211    { "VK_KHR_separate_depth_stencil_layouts", 242, 1 },
212    { "VK_KHR_shader_atomic_int64", 181, 1 },
213    { "VK_KHR_shader_draw_parameters", 64, 1 },
214    { "VK_KHR_shader_float16_int8", 83, 1 },
215    { "VK_KHR_shader_float_controls", 198, 4 },
216    { "VK_KHR_shader_integer_dot_product", 281, 1 },
217    { "VK_KHR_shader_non_semantic_info", 294, 1 },
218    { "VK_KHR_shader_subgroup_extended_types", 176, 1 },
219    { "VK_KHR_shader_terminate_invocation", 216, 1 },
220    { "VK_KHR_spirv_1_4", 237, 1 },
221    { "VK_KHR_storage_buffer_storage_class", 132, 1 },
222    { "VK_KHR_synchronization2", 315, 1 },
223    { "VK_KHR_timeline_semaphore", 208, 2 },
224    { "VK_KHR_uniform_buffer_standard_layout", 254, 1 },
225    { "VK_KHR_variable_pointers", 121, 1 },
226    { "VK_KHR_vulkan_memory_model", 212, 3 },
227    { "VK_KHR_zero_initialize_workgroup_memory", 326, 1 },
228    { "VK_MESA_venus_protocol", 385, 100000 },
229    { "VK_VALVE_mutable_descriptor_type", 352, 1 },
230 };
231 
232 static inline uint32_t
vn_info_wire_format_version(void)233 vn_info_wire_format_version(void)
234 {
235     return 0;
236 }
237 
238 static inline uint32_t
vn_info_vk_xml_version(void)239 vn_info_vk_xml_version(void)
240 {
241     return VK_MAKE_API_VERSION(0, 1, 3, 228);
242 }
243 
244 static inline int
vn_info_extension_compare(const void * name,const void * ext)245 vn_info_extension_compare(const void *name, const void *ext)
246 {
247    return strcmp(name, ((const struct vn_info_extension *)ext)->name);
248 }
249 
250 static inline int32_t
vn_info_extension_index(const char * name)251 vn_info_extension_index(const char *name)
252 {
253    const struct vn_info_extension *ext = bsearch(name, _vn_info_extensions,
254       _vn_info_extension_count, sizeof(*_vn_info_extensions),
255       vn_info_extension_compare);
256    return ext ? ext - _vn_info_extensions : -1;
257 }
258 
259 static inline const struct vn_info_extension *
vn_info_extension_get(int32_t index)260 vn_info_extension_get(int32_t index)
261 {
262    assert(index >= 0 && (uint32_t)index < _vn_info_extension_count);
263    return &_vn_info_extensions[index];
264 }
265 
266 static inline void
vn_info_extension_mask_init(uint32_t * out_mask)267 vn_info_extension_mask_init(uint32_t *out_mask)
268 {
269    for (uint32_t i = 0; i < _vn_info_extension_count; i++) {
270        out_mask[_vn_info_extensions[i].number / 32] |= 1 << (_vn_info_extensions[i].number % 32);
271    }
272 }
273 
274 #endif /* VN_PROTOCOL_RENDERER_INFO_H */
275