from mako.template import Template
-MAX_API_VERSION = '1.1.70'
+MAX_API_VERSION = '1.1.107'
class Extension:
def __init__(self, name, ext_version, enable):
# and dEQP-VK.api.info.device fail due to the duplicated strings.
EXTENSIONS = [
Extension('VK_ANDROID_native_buffer', 5, 'ANDROID && device->rad_info.has_syncobj_wait_for_submit'),
- Extension('VK_KHR_16bit_storage', 1, 'HAVE_LLVM >= 0x0700'),
+ Extension('VK_KHR_16bit_storage', 1, True),
Extension('VK_KHR_bind_memory2', 1, True),
Extension('VK_KHR_create_renderpass2', 1, True),
Extension('VK_KHR_dedicated_allocation', 1, True),
Extension('VK_KHR_device_group', 1, True),
Extension('VK_KHR_device_group_creation', 1, True),
Extension('VK_KHR_draw_indirect_count', 1, True),
+ Extension('VK_KHR_driver_properties', 1, True),
Extension('VK_KHR_external_fence', 1, 'device->rad_info.has_syncobj_wait_for_submit'),
Extension('VK_KHR_external_fence_capabilities', 1, True),
Extension('VK_KHR_external_fence_fd', 1, 'device->rad_info.has_syncobj_wait_for_submit'),
Extension('VK_KHR_push_descriptor', 1, True),
Extension('VK_KHR_relaxed_block_layout', 1, True),
Extension('VK_KHR_sampler_mirror_clamp_to_edge', 1, True),
+ Extension('VK_KHR_sampler_ycbcr_conversion', 1, True),
+ Extension('VK_KHR_shader_atomic_int64', 1, False),
Extension('VK_KHR_shader_draw_parameters', 1, True),
+ Extension('VK_KHR_shader_float16_int8', 1, True),
Extension('VK_KHR_storage_buffer_storage_class', 1, True),
Extension('VK_KHR_surface', 25, 'RADV_HAS_SURFACE'),
+ Extension('VK_KHR_surface_protected_capabilities', 1, 'RADV_HAS_SURFACE'),
Extension('VK_KHR_swapchain', 68, 'RADV_HAS_SURFACE'),
+ Extension('VK_KHR_uniform_buffer_standard_layout', 1, True),
Extension('VK_KHR_variable_pointers', 1, True),
Extension('VK_KHR_wayland_surface', 6, 'VK_USE_PLATFORM_WAYLAND_KHR'),
Extension('VK_KHR_xcb_surface', 6, 'VK_USE_PLATFORM_XCB_KHR'),
Extension('VK_KHR_xlib_surface', 6, 'VK_USE_PLATFORM_XLIB_KHR'),
Extension('VK_KHR_multiview', 1, True),
Extension('VK_KHR_display', 23, 'VK_USE_PLATFORM_DISPLAY_KHR'),
+ Extension('VK_KHR_8bit_storage', 1, 'device->rad_info.chip_class >= GFX8'),
Extension('VK_EXT_direct_mode_display', 1, 'VK_USE_PLATFORM_DISPLAY_KHR'),
Extension('VK_EXT_acquire_xlib_display', 1, 'VK_USE_PLATFORM_XLIB_XRANDR_EXT'),
+ Extension('VK_EXT_buffer_device_address', 1, True),
+ Extension('VK_EXT_calibrated_timestamps', 1, True),
Extension('VK_EXT_conditional_rendering', 1, True),
+ Extension('VK_EXT_conservative_rasterization', 1, 'device->rad_info.chip_class >= GFX9'),
Extension('VK_EXT_display_surface_counter', 1, 'VK_USE_PLATFORM_DISPLAY_KHR'),
Extension('VK_EXT_display_control', 1, 'VK_USE_PLATFORM_DISPLAY_KHR'),
Extension('VK_EXT_debug_report', 9, True),
+ Extension('VK_EXT_depth_clip_enable', 1, True),
Extension('VK_EXT_depth_range_unrestricted', 1, True),
Extension('VK_EXT_descriptor_indexing', 2, True),
Extension('VK_EXT_discard_rectangles', 1, True),
Extension('VK_EXT_external_memory_dma_buf', 1, True),
Extension('VK_EXT_external_memory_host', 1, 'device->rad_info.has_userptr'),
Extension('VK_EXT_global_priority', 1, 'device->rad_info.has_ctx_priority'),
- Extension('VK_EXT_sampler_filter_minmax', 1, 'device->rad_info.chip_class >= CIK'),
+ Extension('VK_EXT_host_query_reset', 1, True),
+ Extension('VK_EXT_inline_uniform_block', 1, True),
+ Extension('VK_EXT_memory_budget', 1, True),
+ Extension('VK_EXT_memory_priority', 1, True),
+ Extension('VK_EXT_pci_bus_info', 2, True),
+ Extension('VK_EXT_pipeline_creation_feedback', 1, True),
+ Extension('VK_EXT_sampler_filter_minmax', 1, 'device->rad_info.chip_class >= GFX7'),
+ Extension('VK_EXT_scalar_block_layout', 1, 'device->rad_info.chip_class >= GFX7'),
Extension('VK_EXT_shader_viewport_index_layer', 1, True),
Extension('VK_EXT_shader_stencil_export', 1, True),
- Extension('VK_EXT_vertex_attribute_divisor', 1, True),
+ Extension('VK_EXT_transform_feedback', 1, True),
+ Extension('VK_EXT_vertex_attribute_divisor', 3, True),
+ Extension('VK_EXT_ycbcr_image_arrays', 1, True),
Extension('VK_AMD_draw_indirect_count', 1, True),
Extension('VK_AMD_gcn_shader', 1, True),
+ Extension('VK_AMD_gpu_shader_half_float', 1, 'device->rad_info.chip_class >= GFX8 && HAVE_LLVM >= 0x0800'),
+ Extension('VK_AMD_gpu_shader_int16', 1, 'device->rad_info.chip_class >= GFX8'),
Extension('VK_AMD_rasterization_order', 1, 'device->has_out_of_order_rast'),
Extension('VK_AMD_shader_core_properties', 1, True),
Extension('VK_AMD_shader_info', 1, True),
Extension('VK_AMD_shader_trinary_minmax', 1, True),
+ Extension('VK_GOOGLE_decorate_string', 1, True),
+ Extension('VK_GOOGLE_hlsl_functionality1', 1, True),
+ Extension('VK_NV_compute_shader_derivatives', 1, 'device->rad_info.chip_class >= GFX8'),
]
class VkVersion:
ext = ext_name_map[ext_name]
ext.type = ext_elem.attrib['type']
+ ext.promotedto = ext_elem.attrib.get('promotedto', None)
+ try:
+ ext.requires = ext_elem.attrib['requires'].split(',')
+ except KeyError:
+ ext.requires = []
+
+ def extra_deps(ext):
+ if ext.type == 'instance':
+ check = 'instance->enabled_extensions.{}'.format(ext.name[3:])
+ if ext.promotedto is not None:
+ # the xml contains values like VK_VERSION_1_1, but we need to
+ # translate them to VK_API_VERSION_1_1 for the apiVersion check
+ api_ver = ext.promotedto.replace('VK_VER', 'VK_API_VER')
+ check = '({} || instance->apiVersion >= {})'.format(check, api_ver)
+ return set([check])
+
+ deps = set()
+ for dep in ext.requires:
+ deps |= extra_deps(ext_name_map[dep])
+
+ return deps
+
+ for ext in EXTENSIONS:
+ if ext.type == 'device':
+ for dep in extra_deps(ext):
+ ext.enable += ' && ' + dep
_TEMPLATE_H = Template(COPYRIGHT + """
#ifndef RADV_EXTENSIONS_H
void radv_fill_device_extension_table(const struct radv_physical_device *device,
struct radv_device_extension_table* table)
{
+ const struct radv_instance *instance = device->instance;
%for ext in device_extensions:
table->${ext.name[3:]} = ${ext.enable};
%endfor
uint32_t
radv_physical_device_api_version(struct radv_physical_device *dev)
{
- if (!ANDROID && dev->rad_info.has_syncobj_wait_for_submit)
- return VK_MAKE_VERSION(1, 1, 70);
- return VK_MAKE_VERSION(1, 0, 68);
+ uint32_t override = vk_get_version_override();
+ uint32_t version = VK_MAKE_VERSION(1, 0, 68);
+ if (dev->rad_info.has_syncobj_wait_for_submit)
+ version = ${MAX_API_VERSION.c_vk_version()};
+
+ return override ? MIN2(override, version) : version;
}
""")