| // This file is auto-generated by vulkano autogen from vk.xml header version 1.3.238. |
| // It should not be edited manually. Changes should be made by editing autogen. |
| |
| fn check_spirv_capability( |
| device: &Device, |
| capability: Capability, |
| ) -> Result<(), ShaderSupportError> { |
| match capability { |
| Capability::Matrix => (), |
| Capability::Shader => (), |
| Capability::InputAttachment => (), |
| Capability::Sampled1D => (), |
| Capability::Image1D => (), |
| Capability::SampledBuffer => (), |
| Capability::ImageBuffer => (), |
| Capability::ImageQuery => (), |
| Capability::DerivativeControl => (), |
| Capability::Geometry => { |
| if !(device.enabled_features().geometry_shader) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `geometry_shader`", |
| ])); |
| } |
| } |
| Capability::Tessellation => { |
| if !(device.enabled_features().tessellation_shader) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `tessellation_shader`", |
| ])); |
| } |
| } |
| Capability::Float64 => { |
| if !(device.enabled_features().shader_float64) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_float64`", |
| ])); |
| } |
| } |
| Capability::Int64 => { |
| if !(device.enabled_features().shader_int64) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_int64`", |
| ])); |
| } |
| } |
| Capability::Int64Atomics => { |
| if !(device.enabled_features().shader_buffer_int64_atomics |
| || device.enabled_features().shader_shared_int64_atomics |
| || device.enabled_features().shader_image_int64_atomics) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_buffer_int64_atomics`", |
| "feature `shader_shared_int64_atomics`", |
| "feature `shader_image_int64_atomics`", |
| ])); |
| } |
| } |
| Capability::AtomicFloat16AddEXT => { |
| if !(device.enabled_features().shader_buffer_float16_atomic_add |
| || device.enabled_features().shader_shared_float16_atomic_add) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_buffer_float16_atomic_add`", |
| "feature `shader_shared_float16_atomic_add`", |
| ])); |
| } |
| } |
| Capability::AtomicFloat32AddEXT => { |
| if !(device.enabled_features().shader_buffer_float32_atomic_add |
| || device.enabled_features().shader_shared_float32_atomic_add |
| || device.enabled_features().shader_image_float32_atomic_add) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_buffer_float32_atomic_add`", |
| "feature `shader_shared_float32_atomic_add`", |
| "feature `shader_image_float32_atomic_add`", |
| ])); |
| } |
| } |
| Capability::AtomicFloat64AddEXT => { |
| if !(device.enabled_features().shader_buffer_float64_atomic_add |
| || device.enabled_features().shader_shared_float64_atomic_add) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_buffer_float64_atomic_add`", |
| "feature `shader_shared_float64_atomic_add`", |
| ])); |
| } |
| } |
| Capability::AtomicFloat16MinMaxEXT => { |
| if !(device |
| .enabled_features() |
| .shader_buffer_float16_atomic_min_max |
| || device |
| .enabled_features() |
| .shader_shared_float16_atomic_min_max) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_buffer_float16_atomic_min_max`", |
| "feature `shader_shared_float16_atomic_min_max`", |
| ])); |
| } |
| } |
| Capability::AtomicFloat32MinMaxEXT => { |
| if !(device |
| .enabled_features() |
| .shader_buffer_float32_atomic_min_max |
| || device |
| .enabled_features() |
| .shader_shared_float32_atomic_min_max |
| || device |
| .enabled_features() |
| .shader_image_float32_atomic_min_max) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_buffer_float32_atomic_min_max`", |
| "feature `shader_shared_float32_atomic_min_max`", |
| "feature `shader_image_float32_atomic_min_max`", |
| ])); |
| } |
| } |
| Capability::AtomicFloat64MinMaxEXT => { |
| if !(device |
| .enabled_features() |
| .shader_buffer_float64_atomic_min_max |
| || device |
| .enabled_features() |
| .shader_shared_float64_atomic_min_max) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_buffer_float64_atomic_min_max`", |
| "feature `shader_shared_float64_atomic_min_max`", |
| ])); |
| } |
| } |
| Capability::Int64ImageEXT => { |
| if !(device.enabled_features().shader_image_int64_atomics) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_image_int64_atomics`", |
| ])); |
| } |
| } |
| Capability::Int16 => { |
| if !(device.enabled_features().shader_int16) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_int16`", |
| ])); |
| } |
| } |
| Capability::TessellationPointSize => { |
| if !(device |
| .enabled_features() |
| .shader_tessellation_and_geometry_point_size) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_tessellation_and_geometry_point_size`", |
| ])); |
| } |
| } |
| Capability::GeometryPointSize => { |
| if !(device |
| .enabled_features() |
| .shader_tessellation_and_geometry_point_size) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_tessellation_and_geometry_point_size`", |
| ])); |
| } |
| } |
| Capability::ImageGatherExtended => { |
| if !(device.enabled_features().shader_image_gather_extended) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_image_gather_extended`", |
| ])); |
| } |
| } |
| Capability::StorageImageMultisample => { |
| if !(device.enabled_features().shader_storage_image_multisample) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_storage_image_multisample`", |
| ])); |
| } |
| } |
| Capability::UniformBufferArrayDynamicIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_uniform_buffer_array_dynamic_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_uniform_buffer_array_dynamic_indexing`", |
| ])); |
| } |
| } |
| Capability::SampledImageArrayDynamicIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_sampled_image_array_dynamic_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_sampled_image_array_dynamic_indexing`", |
| ])); |
| } |
| } |
| Capability::StorageBufferArrayDynamicIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_storage_buffer_array_dynamic_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_storage_buffer_array_dynamic_indexing`", |
| ])); |
| } |
| } |
| Capability::StorageImageArrayDynamicIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_storage_image_array_dynamic_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_storage_image_array_dynamic_indexing`", |
| ])); |
| } |
| } |
| Capability::ClipDistance => { |
| if !(device.enabled_features().shader_clip_distance) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_clip_distance`", |
| ])); |
| } |
| } |
| Capability::CullDistance => { |
| if !(device.enabled_features().shader_cull_distance) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_cull_distance`", |
| ])); |
| } |
| } |
| Capability::ImageCubeArray => { |
| if !(device.enabled_features().image_cube_array) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `image_cube_array`", |
| ])); |
| } |
| } |
| Capability::SampleRateShading => { |
| if !(device.enabled_features().sample_rate_shading) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `sample_rate_shading`", |
| ])); |
| } |
| } |
| Capability::SparseResidency => { |
| if !(device.enabled_features().shader_resource_residency) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_resource_residency`", |
| ])); |
| } |
| } |
| Capability::MinLod => { |
| if !(device.enabled_features().shader_resource_min_lod) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_resource_min_lod`", |
| ])); |
| } |
| } |
| Capability::SampledCubeArray => { |
| if !(device.enabled_features().image_cube_array) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `image_cube_array`", |
| ])); |
| } |
| } |
| Capability::ImageMSArray => { |
| if !(device.enabled_features().shader_storage_image_multisample) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_storage_image_multisample`", |
| ])); |
| } |
| } |
| Capability::StorageImageExtendedFormats => (), |
| Capability::InterpolationFunction => { |
| if !(device.enabled_features().sample_rate_shading) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `sample_rate_shading`", |
| ])); |
| } |
| } |
| Capability::StorageImageReadWithoutFormat => { |
| if !(device |
| .enabled_features() |
| .shader_storage_image_read_without_format |
| || device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_format_feature_flags2) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_storage_image_read_without_format`", |
| "Vulkan API version 1.1", |
| "device extension `khr_format_feature_flags2`", |
| ])); |
| } |
| } |
| Capability::StorageImageWriteWithoutFormat => { |
| if !(device |
| .enabled_features() |
| .shader_storage_image_write_without_format |
| || device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_format_feature_flags2) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_storage_image_write_without_format`", |
| "Vulkan API version 1.1", |
| "device extension `khr_format_feature_flags2`", |
| ])); |
| } |
| } |
| Capability::MultiViewport => { |
| if !(device.enabled_features().multi_viewport) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `multi_viewport`", |
| ])); |
| } |
| } |
| Capability::DrawParameters => { |
| if !(device.enabled_features().shader_draw_parameters |
| || device.enabled_extensions().khr_shader_draw_parameters) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_draw_parameters`", |
| "device extension `khr_shader_draw_parameters`", |
| ])); |
| } |
| } |
| Capability::MultiView => { |
| if !(device.enabled_features().multiview) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `multiview`", |
| ])); |
| } |
| } |
| Capability::DeviceGroup => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_device_group) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_device_group`", |
| ])); |
| } |
| } |
| Capability::VariablePointersStorageBuffer => { |
| if !(device.enabled_features().variable_pointers_storage_buffer) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `variable_pointers_storage_buffer`", |
| ])); |
| } |
| } |
| Capability::VariablePointers => { |
| if !(device.enabled_features().variable_pointers) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `variable_pointers`", |
| ])); |
| } |
| } |
| Capability::ShaderClockKHR => { |
| if !(device.enabled_extensions().khr_shader_clock) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `khr_shader_clock`", |
| ])); |
| } |
| } |
| Capability::StencilExportEXT => { |
| if !(device.enabled_extensions().ext_shader_stencil_export) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_shader_stencil_export`", |
| ])); |
| } |
| } |
| Capability::SubgroupBallotKHR => { |
| if !(device.enabled_extensions().ext_shader_subgroup_ballot) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_shader_subgroup_ballot`", |
| ])); |
| } |
| } |
| Capability::SubgroupVoteKHR => { |
| if !(device.enabled_extensions().ext_shader_subgroup_vote) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_shader_subgroup_vote`", |
| ])); |
| } |
| } |
| Capability::ImageReadWriteLodAMD => { |
| if !(device.enabled_extensions().amd_shader_image_load_store_lod) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_shader_image_load_store_lod`", |
| ])); |
| } |
| } |
| Capability::ImageGatherBiasLodAMD => { |
| if !(device.enabled_extensions().amd_texture_gather_bias_lod) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_texture_gather_bias_lod`", |
| ])); |
| } |
| } |
| Capability::FragmentMaskAMD => { |
| if !(device.enabled_extensions().amd_shader_fragment_mask) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_shader_fragment_mask`", |
| ])); |
| } |
| } |
| Capability::SampleMaskOverrideCoverageNV => { |
| if !(device.enabled_extensions().nv_sample_mask_override_coverage) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_sample_mask_override_coverage`", |
| ])); |
| } |
| } |
| Capability::GeometryShaderPassthroughNV => { |
| if !(device.enabled_extensions().nv_geometry_shader_passthrough) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_geometry_shader_passthrough`", |
| ])); |
| } |
| } |
| Capability::ShaderViewportIndex => { |
| if !(device.enabled_features().shader_output_viewport_index) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_output_viewport_index`", |
| ])); |
| } |
| } |
| Capability::ShaderLayer => { |
| if !(device.enabled_features().shader_output_layer) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_output_layer`", |
| ])); |
| } |
| } |
| Capability::ShaderViewportIndexLayerEXT => { |
| if !(device.enabled_extensions().ext_shader_viewport_index_layer |
| || device.enabled_extensions().nv_viewport_array2) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_shader_viewport_index_layer`", |
| "device extension `nv_viewport_array2`", |
| ])); |
| } |
| } |
| Capability::ShaderViewportMaskNV => { |
| if !(device.enabled_extensions().nv_viewport_array2) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_viewport_array2`", |
| ])); |
| } |
| } |
| Capability::PerViewAttributesNV => { |
| if !(device |
| .enabled_extensions() |
| .nvx_multiview_per_view_attributes) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nvx_multiview_per_view_attributes`", |
| ])); |
| } |
| } |
| Capability::StorageBuffer16BitAccess => { |
| if !(device.enabled_features().storage_buffer16_bit_access) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `storage_buffer16_bit_access`", |
| ])); |
| } |
| } |
| Capability::UniformAndStorageBuffer16BitAccess => { |
| if !(device |
| .enabled_features() |
| .uniform_and_storage_buffer16_bit_access) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `uniform_and_storage_buffer16_bit_access`", |
| ])); |
| } |
| } |
| Capability::StoragePushConstant16 => { |
| if !(device.enabled_features().storage_push_constant16) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `storage_push_constant16`", |
| ])); |
| } |
| } |
| Capability::StorageInputOutput16 => { |
| if !(device.enabled_features().storage_input_output16) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `storage_input_output16`", |
| ])); |
| } |
| } |
| Capability::GroupNonUniform => { |
| if !(device |
| .physical_device() |
| .properties() |
| .subgroup_supported_operations |
| .map(|x| x.intersects(crate::device::physical::SubgroupFeatures::BASIC)) |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `subgroup_supported_operations.BASIC`", |
| ])); |
| } |
| } |
| Capability::GroupNonUniformVote => { |
| if !(device |
| .physical_device() |
| .properties() |
| .subgroup_supported_operations |
| .map(|x| x.intersects(crate::device::physical::SubgroupFeatures::VOTE)) |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `subgroup_supported_operations.VOTE`", |
| ])); |
| } |
| } |
| Capability::GroupNonUniformArithmetic => { |
| if !(device |
| .physical_device() |
| .properties() |
| .subgroup_supported_operations |
| .map(|x| x.intersects(crate::device::physical::SubgroupFeatures::ARITHMETIC)) |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `subgroup_supported_operations.ARITHMETIC`", |
| ])); |
| } |
| } |
| Capability::GroupNonUniformBallot => { |
| if !(device |
| .physical_device() |
| .properties() |
| .subgroup_supported_operations |
| .map(|x| x.intersects(crate::device::physical::SubgroupFeatures::BALLOT)) |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `subgroup_supported_operations.BALLOT`", |
| ])); |
| } |
| } |
| Capability::GroupNonUniformShuffle => { |
| if !(device |
| .physical_device() |
| .properties() |
| .subgroup_supported_operations |
| .map(|x| x.intersects(crate::device::physical::SubgroupFeatures::SHUFFLE)) |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `subgroup_supported_operations.SHUFFLE`", |
| ])); |
| } |
| } |
| Capability::GroupNonUniformShuffleRelative => { |
| if !(device |
| .physical_device() |
| .properties() |
| .subgroup_supported_operations |
| .map(|x| x.intersects(crate::device::physical::SubgroupFeatures::SHUFFLE_RELATIVE)) |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `subgroup_supported_operations.SHUFFLE_RELATIVE`", |
| ])); |
| } |
| } |
| Capability::GroupNonUniformClustered => { |
| if !(device |
| .physical_device() |
| .properties() |
| .subgroup_supported_operations |
| .map(|x| x.intersects(crate::device::physical::SubgroupFeatures::CLUSTERED)) |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `subgroup_supported_operations.CLUSTERED`", |
| ])); |
| } |
| } |
| Capability::GroupNonUniformQuad => { |
| if !(device |
| .physical_device() |
| .properties() |
| .subgroup_supported_operations |
| .map(|x| x.intersects(crate::device::physical::SubgroupFeatures::QUAD)) |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `subgroup_supported_operations.QUAD`", |
| ])); |
| } |
| } |
| Capability::GroupNonUniformPartitionedNV => { |
| if !(device |
| .physical_device() |
| .properties() |
| .subgroup_supported_operations |
| .map(|x| x.intersects(crate::device::physical::SubgroupFeatures::PARTITIONED)) |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `subgroup_supported_operations.PARTITIONED`", |
| ])); |
| } |
| } |
| Capability::SampleMaskPostDepthCoverage => { |
| if !(device.enabled_extensions().ext_post_depth_coverage) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_post_depth_coverage`", |
| ])); |
| } |
| } |
| Capability::ShaderNonUniform => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().ext_descriptor_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `ext_descriptor_indexing`", |
| ])); |
| } |
| } |
| Capability::RuntimeDescriptorArray => { |
| if !(device.enabled_features().runtime_descriptor_array) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `runtime_descriptor_array`", |
| ])); |
| } |
| } |
| Capability::InputAttachmentArrayDynamicIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_input_attachment_array_dynamic_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_input_attachment_array_dynamic_indexing`", |
| ])); |
| } |
| } |
| Capability::UniformTexelBufferArrayDynamicIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_uniform_texel_buffer_array_dynamic_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_uniform_texel_buffer_array_dynamic_indexing`", |
| ])); |
| } |
| } |
| Capability::StorageTexelBufferArrayDynamicIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_storage_texel_buffer_array_dynamic_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_storage_texel_buffer_array_dynamic_indexing`", |
| ])); |
| } |
| } |
| Capability::UniformBufferArrayNonUniformIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_uniform_buffer_array_non_uniform_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_uniform_buffer_array_non_uniform_indexing`", |
| ])); |
| } |
| } |
| Capability::SampledImageArrayNonUniformIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_sampled_image_array_non_uniform_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_sampled_image_array_non_uniform_indexing`", |
| ])); |
| } |
| } |
| Capability::StorageBufferArrayNonUniformIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_storage_buffer_array_non_uniform_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_storage_buffer_array_non_uniform_indexing`", |
| ])); |
| } |
| } |
| Capability::StorageImageArrayNonUniformIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_storage_image_array_non_uniform_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_storage_image_array_non_uniform_indexing`", |
| ])); |
| } |
| } |
| Capability::InputAttachmentArrayNonUniformIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_input_attachment_array_non_uniform_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_input_attachment_array_non_uniform_indexing`", |
| ])); |
| } |
| } |
| Capability::UniformTexelBufferArrayNonUniformIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_uniform_texel_buffer_array_non_uniform_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_uniform_texel_buffer_array_non_uniform_indexing`", |
| ])); |
| } |
| } |
| Capability::StorageTexelBufferArrayNonUniformIndexing => { |
| if !(device |
| .enabled_features() |
| .shader_storage_texel_buffer_array_non_uniform_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_storage_texel_buffer_array_non_uniform_indexing`", |
| ])); |
| } |
| } |
| Capability::FragmentFullyCoveredEXT => { |
| if !(device.enabled_extensions().ext_conservative_rasterization) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_conservative_rasterization`", |
| ])); |
| } |
| } |
| Capability::Float16 => { |
| if !(device.enabled_features().shader_float16 |
| || device.enabled_extensions().amd_gpu_shader_half_float) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_float16`", |
| "device extension `amd_gpu_shader_half_float`", |
| ])); |
| } |
| } |
| Capability::Int8 => { |
| if !(device.enabled_features().shader_int8) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_int8`", |
| ])); |
| } |
| } |
| Capability::StorageBuffer8BitAccess => { |
| if !(device.enabled_features().storage_buffer8_bit_access) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `storage_buffer8_bit_access`", |
| ])); |
| } |
| } |
| Capability::UniformAndStorageBuffer8BitAccess => { |
| if !(device |
| .enabled_features() |
| .uniform_and_storage_buffer8_bit_access) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `uniform_and_storage_buffer8_bit_access`", |
| ])); |
| } |
| } |
| Capability::StoragePushConstant8 => { |
| if !(device.enabled_features().storage_push_constant8) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `storage_push_constant8`", |
| ])); |
| } |
| } |
| Capability::VulkanMemoryModel => { |
| if !(device.enabled_features().vulkan_memory_model) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `vulkan_memory_model`", |
| ])); |
| } |
| } |
| Capability::VulkanMemoryModelDeviceScope => { |
| if !(device.enabled_features().vulkan_memory_model_device_scope) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `vulkan_memory_model_device_scope`", |
| ])); |
| } |
| } |
| Capability::DenormPreserve => { |
| if !(device |
| .physical_device() |
| .properties() |
| .shader_denorm_preserve_float16 |
| .unwrap_or(false) |
| || device |
| .physical_device() |
| .properties() |
| .shader_denorm_preserve_float32 |
| .unwrap_or(false) |
| || device |
| .physical_device() |
| .properties() |
| .shader_denorm_preserve_float64 |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `shader_denorm_preserve_float16`", |
| "property `shader_denorm_preserve_float32`", |
| "property `shader_denorm_preserve_float64`", |
| ])); |
| } |
| } |
| Capability::DenormFlushToZero => { |
| if !(device |
| .physical_device() |
| .properties() |
| .shader_denorm_flush_to_zero_float16 |
| .unwrap_or(false) |
| || device |
| .physical_device() |
| .properties() |
| .shader_denorm_flush_to_zero_float32 |
| .unwrap_or(false) |
| || device |
| .physical_device() |
| .properties() |
| .shader_denorm_flush_to_zero_float64 |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `shader_denorm_flush_to_zero_float16`", |
| "property `shader_denorm_flush_to_zero_float32`", |
| "property `shader_denorm_flush_to_zero_float64`", |
| ])); |
| } |
| } |
| Capability::SignedZeroInfNanPreserve => { |
| if !(device |
| .physical_device() |
| .properties() |
| .shader_signed_zero_inf_nan_preserve_float16 |
| .unwrap_or(false) |
| || device |
| .physical_device() |
| .properties() |
| .shader_signed_zero_inf_nan_preserve_float32 |
| .unwrap_or(false) |
| || device |
| .physical_device() |
| .properties() |
| .shader_signed_zero_inf_nan_preserve_float64 |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `shader_signed_zero_inf_nan_preserve_float16`", |
| "property `shader_signed_zero_inf_nan_preserve_float32`", |
| "property `shader_signed_zero_inf_nan_preserve_float64`", |
| ])); |
| } |
| } |
| Capability::RoundingModeRTE => { |
| if !(device |
| .physical_device() |
| .properties() |
| .shader_rounding_mode_rte_float16 |
| .unwrap_or(false) |
| || device |
| .physical_device() |
| .properties() |
| .shader_rounding_mode_rte_float32 |
| .unwrap_or(false) |
| || device |
| .physical_device() |
| .properties() |
| .shader_rounding_mode_rte_float64 |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `shader_rounding_mode_rte_float16`", |
| "property `shader_rounding_mode_rte_float32`", |
| "property `shader_rounding_mode_rte_float64`", |
| ])); |
| } |
| } |
| Capability::RoundingModeRTZ => { |
| if !(device |
| .physical_device() |
| .properties() |
| .shader_rounding_mode_rtz_float16 |
| .unwrap_or(false) |
| || device |
| .physical_device() |
| .properties() |
| .shader_rounding_mode_rtz_float32 |
| .unwrap_or(false) |
| || device |
| .physical_device() |
| .properties() |
| .shader_rounding_mode_rtz_float64 |
| .unwrap_or(false)) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "property `shader_rounding_mode_rtz_float16`", |
| "property `shader_rounding_mode_rtz_float32`", |
| "property `shader_rounding_mode_rtz_float64`", |
| ])); |
| } |
| } |
| Capability::ComputeDerivativeGroupQuadsNV => { |
| if !(device.enabled_features().compute_derivative_group_quads) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `compute_derivative_group_quads`", |
| ])); |
| } |
| } |
| Capability::ComputeDerivativeGroupLinearNV => { |
| if !(device.enabled_features().compute_derivative_group_linear) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `compute_derivative_group_linear`", |
| ])); |
| } |
| } |
| Capability::FragmentBarycentricKHR => { |
| if !(device.enabled_features().fragment_shader_barycentric |
| || device.enabled_features().fragment_shader_barycentric) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `fragment_shader_barycentric`", |
| "feature `fragment_shader_barycentric`", |
| ])); |
| } |
| } |
| Capability::ImageFootprintNV => { |
| if !(device.enabled_features().image_footprint) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `image_footprint`", |
| ])); |
| } |
| } |
| Capability::FragmentDensityEXT => { |
| if !(device.enabled_features().shading_rate_image |
| || device.enabled_features().fragment_density_map) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shading_rate_image`", |
| "feature `fragment_density_map`", |
| ])); |
| } |
| } |
| Capability::MeshShadingNV => { |
| if !(device.enabled_extensions().nv_mesh_shader) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_mesh_shader`", |
| ])); |
| } |
| } |
| Capability::RayTracingKHR => { |
| if !(device.enabled_features().ray_tracing_pipeline) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `ray_tracing_pipeline`", |
| ])); |
| } |
| } |
| Capability::RayQueryKHR => { |
| if !(device.enabled_features().ray_query) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `ray_query`", |
| ])); |
| } |
| } |
| Capability::RayTraversalPrimitiveCullingKHR => { |
| if !(device.enabled_features().ray_traversal_primitive_culling |
| || device.enabled_features().ray_query) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `ray_traversal_primitive_culling`", |
| "feature `ray_query`", |
| ])); |
| } |
| } |
| Capability::RayTracingNV => { |
| if !(device.enabled_extensions().nv_ray_tracing) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_ray_tracing`", |
| ])); |
| } |
| } |
| Capability::RayTracingMotionBlurNV => { |
| if !(device.enabled_features().ray_tracing_motion_blur) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `ray_tracing_motion_blur`", |
| ])); |
| } |
| } |
| Capability::TransformFeedback => { |
| if !(device.enabled_features().transform_feedback) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `transform_feedback`", |
| ])); |
| } |
| } |
| Capability::GeometryStreams => { |
| if !(device.enabled_features().geometry_streams) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `geometry_streams`", |
| ])); |
| } |
| } |
| Capability::PhysicalStorageBufferAddresses => { |
| if !(device.enabled_features().buffer_device_address) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `buffer_device_address`", |
| ])); |
| } |
| } |
| Capability::CooperativeMatrixNV => { |
| if !(device.enabled_features().cooperative_matrix) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `cooperative_matrix`", |
| ])); |
| } |
| } |
| Capability::IntegerFunctions2INTEL => { |
| if !(device.enabled_features().shader_integer_functions2) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_integer_functions2`", |
| ])); |
| } |
| } |
| Capability::ShaderSMBuiltinsNV => { |
| if !(device.enabled_features().shader_sm_builtins) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_sm_builtins`", |
| ])); |
| } |
| } |
| Capability::FragmentShaderSampleInterlockEXT => { |
| if !(device.enabled_features().fragment_shader_sample_interlock) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `fragment_shader_sample_interlock`", |
| ])); |
| } |
| } |
| Capability::FragmentShaderPixelInterlockEXT => { |
| if !(device.enabled_features().fragment_shader_pixel_interlock) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `fragment_shader_pixel_interlock`", |
| ])); |
| } |
| } |
| Capability::FragmentShaderShadingRateInterlockEXT => { |
| if !(device |
| .enabled_features() |
| .fragment_shader_shading_rate_interlock |
| || device.enabled_features().shading_rate_image) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `fragment_shader_shading_rate_interlock`", |
| "feature `shading_rate_image`", |
| ])); |
| } |
| } |
| Capability::DemoteToHelperInvocation => { |
| if !(device.enabled_features().shader_demote_to_helper_invocation) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_demote_to_helper_invocation`", |
| ])); |
| } |
| } |
| Capability::FragmentShadingRateKHR => { |
| if !(device.enabled_features().pipeline_fragment_shading_rate |
| || device.enabled_features().primitive_fragment_shading_rate |
| || device.enabled_features().attachment_fragment_shading_rate) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `pipeline_fragment_shading_rate`", |
| "feature `primitive_fragment_shading_rate`", |
| "feature `attachment_fragment_shading_rate`", |
| ])); |
| } |
| } |
| Capability::WorkgroupMemoryExplicitLayoutKHR => { |
| if !(device.enabled_features().workgroup_memory_explicit_layout) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `workgroup_memory_explicit_layout`", |
| ])); |
| } |
| } |
| Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR => { |
| if !(device |
| .enabled_features() |
| .workgroup_memory_explicit_layout8_bit_access) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `workgroup_memory_explicit_layout8_bit_access`", |
| ])); |
| } |
| } |
| Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR => { |
| if !(device |
| .enabled_features() |
| .workgroup_memory_explicit_layout16_bit_access) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `workgroup_memory_explicit_layout16_bit_access`", |
| ])); |
| } |
| } |
| Capability::DotProductInputAll => { |
| if !(device.enabled_features().shader_integer_dot_product) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_integer_dot_product`", |
| ])); |
| } |
| } |
| Capability::DotProductInput4x8Bit => { |
| if !(device.enabled_features().shader_integer_dot_product) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_integer_dot_product`", |
| ])); |
| } |
| } |
| Capability::DotProductInput4x8BitPacked => { |
| if !(device.enabled_features().shader_integer_dot_product) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_integer_dot_product`", |
| ])); |
| } |
| } |
| Capability::DotProduct => { |
| if !(device.enabled_features().shader_integer_dot_product) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "feature `shader_integer_dot_product`", |
| ])); |
| } |
| } |
| _ => return Err(ShaderSupportError::NotSupportedByVulkan), |
| } |
| Ok(()) |
| } |
| fn check_spirv_extension(device: &Device, extension: &str) -> Result<(), ShaderSupportError> { |
| match extension { |
| "SPV_KHR_variable_pointers" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_variable_pointers) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_variable_pointers`", |
| ])); |
| } |
| } |
| "SPV_AMD_shader_explicit_vertex_parameter" => { |
| if !(device |
| .enabled_extensions() |
| .amd_shader_explicit_vertex_parameter) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_shader_explicit_vertex_parameter`", |
| ])); |
| } |
| } |
| "SPV_AMD_gcn_shader" => { |
| if !(device.enabled_extensions().amd_gcn_shader) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_gcn_shader`", |
| ])); |
| } |
| } |
| "SPV_AMD_gpu_shader_half_float" => { |
| if !(device.enabled_extensions().amd_gpu_shader_half_float) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_gpu_shader_half_float`", |
| ])); |
| } |
| } |
| "SPV_AMD_gpu_shader_int16" => { |
| if !(device.enabled_extensions().amd_gpu_shader_int16) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_gpu_shader_int16`", |
| ])); |
| } |
| } |
| "SPV_AMD_shader_ballot" => { |
| if !(device.enabled_extensions().amd_shader_ballot) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_shader_ballot`", |
| ])); |
| } |
| } |
| "SPV_AMD_shader_fragment_mask" => { |
| if !(device.enabled_extensions().amd_shader_fragment_mask) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_shader_fragment_mask`", |
| ])); |
| } |
| } |
| "SPV_AMD_shader_image_load_store_lod" => { |
| if !(device.enabled_extensions().amd_shader_image_load_store_lod) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_shader_image_load_store_lod`", |
| ])); |
| } |
| } |
| "SPV_AMD_shader_trinary_minmax" => { |
| if !(device.enabled_extensions().amd_shader_trinary_minmax) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_shader_trinary_minmax`", |
| ])); |
| } |
| } |
| "SPV_AMD_texture_gather_bias_lod" => { |
| if !(device.enabled_extensions().amd_texture_gather_bias_lod) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_texture_gather_bias_lod`", |
| ])); |
| } |
| } |
| "SPV_AMD_shader_early_and_late_fragment_tests" => { |
| if !(device |
| .enabled_extensions() |
| .amd_shader_early_and_late_fragment_tests) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `amd_shader_early_and_late_fragment_tests`", |
| ])); |
| } |
| } |
| "SPV_KHR_shader_draw_parameters" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_shader_draw_parameters) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_shader_draw_parameters`", |
| ])); |
| } |
| } |
| "SPV_KHR_8bit_storage" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_8bit_storage) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_8bit_storage`", |
| ])); |
| } |
| } |
| "SPV_KHR_16bit_storage" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_16bit_storage) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_16bit_storage`", |
| ])); |
| } |
| } |
| "SPV_KHR_shader_clock" => { |
| if !(device.enabled_extensions().khr_shader_clock) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `khr_shader_clock`", |
| ])); |
| } |
| } |
| "SPV_KHR_float_controls" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_shader_float_controls) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_shader_float_controls`", |
| ])); |
| } |
| } |
| "SPV_KHR_storage_buffer_storage_class" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_storage_buffer_storage_class) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_storage_buffer_storage_class`", |
| ])); |
| } |
| } |
| "SPV_KHR_post_depth_coverage" => { |
| if !(device.enabled_extensions().ext_post_depth_coverage) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_post_depth_coverage`", |
| ])); |
| } |
| } |
| "SPV_EXT_shader_stencil_export" => { |
| if !(device.enabled_extensions().ext_shader_stencil_export) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_shader_stencil_export`", |
| ])); |
| } |
| } |
| "SPV_KHR_shader_ballot" => { |
| if !(device.enabled_extensions().ext_shader_subgroup_ballot) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_shader_subgroup_ballot`", |
| ])); |
| } |
| } |
| "SPV_KHR_subgroup_vote" => { |
| if !(device.enabled_extensions().ext_shader_subgroup_vote) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_shader_subgroup_vote`", |
| ])); |
| } |
| } |
| "SPV_NV_sample_mask_override_coverage" => { |
| if !(device.enabled_extensions().nv_sample_mask_override_coverage) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_sample_mask_override_coverage`", |
| ])); |
| } |
| } |
| "SPV_NV_geometry_shader_passthrough" => { |
| if !(device.enabled_extensions().nv_geometry_shader_passthrough) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_geometry_shader_passthrough`", |
| ])); |
| } |
| } |
| "SPV_NV_mesh_shader" => { |
| if !(device.enabled_extensions().nv_mesh_shader) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_mesh_shader`", |
| ])); |
| } |
| } |
| "SPV_NV_viewport_array2" => { |
| if !(device.enabled_extensions().nv_viewport_array2) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_viewport_array2`", |
| ])); |
| } |
| } |
| "SPV_NV_shader_subgroup_partitioned" => { |
| if !(device.enabled_extensions().nv_shader_subgroup_partitioned) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_shader_subgroup_partitioned`", |
| ])); |
| } |
| } |
| "SPV_NV_shader_invocation_reorder" => { |
| if !(device |
| .enabled_extensions() |
| .nv_ray_tracing_invocation_reorder) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_ray_tracing_invocation_reorder`", |
| ])); |
| } |
| } |
| "SPV_EXT_shader_viewport_index_layer" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().ext_shader_viewport_index_layer) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `ext_shader_viewport_index_layer`", |
| ])); |
| } |
| } |
| "SPV_NVX_multiview_per_view_attributes" => { |
| if !(device |
| .enabled_extensions() |
| .nvx_multiview_per_view_attributes) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nvx_multiview_per_view_attributes`", |
| ])); |
| } |
| } |
| "SPV_EXT_descriptor_indexing" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().ext_descriptor_indexing) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `ext_descriptor_indexing`", |
| ])); |
| } |
| } |
| "SPV_KHR_vulkan_memory_model" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_vulkan_memory_model) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_vulkan_memory_model`", |
| ])); |
| } |
| } |
| "SPV_NV_compute_shader_derivatives" => { |
| if !(device.enabled_extensions().nv_compute_shader_derivatives) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_compute_shader_derivatives`", |
| ])); |
| } |
| } |
| "SPV_NV_fragment_shader_barycentric" => { |
| if !(device.enabled_extensions().nv_fragment_shader_barycentric) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_fragment_shader_barycentric`", |
| ])); |
| } |
| } |
| "SPV_NV_shader_image_footprint" => { |
| if !(device.enabled_extensions().nv_shader_image_footprint) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_shader_image_footprint`", |
| ])); |
| } |
| } |
| "SPV_NV_shading_rate" => { |
| if !(device.enabled_extensions().nv_shading_rate_image) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_shading_rate_image`", |
| ])); |
| } |
| } |
| "SPV_NV_ray_tracing" => { |
| if !(device.enabled_extensions().nv_ray_tracing) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_ray_tracing`", |
| ])); |
| } |
| } |
| "SPV_KHR_ray_tracing" => { |
| if !(device.enabled_extensions().khr_ray_tracing_pipeline) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `khr_ray_tracing_pipeline`", |
| ])); |
| } |
| } |
| "SPV_KHR_ray_query" => { |
| if !(device.enabled_extensions().khr_ray_query) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `khr_ray_query`", |
| ])); |
| } |
| } |
| "SPV_KHR_ray_cull_mask" => { |
| if !(device.enabled_extensions().khr_ray_tracing_maintenance1) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `khr_ray_tracing_maintenance1`", |
| ])); |
| } |
| } |
| "SPV_GOOGLE_hlsl_functionality1" => { |
| if !(device.enabled_extensions().google_hlsl_functionality1) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `google_hlsl_functionality1`", |
| ])); |
| } |
| } |
| "SPV_GOOGLE_user_type" => { |
| if !(device.enabled_extensions().google_user_type) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `google_user_type`", |
| ])); |
| } |
| } |
| "SPV_GOOGLE_decorate_string" => { |
| if !(device.enabled_extensions().google_decorate_string) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `google_decorate_string`", |
| ])); |
| } |
| } |
| "SPV_EXT_fragment_invocation_density" => { |
| if !(device.enabled_extensions().ext_fragment_density_map) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_fragment_density_map`", |
| ])); |
| } |
| } |
| "SPV_KHR_physical_storage_buffer" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_buffer_device_address) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_buffer_device_address`", |
| ])); |
| } |
| } |
| "SPV_EXT_physical_storage_buffer" => { |
| if !(device.enabled_extensions().ext_buffer_device_address) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_buffer_device_address`", |
| ])); |
| } |
| } |
| "SPV_NV_cooperative_matrix" => { |
| if !(device.enabled_extensions().nv_cooperative_matrix) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_cooperative_matrix`", |
| ])); |
| } |
| } |
| "SPV_NV_shader_sm_builtins" => { |
| if !(device.enabled_extensions().nv_shader_sm_builtins) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `nv_shader_sm_builtins`", |
| ])); |
| } |
| } |
| "SPV_EXT_fragment_shader_interlock" => { |
| if !(device.enabled_extensions().ext_fragment_shader_interlock) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_fragment_shader_interlock`", |
| ])); |
| } |
| } |
| "SPV_EXT_demote_to_helper_invocation" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device |
| .enabled_extensions() |
| .ext_shader_demote_to_helper_invocation) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `ext_shader_demote_to_helper_invocation`", |
| ])); |
| } |
| } |
| "SPV_KHR_fragment_shading_rate" => { |
| if !(device.enabled_extensions().khr_fragment_shading_rate) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `khr_fragment_shading_rate`", |
| ])); |
| } |
| } |
| "SPV_KHR_non_semantic_info" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_shader_non_semantic_info) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_shader_non_semantic_info`", |
| ])); |
| } |
| } |
| "SPV_EXT_shader_image_int64" => { |
| if !(device.enabled_extensions().ext_shader_image_atomic_int64) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_shader_image_atomic_int64`", |
| ])); |
| } |
| } |
| "SPV_KHR_terminate_invocation" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_shader_terminate_invocation) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_shader_terminate_invocation`", |
| ])); |
| } |
| } |
| "SPV_KHR_multiview" => { |
| if !(device.api_version() >= Version::V1_1 || device.enabled_extensions().khr_multiview) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_multiview`", |
| ])); |
| } |
| } |
| "SPV_KHR_workgroup_memory_explicit_layout" => { |
| if !(device |
| .enabled_extensions() |
| .khr_workgroup_memory_explicit_layout) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `khr_workgroup_memory_explicit_layout`", |
| ])); |
| } |
| } |
| "SPV_EXT_shader_atomic_float_add" => { |
| if !(device.enabled_extensions().ext_shader_atomic_float) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_shader_atomic_float`", |
| ])); |
| } |
| } |
| "SPV_KHR_fragment_shader_barycentric" => { |
| if !(device.enabled_extensions().khr_fragment_shader_barycentric) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `khr_fragment_shader_barycentric`", |
| ])); |
| } |
| } |
| "SPV_KHR_subgroup_uniform_control_flow" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device |
| .enabled_extensions() |
| .khr_shader_subgroup_uniform_control_flow) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_shader_subgroup_uniform_control_flow`", |
| ])); |
| } |
| } |
| "SPV_EXT_shader_atomic_float_min_max" => { |
| if !(device.enabled_extensions().ext_shader_atomic_float2) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_shader_atomic_float2`", |
| ])); |
| } |
| } |
| "SPV_EXT_shader_atomic_float16_add" => { |
| if !(device.enabled_extensions().ext_shader_atomic_float2) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_shader_atomic_float2`", |
| ])); |
| } |
| } |
| "SPV_KHR_integer_dot_product" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_shader_integer_dot_product) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_shader_integer_dot_product`", |
| ])); |
| } |
| } |
| "SPV_INTEL_shader_integer_functions" => { |
| if !(device.enabled_extensions().intel_shader_integer_functions2) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `intel_shader_integer_functions2`", |
| ])); |
| } |
| } |
| "SPV_KHR_device_group" => { |
| if !(device.api_version() >= Version::V1_1 |
| || device.enabled_extensions().khr_device_group) |
| { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "Vulkan API version 1.1", |
| "device extension `khr_device_group`", |
| ])); |
| } |
| } |
| "SPV_QCOM_image_processing" => { |
| if !(device.enabled_extensions().qcom_image_processing) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `qcom_image_processing`", |
| ])); |
| } |
| } |
| "SPV_EXT_mesh_shader" => { |
| if !(device.enabled_extensions().ext_mesh_shader) { |
| return Err(ShaderSupportError::RequirementsNotMet(&[ |
| "device extension `ext_mesh_shader`", |
| ])); |
| } |
| } |
| _ => return Err(ShaderSupportError::NotSupportedByVulkan), |
| } |
| Ok(()) |
| } |