pub struct PhysicalDeviceFeatures {Show 27 fields
core: PhysicalDeviceFeatures,
pub(super) descriptor_indexing: Option<PhysicalDeviceDescriptorIndexingFeaturesEXT<'static>>,
timeline_semaphore: Option<PhysicalDeviceTimelineSemaphoreFeaturesKHR<'static>>,
image_robustness: Option<PhysicalDeviceImageRobustnessFeaturesEXT<'static>>,
robustness2: Option<PhysicalDeviceRobustness2FeaturesEXT<'static>>,
multiview: Option<PhysicalDeviceMultiviewFeaturesKHR<'static>>,
sampler_ycbcr_conversion: Option<PhysicalDeviceSamplerYcbcrConversionFeatures<'static>>,
astc_hdr: Option<PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT<'static>>,
shader_float16_int8: Option<PhysicalDeviceShaderFloat16Int8Features<'static>>,
_16bit_storage: Option<PhysicalDevice16BitStorageFeatures<'static>>,
acceleration_structure: Option<PhysicalDeviceAccelerationStructureFeaturesKHR<'static>>,
buffer_device_address: Option<PhysicalDeviceBufferDeviceAddressFeaturesKHR<'static>>,
ray_query: Option<PhysicalDeviceRayQueryFeaturesKHR<'static>>,
zero_initialize_workgroup_memory: Option<PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures<'static>>,
position_fetch: Option<PhysicalDeviceRayTracingPositionFetchFeaturesKHR<'static>>,
shader_atomic_int64: Option<PhysicalDeviceShaderAtomicInt64Features<'static>>,
shader_image_atomic_int64: Option<PhysicalDeviceShaderImageAtomicInt64FeaturesEXT<'static>>,
shader_atomic_float: Option<PhysicalDeviceShaderAtomicFloatFeaturesEXT<'static>>,
subgroup_size_control: Option<PhysicalDeviceSubgroupSizeControlFeatures<'static>>,
maintenance4: Option<PhysicalDeviceMaintenance4FeaturesKHR<'static>>,
mesh_shader: Option<PhysicalDeviceMeshShaderFeaturesEXT<'static>>,
shader_integer_dot_product: Option<PhysicalDeviceShaderIntegerDotProductFeaturesKHR<'static>>,
shader_barycentrics: Option<PhysicalDeviceFragmentShaderBarycentricFeaturesKHR<'static>>,
portability_subset: Option<PhysicalDevicePortabilitySubsetFeaturesKHR<'static>>,
cooperative_matrix: Option<PhysicalDeviceCooperativeMatrixFeaturesKHR<'static>>,
vulkan_memory_model: Option<PhysicalDeviceVulkanMemoryModelFeaturesKHR<'static>>,
shader_draw_parameters: Option<PhysicalDeviceShaderDrawParametersFeatures<'static>>,
}vulkan only.Expand description
Features supported by a [vk::PhysicalDevice] and its extensions.
This is used in two phases:
-
When enumerating adapters, this represents the features offered by the adapter.
Instance::expose_adaptercallsvkGetPhysicalDeviceFeatures2(orvkGetPhysicalDeviceFeaturesif that is not available) to collect this information about theVkPhysicalDevicerepresented by thewgpu_hal::ExposedAdapter. -
When opening a device, this represents the features we would like to enable. At
wgpu_hal::Deviceconstruction time,PhysicalDeviceFeatures::from_extensions_and_requested_featuresconstructs an value of this type indicating which Vulkan features to enable, based on thewgpu_types::Featuresrequested.
Fields§
§core: PhysicalDeviceFeaturesBasic Vulkan 1.0 features.
descriptor_indexing: Option<PhysicalDeviceDescriptorIndexingFeaturesEXT<'static>>Features provided by VK_EXT_descriptor_indexing, promoted to Vulkan 1.2.
timeline_semaphore: Option<PhysicalDeviceTimelineSemaphoreFeaturesKHR<'static>>Features provided by VK_KHR_timeline_semaphore, promoted to Vulkan 1.2
image_robustness: Option<PhysicalDeviceImageRobustnessFeaturesEXT<'static>>Features provided by VK_EXT_image_robustness, promoted to Vulkan 1.3
robustness2: Option<PhysicalDeviceRobustness2FeaturesEXT<'static>>Features provided by VK_EXT_robustness2.
multiview: Option<PhysicalDeviceMultiviewFeaturesKHR<'static>>Features provided by VK_KHR_multiview, promoted to Vulkan 1.1.
sampler_ycbcr_conversion: Option<PhysicalDeviceSamplerYcbcrConversionFeatures<'static>>Features provided by VK_KHR_sampler_ycbcr_conversion, promoted to Vulkan 1.1.
astc_hdr: Option<PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT<'static>>Features provided by VK_EXT_texture_compression_astc_hdr, promoted to Vulkan 1.3.
shader_float16_int8: Option<PhysicalDeviceShaderFloat16Int8Features<'static>>Features provided by VK_KHR_shader_float16_int8, promoted to Vulkan 1.2
_16bit_storage: Option<PhysicalDevice16BitStorageFeatures<'static>>Features provided by VK_KHR_16bit_storage, promoted to Vulkan 1.1
acceleration_structure: Option<PhysicalDeviceAccelerationStructureFeaturesKHR<'static>>Features provided by VK_KHR_acceleration_structure.
buffer_device_address: Option<PhysicalDeviceBufferDeviceAddressFeaturesKHR<'static>>Features provided by VK_KHR_buffer_device_address, promoted to Vulkan 1.2.
We only use this feature for
Features::EXPERIMENTAL_RAY_QUERY, which requires
VK_KHR_acceleration_structure, which depends on
VK_KHR_buffer_device_address, so Instance::expose_adapter only
bothers to check if VK_KHR_acceleration_structure is available,
leaving this None.
However, we do populate this when creating a device if
Features::EXPERIMENTAL_RAY_QUERY is requested.
ray_query: Option<PhysicalDeviceRayQueryFeaturesKHR<'static>>Features provided by VK_KHR_ray_query,
Vulkan requires that the feature be present if the VK_KHR_ray_query
extension is present, so Instance::expose_adapter doesn’t bother retrieving
this from vkGetPhysicalDeviceFeatures2.
However, we do populate this when creating a device if ray tracing is requested.
zero_initialize_workgroup_memory: Option<PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures<'static>>Features provided by VK_KHR_zero_initialize_workgroup_memory, promoted
to Vulkan 1.3.
position_fetch: Option<PhysicalDeviceRayTracingPositionFetchFeaturesKHR<'static>>§shader_atomic_int64: Option<PhysicalDeviceShaderAtomicInt64Features<'static>>Features provided by VK_KHR_shader_atomic_int64, promoted to Vulkan 1.2.
shader_image_atomic_int64: Option<PhysicalDeviceShaderImageAtomicInt64FeaturesEXT<'static>>Features provided by VK_EXT_shader_image_atomic_int64
shader_atomic_float: Option<PhysicalDeviceShaderAtomicFloatFeaturesEXT<'static>>Features provided by VK_EXT_shader_atomic_float.
subgroup_size_control: Option<PhysicalDeviceSubgroupSizeControlFeatures<'static>>Features provided by VK_EXT_subgroup_size_control, promoted to Vulkan 1.3.
maintenance4: Option<PhysicalDeviceMaintenance4FeaturesKHR<'static>>Features provided by VK_KHR_maintenance4, promoted to Vulkan 1.3.
mesh_shader: Option<PhysicalDeviceMeshShaderFeaturesEXT<'static>>Features proved by VK_EXT_mesh_shader
shader_integer_dot_product: Option<PhysicalDeviceShaderIntegerDotProductFeaturesKHR<'static>>Features provided by VK_KHR_shader_integer_dot_product, promoted to Vulkan 1.3.
shader_barycentrics: Option<PhysicalDeviceFragmentShaderBarycentricFeaturesKHR<'static>>Features provided by VK_KHR_fragment_shader_barycentric
portability_subset: Option<PhysicalDevicePortabilitySubsetFeaturesKHR<'static>>Features provided by VK_KHR_portability_subset.
Strictly speaking this tells us what features we don’t have compared to core.
cooperative_matrix: Option<PhysicalDeviceCooperativeMatrixFeaturesKHR<'static>>Features provided by VK_KHR_cooperative_matrix
vulkan_memory_model: Option<PhysicalDeviceVulkanMemoryModelFeaturesKHR<'static>>Features provided by VK_KHR_vulkan_memory_model, promoted to Vulkan 1.2
shader_draw_parameters: Option<PhysicalDeviceShaderDrawParametersFeatures<'static>>Implementations§
Source§impl PhysicalDeviceFeatures
impl PhysicalDeviceFeatures
pub fn get_core(&self) -> PhysicalDeviceFeatures
Sourcepub fn add_to_device_create<'a>(
&'a mut self,
info: DeviceCreateInfo<'a>,
) -> DeviceCreateInfo<'a>
pub fn add_to_device_create<'a>( &'a mut self, info: DeviceCreateInfo<'a>, ) -> DeviceCreateInfo<'a>
Add the members of self into info.enabled_features and its p_next chain.
fn supports_storage_input_output_16(&self) -> bool
Sourcefn from_extensions_and_requested_features(
phd_capabilities: &PhysicalDeviceProperties,
phd_features: &PhysicalDeviceFeatures,
enabled_extensions: &[&'static CStr],
requested_features: Features,
downlevel_flags: DownlevelFlags,
private_caps: &PrivateCapabilities,
) -> Self
fn from_extensions_and_requested_features( phd_capabilities: &PhysicalDeviceProperties, phd_features: &PhysicalDeviceFeatures, enabled_extensions: &[&'static CStr], requested_features: Features, downlevel_flags: DownlevelFlags, private_caps: &PrivateCapabilities, ) -> Self
Create a PhysicalDeviceFeatures that can be used to create a logical
device.
Return a PhysicalDeviceFeatures value capturing all the Vulkan
features needed for the given Features, DownlevelFlags, and
PrivateCapabilities. You can use the returned value’s
add_to_device_create method to configure a
[vk::DeviceCreateInfo] to build a logical device providing those
features.
To ensure that the returned value is able to select all the Vulkan
features needed to express requested_features, downlevel_flags, and
private_caps:
-
The given
enabled_extensionsset must include all the extensions selected byAdapter::required_device_extensionswhen passedfeatures. -
The given
device_api_versionmust be the Vulkan API version of the physical device we will use to create the logical device.
Sourcefn to_wgpu(
&self,
instance: &Instance,
phd: PhysicalDevice,
caps: &PhysicalDeviceProperties,
queue_props: &QueueFamilyProperties,
) -> (Features, DownlevelFlags)
fn to_wgpu( &self, instance: &Instance, phd: PhysicalDevice, caps: &PhysicalDeviceProperties, queue_props: &QueueFamilyProperties, ) -> (Features, DownlevelFlags)
Compute the wgpu Features and DownlevelFlags supported by a physical device.
Given self, together with the instance and physical device it was
built from, and a caps also built from those, determine which wgpu
features and downlevel flags the device can support.
Trait Implementations§
Source§impl Debug for PhysicalDeviceFeatures
impl Debug for PhysicalDeviceFeatures
Source§impl Default for PhysicalDeviceFeatures
impl Default for PhysicalDeviceFeatures
Source§fn default() -> PhysicalDeviceFeatures
fn default() -> PhysicalDeviceFeatures
Auto Trait Implementations§
impl Freeze for PhysicalDeviceFeatures
impl RefUnwindSafe for PhysicalDeviceFeatures
impl Send for PhysicalDeviceFeatures
impl Sync for PhysicalDeviceFeatures
impl Unpin for PhysicalDeviceFeatures
impl UnwindSafe for PhysicalDeviceFeatures
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more