@ -10,6 +10,75 @@
# include "vn_protocol_renderer_defines.h"
# include "vn_protocol_renderer_defines.h"
struct vn_info_extension_table {
union {
bool enabled [ 54 ] ;
struct {
bool EXT_command_serialization ;
bool EXT_descriptor_indexing ;
bool EXT_external_memory_dma_buf ;
bool EXT_host_query_reset ;
bool EXT_image_drm_format_modifier ;
bool EXT_queue_family_foreign ;
bool EXT_sampler_filter_minmax ;
bool EXT_scalar_block_layout ;
bool EXT_separate_stencil_usage ;
bool EXT_shader_viewport_index_layer ;
bool EXT_transform_feedback ;
bool KHR_16bit_storage ;
bool KHR_8bit_storage ;
bool KHR_bind_memory2 ;
bool KHR_buffer_device_address ;
bool KHR_create_renderpass2 ;
bool KHR_dedicated_allocation ;
bool KHR_depth_stencil_resolve ;
bool KHR_descriptor_update_template ;
bool KHR_device_group ;
bool KHR_device_group_creation ;
bool KHR_draw_indirect_count ;
bool KHR_driver_properties ;
bool KHR_external_fence ;
bool KHR_external_fence_capabilities ;
bool KHR_external_memory ;
bool KHR_external_memory_capabilities ;
bool KHR_external_memory_fd ;
bool KHR_external_semaphore ;
bool KHR_external_semaphore_capabilities ;
bool KHR_get_memory_requirements2 ;
bool KHR_get_physical_device_properties2 ;
bool KHR_image_format_list ;
bool KHR_imageless_framebuffer ;
bool KHR_maintenance1 ;
bool KHR_maintenance2 ;
bool KHR_maintenance3 ;
bool KHR_multiview ;
bool KHR_relaxed_block_layout ;
bool KHR_sampler_mirror_clamp_to_edge ;
bool KHR_sampler_ycbcr_conversion ;
bool KHR_separate_depth_stencil_layouts ;
bool KHR_shader_atomic_int64 ;
bool KHR_shader_draw_parameters ;
bool KHR_shader_float16_int8 ;
bool KHR_shader_float_controls ;
bool KHR_shader_subgroup_extended_types ;
bool KHR_spirv_1_4 ;
bool KHR_storage_buffer_storage_class ;
bool KHR_timeline_semaphore ;
bool KHR_uniform_buffer_standard_layout ;
bool KHR_variable_pointers ;
bool KHR_vulkan_memory_model ;
bool MESA_venus_protocol ;
} ;
} ;
} ;
struct vn_info_extension {
uint32_t index ;
const char * name ;
uint32_t spec_version ;
} ;
static inline uint32_t
static inline uint32_t
vn_info_wire_format_version ( void )
vn_info_wire_format_version ( void )
{
{
@ -23,133 +92,73 @@ vn_info_vk_xml_version(void)
}
}
static inline int
static inline int
vn_info_extension_compare ( const void * a , const void * b )
vn_info_extension_compare ( const void * n ame , const void * ext )
{
{
return strcmp ( a , * ( const char * * ) b ) ;
return strcmp ( name , ( ( const struct vn_info_extension * ) ext ) - > name ) ;
}
}
static inline uint32_t
static inline const struct vn_info_extension *
vn_info_extension_spec_version ( const char * name )
vn_info_extension_get ( const char * name )
{
{
static uint32_t ext_count = 54 ;
static const struct vn_info_extension vn_info_extensions [ 54 ] = {
static const char * ext_names [ 54 ] = {
{ 0 , " VK_EXT_command_serialization " , 0 } ,
" VK_EXT_command_serialization " ,
{ 1 , " VK_EXT_descriptor_indexing " , 2 } ,
" VK_EXT_descriptor_indexing " ,
{ 2 , " VK_EXT_external_memory_dma_buf " , 1 } ,
" VK_EXT_external_memory_dma_buf " ,
{ 3 , " VK_EXT_host_query_reset " , 1 } ,
" VK_EXT_host_query_reset " ,
{ 4 , " VK_EXT_image_drm_format_modifier " , 1 } ,
" VK_EXT_image_drm_format_modifier " ,
{ 5 , " VK_EXT_queue_family_foreign " , 1 } ,
" VK_EXT_queue_family_foreign " ,
{ 6 , " VK_EXT_sampler_filter_minmax " , 2 } ,
" VK_EXT_sampler_filter_minmax " ,
{ 7 , " VK_EXT_scalar_block_layout " , 1 } ,
" VK_EXT_scalar_block_layout " ,
{ 8 , " VK_EXT_separate_stencil_usage " , 1 } ,
" VK_EXT_separate_stencil_usage " ,
{ 9 , " VK_EXT_shader_viewport_index_layer " , 1 } ,
" VK_EXT_shader_viewport_index_layer " ,
{ 10 , " VK_EXT_transform_feedback " , 1 } ,
" VK_EXT_transform_feedback " ,
{ 11 , " VK_KHR_16bit_storage " , 1 } ,
" VK_KHR_16bit_storage " ,
{ 12 , " VK_KHR_8bit_storage " , 1 } ,
" VK_KHR_8bit_storage " ,
{ 13 , " VK_KHR_bind_memory2 " , 1 } ,
" VK_KHR_bind_memory2 " ,
{ 14 , " VK_KHR_buffer_device_address " , 1 } ,
" VK_KHR_buffer_device_address " ,
{ 15 , " VK_KHR_create_renderpass2 " , 1 } ,
" VK_KHR_create_renderpass2 " ,
{ 16 , " VK_KHR_dedicated_allocation " , 3 } ,
" VK_KHR_dedicated_allocation " ,
{ 17 , " VK_KHR_depth_stencil_resolve " , 1 } ,
" VK_KHR_depth_stencil_resolve " ,
{ 18 , " VK_KHR_descriptor_update_template " , 1 } ,
" VK_KHR_descriptor_update_template " ,
{ 19 , " VK_KHR_device_group " , 4 } ,
" VK_KHR_device_group " ,
{ 20 , " VK_KHR_device_group_creation " , 1 } ,
" VK_KHR_device_group_creation " ,
{ 21 , " VK_KHR_draw_indirect_count " , 1 } ,
" VK_KHR_draw_indirect_count " ,
{ 22 , " VK_KHR_driver_properties " , 1 } ,
" VK_KHR_driver_properties " ,
{ 23 , " VK_KHR_external_fence " , 1 } ,
" VK_KHR_external_fence " ,
{ 24 , " VK_KHR_external_fence_capabilities " , 1 } ,
" VK_KHR_external_fence_capabilities " ,
{ 25 , " VK_KHR_external_memory " , 1 } ,
" VK_KHR_external_memory " ,
{ 26 , " VK_KHR_external_memory_capabilities " , 1 } ,
" VK_KHR_external_memory_capabilities " ,
{ 27 , " VK_KHR_external_memory_fd " , 1 } ,
" VK_KHR_external_memory_fd " ,
{ 28 , " VK_KHR_external_semaphore " , 1 } ,
" VK_KHR_external_semaphore " ,
{ 29 , " VK_KHR_external_semaphore_capabilities " , 1 } ,
" VK_KHR_external_semaphore_capabilities " ,
{ 30 , " VK_KHR_get_memory_requirements2 " , 1 } ,
" VK_KHR_get_memory_requirements2 " ,
{ 31 , " VK_KHR_get_physical_device_properties2 " , 2 } ,
" VK_KHR_get_physical_device_properties2 " ,
{ 32 , " VK_KHR_image_format_list " , 1 } ,
" VK_KHR_image_format_list " ,
{ 33 , " VK_KHR_imageless_framebuffer " , 1 } ,
" VK_KHR_imageless_framebuffer " ,
{ 34 , " VK_KHR_maintenance1 " , 2 } ,
" VK_KHR_maintenance1 " ,
{ 35 , " VK_KHR_maintenance2 " , 1 } ,
" VK_KHR_maintenance2 " ,
{ 36 , " VK_KHR_maintenance3 " , 1 } ,
" VK_KHR_maintenance3 " ,
{ 37 , " VK_KHR_multiview " , 1 } ,
" VK_KHR_multiview " ,
{ 38 , " VK_KHR_relaxed_block_layout " , 1 } ,
" VK_KHR_relaxed_block_layout " ,
{ 39 , " VK_KHR_sampler_mirror_clamp_to_edge " , 3 } ,
" VK_KHR_sampler_mirror_clamp_to_edge " ,
{ 40 , " VK_KHR_sampler_ycbcr_conversion " , 14 } ,
" VK_KHR_sampler_ycbcr_conversion " ,
{ 41 , " VK_KHR_separate_depth_stencil_layouts " , 1 } ,
" VK_KHR_separate_depth_stencil_layouts " ,
{ 42 , " VK_KHR_shader_atomic_int64 " , 1 } ,
" VK_KHR_shader_atomic_int64 " ,
{ 43 , " VK_KHR_shader_draw_parameters " , 1 } ,
" VK_KHR_shader_draw_parameters " ,
{ 44 , " VK_KHR_shader_float16_int8 " , 1 } ,
" VK_KHR_shader_float16_int8 " ,
{ 45 , " VK_KHR_shader_float_controls " , 4 } ,
" VK_KHR_shader_float_controls " ,
{ 46 , " VK_KHR_shader_subgroup_extended_types " , 1 } ,
" VK_KHR_shader_subgroup_extended_types " ,
{ 47 , " VK_KHR_spirv_1_4 " , 1 } ,
" VK_KHR_spirv_1_4 " ,
{ 48 , " VK_KHR_storage_buffer_storage_class " , 1 } ,
" VK_KHR_storage_buffer_storage_class " ,
{ 49 , " VK_KHR_timeline_semaphore " , 2 } ,
" VK_KHR_timeline_semaphore " ,
{ 50 , " VK_KHR_uniform_buffer_standard_layout " , 1 } ,
" VK_KHR_uniform_buffer_standard_layout " ,
{ 51 , " VK_KHR_variable_pointers " , 1 } ,
" VK_KHR_variable_pointers " ,
{ 52 , " VK_KHR_vulkan_memory_model " , 3 } ,
" VK_KHR_vulkan_memory_model " ,
{ 53 , " VK_MESA_venus_protocol " , 100000 } ,
" VK_MESA_venus_protocol " ,
} ;
} ;
static const uint32_t ext_versions [ 54 ] = {
0 ,
2 ,
1 ,
1 ,
1 ,
1 ,
2 ,
1 ,
1 ,
1 ,
1 ,
1 ,
1 ,
1 ,
1 ,
1 ,
3 ,
1 ,
1 ,
4 ,
1 ,
1 ,
1 ,
1 ,
1 ,
1 ,
1 ,
1 ,
1 ,
1 ,
1 ,
2 ,
1 ,
1 ,
2 ,
1 ,
1 ,
1 ,
1 ,
3 ,
14 ,
1 ,
1 ,
1 ,
1 ,
4 ,
1 ,
1 ,
1 ,
2 ,
1 ,
1 ,
3 ,
100000 ,
} ;
const char * * found ;
found = bsearch ( name , ext_names , ext_count , sizeof ( ext_names [ 0 ] ) ,
vn_info_extension_compare ) ;
return found ? ext_versions [ found - ext_names ] : 0 ;
return bsearch ( name , vn_info_extensions , 54 ,
sizeof ( * vn_info_extensions ) , vn_info_extension_compare ) ;
}
}
# endif /* VN_PROTOCOL_RENDERER_INFO_H */
# endif /* VN_PROTOCOL_RENDERER_INFO_H */