vulkan: Set SPIR-V caps from supported features
Any drivers which use vk_spirv_to_nir() now no longer need to build a caps table manually. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Iván Briano <ivan.briano@intel.com> Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28905>
This commit is contained in:
committed by
Marge Bot
parent
1759c0eba7
commit
ce2946ae0f
@@ -141,69 +141,7 @@ anv_shader_stage_to_nir(struct anv_device *device,
|
||||
const nir_shader_compiler_options *nir_options =
|
||||
compiler->nir_options[stage];
|
||||
|
||||
const bool rt_enabled = ANV_SUPPORT_RT && pdevice->info.has_ray_tracing;
|
||||
const struct spirv_to_nir_options spirv_options = {
|
||||
.caps = {
|
||||
.amd_image_gather_bias_lod = pdevice->info.ver >= 20,
|
||||
.cooperative_matrix = anv_has_cooperative_matrix(pdevice),
|
||||
.demote_to_helper_invocation = true,
|
||||
.derivative_group = true,
|
||||
.descriptor_array_dynamic_indexing = true,
|
||||
.descriptor_array_non_uniform_indexing = true,
|
||||
.descriptor_indexing = true,
|
||||
.device_group = true,
|
||||
.draw_parameters = true,
|
||||
.float16 = true,
|
||||
.float32_atomic_add = pdevice->info.has_lsc,
|
||||
.float32_atomic_min_max = true,
|
||||
.float64 = true,
|
||||
.float64_atomic_min_max = pdevice->info.has_lsc,
|
||||
.fragment_shader_sample_interlock = true,
|
||||
.fragment_shader_pixel_interlock = true,
|
||||
.geometry_streams = true,
|
||||
.image_read_without_format = true,
|
||||
.image_write_without_format = true,
|
||||
.int8 = true,
|
||||
.int16 = true,
|
||||
.int64 = true,
|
||||
.int64_atomics = true,
|
||||
.integer_functions2 = true,
|
||||
.mesh_shading = pdevice->vk.supported_extensions.EXT_mesh_shader,
|
||||
.mesh_shading_nv = false,
|
||||
.min_lod = true,
|
||||
.multiview = true,
|
||||
.physical_storage_buffer_address = true,
|
||||
.post_depth_coverage = true,
|
||||
.quad_control = true,
|
||||
.runtime_descriptor_array = true,
|
||||
.float_controls = true,
|
||||
.float_controls2 = true,
|
||||
.ray_cull_mask = rt_enabled,
|
||||
.ray_query = rt_enabled,
|
||||
.ray_tracing = rt_enabled,
|
||||
.ray_tracing_position_fetch = rt_enabled,
|
||||
.shader_clock = true,
|
||||
.shader_viewport_index_layer = true,
|
||||
.sparse_residency = pdevice->sparse_type != ANV_SPARSE_TYPE_NOT_SUPPORTED,
|
||||
.stencil_export = true,
|
||||
.storage_8bit = true,
|
||||
.storage_16bit = true,
|
||||
.subgroup_arithmetic = true,
|
||||
.subgroup_basic = true,
|
||||
.subgroup_ballot = true,
|
||||
.subgroup_dispatch = true,
|
||||
.subgroup_quad = true,
|
||||
.subgroup_rotate = true,
|
||||
.subgroup_shuffle = true,
|
||||
.subgroup_vote = true,
|
||||
.tessellation = true,
|
||||
.transform_feedback = true,
|
||||
.variable_pointers = true,
|
||||
.vk_memory_model = true,
|
||||
.vk_memory_model_device_scope = true,
|
||||
.workgroup_memory_explicit_layout = true,
|
||||
.fragment_shading_rate = pdevice->info.ver >= 11,
|
||||
},
|
||||
.ubo_addr_format = anv_nir_ubo_addr_format(pdevice, robust_flags),
|
||||
.ssbo_addr_format = anv_nir_ssbo_addr_format(pdevice, robust_flags),
|
||||
.phys_ssbo_addr_format = nir_address_format_64bit_global,
|
||||
|
||||
@@ -58,54 +58,6 @@ anv_shader_stage_to_nir(struct anv_device *device,
|
||||
compiler->nir_options[stage];
|
||||
|
||||
const struct spirv_to_nir_options spirv_options = {
|
||||
.caps = {
|
||||
.demote_to_helper_invocation = true,
|
||||
.derivative_group = true,
|
||||
.descriptor_array_dynamic_indexing = true,
|
||||
.descriptor_array_non_uniform_indexing = true,
|
||||
.descriptor_indexing = true,
|
||||
.device_group = true,
|
||||
.draw_parameters = true,
|
||||
.float16 = pdevice->info.ver >= 8,
|
||||
.float32_atomic_add = pdevice->info.has_lsc,
|
||||
.float32_atomic_min_max = pdevice->info.ver >= 9,
|
||||
.float64 = pdevice->info.ver >= 8,
|
||||
.float64_atomic_min_max = pdevice->info.has_lsc,
|
||||
.fragment_shader_sample_interlock = pdevice->info.ver >= 9,
|
||||
.fragment_shader_pixel_interlock = pdevice->info.ver >= 9,
|
||||
.geometry_streams = true,
|
||||
.image_read_without_format = true,
|
||||
.image_write_without_format = true,
|
||||
.int8 = pdevice->info.ver >= 8,
|
||||
.int16 = pdevice->info.ver >= 8,
|
||||
.int64 = pdevice->info.ver >= 8,
|
||||
.int64_atomics = pdevice->info.ver >= 9 && pdevice->use_softpin,
|
||||
.integer_functions2 = pdevice->info.ver >= 8,
|
||||
.min_lod = true,
|
||||
.multiview = true,
|
||||
.physical_storage_buffer_address = pdevice->has_a64_buffer_access,
|
||||
.post_depth_coverage = pdevice->info.ver >= 9,
|
||||
.runtime_descriptor_array = true,
|
||||
.float_controls = true,
|
||||
.shader_clock = true,
|
||||
.shader_viewport_index_layer = true,
|
||||
.stencil_export = pdevice->info.ver >= 9,
|
||||
.storage_8bit = pdevice->info.ver >= 8,
|
||||
.storage_16bit = pdevice->info.ver >= 8,
|
||||
.subgroup_arithmetic = true,
|
||||
.subgroup_basic = true,
|
||||
.subgroup_ballot = true,
|
||||
.subgroup_dispatch = true,
|
||||
.subgroup_quad = true,
|
||||
.subgroup_shuffle = true,
|
||||
.subgroup_vote = true,
|
||||
.tessellation = true,
|
||||
.transform_feedback = true,
|
||||
.variable_pointers = true,
|
||||
.vk_memory_model = true,
|
||||
.vk_memory_model_device_scope = true,
|
||||
.workgroup_memory_explicit_layout = true,
|
||||
},
|
||||
.ubo_addr_format = anv_nir_ubo_addr_format(pdevice, robust_flags),
|
||||
.ssbo_addr_format = anv_nir_ssbo_addr_format(pdevice, robust_flags),
|
||||
.phys_ssbo_addr_format = nir_address_format_64bit_global,
|
||||
|
||||
Reference in New Issue
Block a user