Struct Features
#[repr(C)]pub struct Features {
pub features_wgpu: FeaturesWGPU,
pub features_webgpu: FeaturesWebGPU,
}unstable-wgpu-27 only.Expand description
Features that are not guaranteed to be supported.
These are either part of the webgpu standard, or are extension features supported by wgpu when targeting native.
If you want to use a feature, you need to first verify that the adapter supports the feature. If the adapter does not support the feature, requesting a device with it enabled will panic.
Corresponds to WebGPU GPUFeatureName.
Fields§
§features_wgpu: FeaturesWGPU§features_webgpu: FeaturesWebGPUImplementations§
§impl Features
impl Features
pub const SHADER_FLOAT32_ATOMIC: Features
Available on crate feature wgpu-27 only.
pub const SHADER_FLOAT32_ATOMIC: Features
wgpu-27 only.Allows shaders to use f32 atomic load, store, add, sub, and exchange.
Supported platforms:
- Metal (with MSL 3.0+ and Apple7+/Mac2)
- Vulkan (with VK_EXT_shader_atomic_float)
This is a native only feature.
pub const TEXTURE_FORMAT_16BIT_NORM: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_FORMAT_16BIT_NORM: Features
wgpu-27 only.Enables normalized 16-bit texture formats.
Supported platforms:
- Vulkan
- DX12
- Metal
This is a native only feature.
pub const TEXTURE_COMPRESSION_ASTC_HDR: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_COMPRESSION_ASTC_HDR: Features
wgpu-27 only.Enables ASTC HDR family of compressed textures.
Compressed textures sacrifice some quality in exchange for significantly reduced bandwidth usage.
Support for this feature guarantees availability of [TextureUsages::COPY_SRC | TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING] for ASTC formats with the HDR channel type.
Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES may enable additional usages.
Supported Platforms:
- Metal
- Vulkan
- OpenGL
This is a native only feature.
pub const TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES: Features
wgpu-27 only.Enables device specific texture format features.
See TextureFormatFeatures for a listing of the features in question.
By default only texture format properties as defined by the WebGPU specification are allowed. Enabling this feature flag extends the features of each format to the ones supported by the current device. Note that without this flag, read/write storage access is not allowed at all.
This extension does not enable additional formats.
This is a native only feature.
pub const PIPELINE_STATISTICS_QUERY: Features
Available on crate feature wgpu-27 only.
pub const PIPELINE_STATISTICS_QUERY: Features
wgpu-27 only.Enables use of Pipeline Statistics Queries. These queries tell the count of various operations
performed between the start and stop call. Call RenderPass::begin_pipeline_statistics_query to start
a query, then call RenderPass::end_pipeline_statistics_query to stop one.
They must be resolved using CommandEncoder::resolve_query_set into a buffer.
The rules on how these resolve into buffers are detailed in the documentation for PipelineStatisticsTypes.
Supported Platforms:
- Vulkan
- DX12
This is a native only feature with a proposal for the web.
pub const TIMESTAMP_QUERY_INSIDE_ENCODERS: Features
Available on crate feature wgpu-27 only.
pub const TIMESTAMP_QUERY_INSIDE_ENCODERS: Features
wgpu-27 only.Allows for timestamp queries directly on command encoders.
Implies Features::TIMESTAMP_QUERY is supported.
Additionally allows for timestamp writes on command encoders
using CommandEncoder::write_timestamp.
Supported platforms:
- Vulkan
- DX12
- Metal
This is a native only feature.
pub const TIMESTAMP_QUERY_INSIDE_PASSES: Features
Available on crate feature wgpu-27 only.
pub const TIMESTAMP_QUERY_INSIDE_PASSES: Features
wgpu-27 only.Allows for timestamp queries directly on command encoders.
Implies Features::TIMESTAMP_QUERY & Features::TIMESTAMP_QUERY_INSIDE_ENCODERS is supported.
Additionally allows for timestamp queries to be used inside render & compute passes using:
Supported platforms:
- Vulkan
- DX12
- Metal (AMD & Intel, not Apple GPUs)
This is generally not available on tile-based rasterization GPUs.
This is a native only feature with a proposal for the web.
pub const MAPPABLE_PRIMARY_BUFFERS: Features
Available on crate feature wgpu-27 only.
pub const MAPPABLE_PRIMARY_BUFFERS: Features
wgpu-27 only.Webgpu only allows the MAP_READ and MAP_WRITE buffer usage to be matched with COPY_DST and COPY_SRC respectively. This removes this requirement.
This is only beneficial on systems that share memory between CPU and GPU. If enabled on a system that doesn’t, this can severely hinder performance. Only use if you understand the consequences.
Supported platforms:
- Vulkan
- DX12
- Metal
This is a native only feature.
pub const TEXTURE_BINDING_ARRAY: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_BINDING_ARRAY: Features
wgpu-27 only.Allows the user to create uniform arrays of textures in shaders:
ex.
var textures: binding_array<texture_2d<f32>, 10>(WGSL)uniform texture2D textures[10](GLSL)
If Features::STORAGE_RESOURCE_BINDING_ARRAY is supported as well as this, the user
may also create uniform arrays of storage textures.
ex.
var textures: array<texture_storage_2d<r32float, write>, 10>(WGSL)uniform image2D textures[10](GLSL)
This capability allows them to exist and to be indexed by dynamically uniform values.
Supported platforms:
- DX12
- Metal (with MSL 2.0+ on macOS 10.13+)
- Vulkan
This is a native only feature.
pub const BUFFER_BINDING_ARRAY: Features
Available on crate feature wgpu-27 only.
pub const BUFFER_BINDING_ARRAY: Features
wgpu-27 only.Allows the user to create arrays of buffers in shaders:
ex.
var<uniform> buffer_array: array<MyBuffer, 10>(WGSL)uniform myBuffer { ... } buffer_array[10](GLSL)
This capability allows them to exist and to be indexed by dynamically uniform values.
If Features::STORAGE_RESOURCE_BINDING_ARRAY is supported as well as this, the user
may also create arrays of storage buffers.
ex.
var<storage> buffer_array: array<MyBuffer, 10>(WGSL)buffer myBuffer { ... } buffer_array[10](GLSL)
Supported platforms:
- Vulkan
This is a native only feature.
pub const STORAGE_RESOURCE_BINDING_ARRAY: Features
Available on crate feature wgpu-27 only.
pub const STORAGE_RESOURCE_BINDING_ARRAY: Features
wgpu-27 only.Allows the user to create uniform arrays of storage buffers or textures in shaders,
if resp. Features::BUFFER_BINDING_ARRAY or Features::TEXTURE_BINDING_ARRAY
is supported.
This capability allows them to exist and to be indexed by dynamically uniform values.
Supported platforms:
- Metal (with MSL 2.2+ on macOS 10.13+)
- Vulkan
This is a native only feature.
pub const SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING: Features
Available on crate feature wgpu-27 only.
pub const SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING: Features
wgpu-27 only.Allows shaders to index sampled texture and storage buffer resource arrays with dynamically non-uniform values:
ex. texture_array[vertex_data]
In order to use this capability, the corresponding GLSL extension must be enabled like so:
#extension GL_EXT_nonuniform_qualifier : require
and then used either as nonuniformEXT qualifier in variable declaration:
ex. layout(location = 0) nonuniformEXT flat in int vertex_data;
or as nonuniformEXT constructor:
ex. texture_array[nonuniformEXT(vertex_data)]
WGSL and HLSL do not need any extension.
Supported platforms:
- DX12
- Metal (with MSL 2.0+ on macOS 10.13+)
- Vulkan 1.2+ (or VK_EXT_descriptor_indexing)’s shaderSampledImageArrayNonUniformIndexing & shaderStorageBufferArrayNonUniformIndexing feature)
This is a native only feature.
pub const STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING: Features
Available on crate feature wgpu-27 only.
pub const STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING: Features
wgpu-27 only.Allows shaders to index storage texture resource arrays with dynamically non-uniform values:
ex. texture_array[vertex_data]
Supported platforms:
- DX12
- Metal (with MSL 2.0+ on macOS 10.13+)
- Vulkan 1.2+ (or VK_EXT_descriptor_indexing)’s shaderStorageTextureArrayNonUniformIndexing feature)
This is a native only feature.
pub const PARTIALLY_BOUND_BINDING_ARRAY: Features
Available on crate feature wgpu-27 only.
pub const PARTIALLY_BOUND_BINDING_ARRAY: Features
wgpu-27 only.Allows the user to create bind groups containing arrays with less bindings than the BindGroupLayout.
Supported platforms:
- Vulkan
- DX12
This is a native only feature.
pub const MULTI_DRAW_INDIRECT_COUNT: Features
Available on crate feature wgpu-27 only.
pub const MULTI_DRAW_INDIRECT_COUNT: Features
wgpu-27 only.Allows the user to call RenderPass::multi_draw_indirect_count and RenderPass::multi_draw_indexed_indirect_count.
This allows the use of a buffer containing the actual number of draw calls. This feature being present also implies
that all calls to RenderPass::multi_draw_indirect and RenderPass::multi_draw_indexed_indirect are not being emulated
with a series of draw_indirect calls.
Supported platforms:
- DX12
- Vulkan 1.2+ (or VK_KHR_draw_indirect_count)
This is a native only feature.
pub const PUSH_CONSTANTS: Features
Available on crate feature wgpu-27 only.
pub const PUSH_CONSTANTS: Features
wgpu-27 only.Allows the use of push constants: small, fast bits of memory that can be updated
inside a RenderPass.
Allows the user to call RenderPass::set_push_constants, provide a non-empty array
to PipelineLayoutDescriptor, and provide a non-zero limit to Limits::max_push_constant_size.
A block of push constants can be declared in WGSL with var<push_constant>:
struct PushConstants { example: f32, }
var<push_constant> c: PushConstants;In GLSL, this corresponds to layout(push_constant) uniform Name {..}.
Supported platforms:
- DX12
- Vulkan
- Metal
- OpenGL (emulated with uniforms)
This is a native only feature.
pub const ADDRESS_MODE_CLAMP_TO_ZERO: Features
Available on crate feature wgpu-27 only.
pub const ADDRESS_MODE_CLAMP_TO_ZERO: Features
wgpu-27 only.Allows the use of AddressMode::ClampToBorder with a border color
of SamplerBorderColor::Zero.
Supported platforms:
- DX12
- Vulkan
- Metal
- OpenGL
This is a native only feature.
pub const ADDRESS_MODE_CLAMP_TO_BORDER: Features
Available on crate feature wgpu-27 only.
pub const ADDRESS_MODE_CLAMP_TO_BORDER: Features
wgpu-27 only.Allows the use of AddressMode::ClampToBorder with a border color
other than SamplerBorderColor::Zero.
Supported platforms:
- DX12
- Vulkan
- Metal (macOS 10.12+ only)
- OpenGL
This is a native only feature.
pub const POLYGON_MODE_LINE: Features
Available on crate feature wgpu-27 only.
pub const POLYGON_MODE_LINE: Features
wgpu-27 only.Allows the user to set PolygonMode::Line in PrimitiveState::polygon_mode
This allows drawing polygons/triangles as lines (wireframe) instead of filled
Supported platforms:
- DX12
- Vulkan
- Metal
This is a native only feature.
pub const POLYGON_MODE_POINT: Features
Available on crate feature wgpu-27 only.
pub const POLYGON_MODE_POINT: Features
wgpu-27 only.Allows the user to set PolygonMode::Point in PrimitiveState::polygon_mode
This allows only drawing the vertices of polygons/triangles instead of filled
Supported platforms:
- Vulkan
This is a native only feature.
pub const CONSERVATIVE_RASTERIZATION: Features
Available on crate feature wgpu-27 only.
pub const CONSERVATIVE_RASTERIZATION: Features
wgpu-27 only.Allows the user to set a overestimation-conservative-rasterization in PrimitiveState::conservative
Processing of degenerate triangles/lines is hardware specific. Only triangles are supported.
Supported platforms:
- Vulkan
This is a native only feature.
pub const VERTEX_WRITABLE_STORAGE: Features
Available on crate feature wgpu-27 only.
pub const VERTEX_WRITABLE_STORAGE: Features
wgpu-27 only.Enables bindings of writable storage buffers and textures visible to vertex shaders.
Note: some (tiled-based) platforms do not support vertex shaders with any side-effects.
Supported Platforms:
- All
This is a native only feature.
pub const CLEAR_TEXTURE: Features
Available on crate feature wgpu-27 only.
pub const CLEAR_TEXTURE: Features
wgpu-27 only.Enables clear to zero for textures.
Supported platforms:
- All
This is a native only feature.
pub const MULTIVIEW: Features
Available on crate feature wgpu-27 only.
pub const MULTIVIEW: Features
wgpu-27 only.Enables multiview render passes and builtin(view_index) in vertex shaders.
Supported platforms:
- Vulkan
- OpenGL (web only)
This is a native only feature.
pub const VERTEX_ATTRIBUTE_64BIT: Features
Available on crate feature wgpu-27 only.
pub const VERTEX_ATTRIBUTE_64BIT: Features
wgpu-27 only.Enables using 64-bit types for vertex attributes.
Requires SHADER_FLOAT64.
Supported Platforms: N/A
This is a native only feature.
pub const TEXTURE_ATOMIC: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_ATOMIC: Features
wgpu-27 only.Enables image atomic fetch add, and, xor, or, min, and max for R32Uint and R32Sint textures.
Supported platforms:
- Vulkan
- DX12
- Metal (with MSL 3.1+)
This is a native only feature.
pub const TEXTURE_FORMAT_NV12: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_FORMAT_NV12: Features
wgpu-27 only.Allows for creation of textures of format TextureFormat::NV12
Supported platforms:
- DX12
- Vulkan
This is a native only feature.
pub const TEXTURE_FORMAT_P010: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_FORMAT_P010: Features
wgpu-27 only.Allows for creation of textures of format TextureFormat::P010
Supported platforms:
- DX12
- Vulkan
This is a native only feature.
pub const EXTERNAL_TEXTURE: Features
Available on crate feature wgpu-27 only.
pub const EXTERNAL_TEXTURE: Features
wgpu-27 only.Allows for the creation and usage of ExternalTextures, and bind
group layouts containing external texture BindingTypes.
Conceptually this should really be a crate::DownlevelFlags as
it corresponds to WebGPU’s GPUExternalTexture.
However, the implementation is currently in-progress, and until it
is complete we do not want applications to ignore adapters due to
a missing downlevel flag, when they may not require this feature at
all.
Supported platforms:
- DX12
- Metal
pub const EXPERIMENTAL_RAY_QUERY: Features
Available on crate feature wgpu-27 only.
pub const EXPERIMENTAL_RAY_QUERY: Features
wgpu-27 only.THIS IS EXPERIMENTAL: Features enabled by this may have major bugs in it and are expected to be subject to breaking changes, suggestions for the API exposed by this should be posted on the ray-tracing issue
Allows for the creation of ray-tracing queries within shaders.
Supported platforms:
- Vulkan
This is a native-only feature.
pub const SHADER_F64: Features
Available on crate feature wgpu-27 only.
pub const SHADER_F64: Features
wgpu-27 only.Enables 64-bit floating point types in SPIR-V shaders.
Note: even when supported by GPU hardware, 64-bit floating point operations are frequently between 16 and 64 times slower than equivalent operations on 32-bit floats.
Supported Platforms:
- Vulkan
This is a native only feature.
pub const SHADER_I16: Features
Available on crate feature wgpu-27 only.
pub const SHADER_I16: Features
wgpu-27 only.Allows shaders to use i16. Not currently supported in naga, only available through spirv-passthrough.
Supported platforms:
- Vulkan
This is a native only feature.
pub const SHADER_PRIMITIVE_INDEX: Features
Available on crate feature wgpu-27 only.
pub const SHADER_PRIMITIVE_INDEX: Features
wgpu-27 only.Enables builtin(primitive_index) in fragment shaders.
Note: enables geometry processing for pipelines using the builtin. This may come with a significant performance impact on some hardware. Other pipelines are not affected.
Supported platforms:
- Vulkan
- DX12
- Metal (some)
- OpenGL (some)
This is a native only feature.
pub const SHADER_EARLY_DEPTH_TEST: Features
Available on crate feature wgpu-27 only.
pub const SHADER_EARLY_DEPTH_TEST: Features
wgpu-27 only.Allows shaders to use the early_depth_test attribute.
The attribute is applied to the fragment shader entry point. It can be used in two ways:
-
Force early depth/stencil tests:
-
@early_depth_test(force)(WGSL) -
layout(early_fragment_tests) in;(GLSL)
-
-
Provide a conservative depth specifier that allows an additional early depth test under certain conditions:
-
@early_depth_test(greater_equal/less_equal/unchanged)(WGSL) -
layout(depth_<greater/less/unchanged>) out float gl_FragDepth;(GLSL)
-
See EarlyDepthTest for more details.
Supported platforms:
- Vulkan
- GLES 3.1+
This is a native only feature.
pub const SHADER_INT64: Features
Available on crate feature wgpu-27 only.
pub const SHADER_INT64: Features
wgpu-27 only.Allows shaders to use i64 and u64.
Supported platforms:
- Vulkan
- DX12 (DXC only)
- Metal (with MSL 2.3+)
This is a native only feature.
pub const SUBGROUP: Features
Available on crate feature wgpu-27 only.
pub const SUBGROUP: Features
wgpu-27 only.Allows compute and fragment shaders to use the subgroup operation built-ins and perform subgroup operations (except barriers).
Supported Platforms:
- Vulkan
- DX12
- Metal
This is a native only feature.
pub const SUBGROUP_VERTEX: Features
Available on crate feature wgpu-27 only.
pub const SUBGROUP_VERTEX: Features
wgpu-27 only.Allows vertex shaders to use the subgroup operation built-ins and perform subgroup operations (except barriers).
Supported Platforms:
- Vulkan
This is a native only feature.
pub const SUBGROUP_BARRIER: Features
Available on crate feature wgpu-27 only.
pub const SUBGROUP_BARRIER: Features
wgpu-27 only.Allows compute shaders to use the subgroup barrier.
Requires Features::SUBGROUP. Without it, enables nothing.
Supported Platforms:
- Vulkan
- Metal
This is a native only feature.
pub const PIPELINE_CACHE: Features
Available on crate feature wgpu-27 only.
pub const PIPELINE_CACHE: Features
wgpu-27 only.Allows the use of pipeline cache objects
Supported platforms:
- Vulkan
Unimplemented Platforms:
- DX12
- Metal
pub const SHADER_INT64_ATOMIC_MIN_MAX: Features
Available on crate feature wgpu-27 only.
pub const SHADER_INT64_ATOMIC_MIN_MAX: Features
wgpu-27 only.Allows shaders to use i64 and u64 atomic min and max.
Supported platforms:
- Vulkan (with VK_KHR_shader_atomic_int64)
- DX12 (with SM 6.6+)
- Metal (with MSL 2.4+)
This is a native only feature.
pub const SHADER_INT64_ATOMIC_ALL_OPS: Features
Available on crate feature wgpu-27 only.
pub const SHADER_INT64_ATOMIC_ALL_OPS: Features
wgpu-27 only.Allows shaders to use all i64 and u64 atomic operations.
Supported platforms:
- Vulkan (with VK_KHR_shader_atomic_int64)
- DX12 (with SM 6.6+)
This is a native only feature.
pub const VULKAN_GOOGLE_DISPLAY_TIMING: Features
Available on crate feature wgpu-27 only.
pub const VULKAN_GOOGLE_DISPLAY_TIMING: Features
wgpu-27 only.Allows using the VK_GOOGLE_display_timing Vulkan extension.
This is used for frame pacing to reduce latency, and is generally only available on Android.
This feature does not have a wgpu-level API, and so users of wgpu wishing
to use this functionality must access it using various as_hal functions,
primarily Surface::as_hal(), to then use.
Supported platforms:
- Vulkan (with VK_GOOGLE_display_timing)
This is a native only feature.
pub const VULKAN_EXTERNAL_MEMORY_WIN32: Features
Available on crate feature wgpu-27 only.
pub const VULKAN_EXTERNAL_MEMORY_WIN32: Features
wgpu-27 only.Allows using the VK_KHR_external_memory_win32 Vulkan extension.
Supported platforms:
- Vulkan (with VK_KHR_external_memory_win32)
This is a native only feature.
pub const TEXTURE_INT64_ATOMIC: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_INT64_ATOMIC: Features
wgpu-27 only.Enables R64Uint image atomic min and max.
Supported platforms:
- Vulkan (with VK_EXT_shader_image_atomic_int64)
- DX12 (with SM 6.6+)
- Metal (with MSL 3.1+)
This is a native only feature.
pub const UNIFORM_BUFFER_BINDING_ARRAYS: Features
Available on crate feature wgpu-27 only.
pub const UNIFORM_BUFFER_BINDING_ARRAYS: Features
wgpu-27 only.Allows uniform buffers to be bound as binding arrays.
This allows:
- Shaders to contain
var<uniform> buffer: binding_array<UniformBuffer>; - The
countfield ofBindGroupLayoutEntrys withUniformbuffers, to be set toSome.
Supported platforms:
Potential Platforms:
- DX12
- Metal
- Vulkan 1.2+ (or VK_EXT_descriptor_indexing)’s
shaderUniformBufferArrayNonUniformIndexingfeature)
This is a native only feature.
pub const EXPERIMENTAL_MESH_SHADER: Features
Available on crate feature wgpu-27 only.
pub const EXPERIMENTAL_MESH_SHADER: Features
wgpu-27 only.Enables mesh shaders and task shaders in mesh shader pipelines.
Supported platforms:
- Vulkan (with VK_EXT_mesh_shader)
Potential Platforms:
- DX12
- Metal
This is a native only feature.
pub const EXPERIMENTAL_RAY_HIT_VERTEX_RETURN: Features
Available on crate feature wgpu-27 only.
pub const EXPERIMENTAL_RAY_HIT_VERTEX_RETURN: Features
wgpu-27 only.THIS IS EXPERIMENTAL: Features enabled by this may have major bugs in them and are expected to be subject to breaking changes, suggestions for the API exposed by this should be posted on the ray-tracing issue
Allows for returning of the hit triangle’s vertex position when tracing with an
acceleration structure marked with AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN.
Supported platforms:
- Vulkan
This is a native only feature
pub const EXPERIMENTAL_MESH_SHADER_MULTIVIEW: Features
Available on crate feature wgpu-27 only.
pub const EXPERIMENTAL_MESH_SHADER_MULTIVIEW: Features
wgpu-27 only.Enables multiview in mesh shader pipelines
Supported platforms:
- Vulkan (with VK_EXT_mesh_shader)
Potential Platforms:
- DX12
- Metal
This is a native only feature.
pub const EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS: Features
Available on crate feature wgpu-27 only.
pub const EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS: Features
wgpu-27 only.Allows usage of additional vertex formats in BlasTriangleGeometrySizeDescriptor::vertex_format
Supported platforms
- Vulkan
- DX12
pub const EXPERIMENTAL_PASSTHROUGH_SHADERS: Features
Available on crate feature wgpu-27 only.
pub const EXPERIMENTAL_PASSTHROUGH_SHADERS: Features
wgpu-27 only.Enables creating shaders from passthrough with reflection info (unsafe)
Allows using Device::create_shader_module_passthrough.
Shader code isn’t parsed or interpreted in any way. It is the user’s
responsibility to ensure the code and reflection (if passed) are correct.
Supported platforms
- Vulkan
- DX12
- Metal
- WebGPU
Ideally, in the future, all platforms will be supported. For more info, see this comment.
pub const DEPTH_CLIP_CONTROL: Features
Available on crate feature wgpu-27 only.
pub const DEPTH_CLIP_CONTROL: Features
wgpu-27 only.By default, polygon depth is clipped to 0-1 range before/during rasterization. Anything outside of that range is rejected, and respective fragments are not touched.
With this extension, we can disabling clipping. That allows shadow map occluders to be rendered into a tighter depth range.
Supported platforms:
- desktops
- some mobile chips
This is a web and native feature.
pub const DEPTH32FLOAT_STENCIL8: Features
Available on crate feature wgpu-27 only.
pub const DEPTH32FLOAT_STENCIL8: Features
wgpu-27 only.Allows for explicit creation of textures of format TextureFormat::Depth32FloatStencil8
Supported platforms:
- Vulkan (mostly)
- DX12
- Metal
- OpenGL
This is a web and native feature.
pub const TEXTURE_COMPRESSION_BC: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_COMPRESSION_BC: Features
wgpu-27 only.Enables BCn family of compressed textures. All BCn textures use 4x4 pixel blocks with 8 or 16 bytes per block.
Compressed textures sacrifice some quality in exchange for significantly reduced bandwidth usage.
Support for this feature guarantees availability of [TextureUsages::COPY_SRC | TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING] for BCn formats.
Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES may enable additional usages.
This feature guarantees availability of sliced-3d textures for BC formats when combined with TEXTURE_COMPRESSION_BC_SLICED_3D.
Supported Platforms:
- desktops
- Mobile (All Apple9 and some Apple7 and Apple8 devices)
This is a web and native feature.
pub const TEXTURE_COMPRESSION_BC_SLICED_3D: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_COMPRESSION_BC_SLICED_3D: Features
wgpu-27 only.Allows the 3d dimension for textures with BC compressed formats.
This feature must be used in combination with TEXTURE_COMPRESSION_BC to enable 3D textures with BC compression. It does not enable the BC formats by itself.
Supported Platforms:
- desktops
- Mobile (All Apple9 and some Apple7 and Apple8 devices)
This is a web and native feature.
pub const TEXTURE_COMPRESSION_ETC2: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_COMPRESSION_ETC2: Features
wgpu-27 only.Enables ETC family of compressed textures. All ETC textures use 4x4 pixel blocks. ETC2 RGB and RGBA1 are 8 bytes per block. RTC2 RGBA8 and EAC are 16 bytes per block.
Compressed textures sacrifice some quality in exchange for significantly reduced bandwidth usage.
Support for this feature guarantees availability of [TextureUsages::COPY_SRC | TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING] for ETC2 formats.
Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES may enable additional usages.
Supported Platforms:
- Vulkan on Intel
- Mobile (some)
This is a web and native feature.
pub const TEXTURE_COMPRESSION_ASTC: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_COMPRESSION_ASTC: Features
wgpu-27 only.Enables ASTC family of compressed textures. ASTC textures use pixel blocks varying from 4x4 to 12x12. Blocks are always 16 bytes.
Compressed textures sacrifice some quality in exchange for significantly reduced bandwidth usage.
Support for this feature guarantees availability of [TextureUsages::COPY_SRC | TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING] for ASTC formats with Unorm/UnormSrgb channel type.
Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES may enable additional usages.
This feature does not guarantee availability of sliced 3d textures for ASTC formats. If available, 3d support can be enabled by TEXTURE_COMPRESSION_ASTC_SLICED_3D feature.
Supported Platforms:
- Vulkan on Intel
- Mobile (some)
This is a web and native feature.
pub const TEXTURE_COMPRESSION_ASTC_SLICED_3D: Features
Available on crate feature wgpu-27 only.
pub const TEXTURE_COMPRESSION_ASTC_SLICED_3D: Features
wgpu-27 only.Allows the 3d dimension for textures with ASTC compressed formats.
This feature must be used in combination with TEXTURE_COMPRESSION_ASTC to enable 3D textures with ASTC compression. It does not enable the ASTC formats by itself.
Supported Platforms:
- Vulkan (some)
- Metal on Apple3+
- OpenGL/WebGL (some)
Not Supported:
- DX12
This is a web and native feature.
pub const TIMESTAMP_QUERY: Features
Available on crate feature wgpu-27 only.
pub const TIMESTAMP_QUERY: Features
wgpu-27 only.Enables use of Timestamp Queries. These queries tell the current gpu timestamp when all work before the query is finished.
This feature allows the use of
RenderPassDescriptor::timestamp_writesComputePassDescriptor::timestamp_writesto write out timestamps.
For arbitrary timestamp write commands on encoders refer to Features::TIMESTAMP_QUERY_INSIDE_ENCODERS.
For arbitrary timestamp write commands on passes refer to Features::TIMESTAMP_QUERY_INSIDE_PASSES.
They must be resolved using CommandEncoder::resolve_query_set into a buffer,
then the result must be multiplied by the timestamp period Queue::get_timestamp_period
to get the timestamp in nanoseconds. Multiple timestamps can then be diffed to get the
time for operations between them to finish.
Supported Platforms:
- Vulkan
- DX12
- Metal
This is a web and native feature.
pub const INDIRECT_FIRST_INSTANCE: Features
Available on crate feature wgpu-27 only.
pub const INDIRECT_FIRST_INSTANCE: Features
wgpu-27 only.Allows non-zero value for the first_instance member in indirect draw calls.
If this feature is not enabled, and the first_instance member is non-zero, the behavior may be:
- The draw call is ignored.
- The draw call is executed as if the
first_instanceis zero. - The draw call is executed with the correct
first_instancevalue.
Supported Platforms:
- Vulkan (mostly)
- DX12
- Metal on Apple3+ or Mac1+
- OpenGL (Desktop 4.2+ with ARB_shader_draw_parameters only)
Not Supported:
- OpenGL ES / WebGL
This is a web and native feature.
pub const SHADER_F16: Features
Available on crate feature wgpu-27 only.
pub const SHADER_F16: Features
wgpu-27 only.Allows shaders to use 16-bit floating point types. You may use them uniform buffers, storage buffers, and local variables. You may not use them in push constants.
In order to use this in WGSL shaders, you must add enable f16; to the top of your shader,
before any global items.
Supported Platforms:
- Vulkan
- Metal
- DX12
This is a web and native feature.
pub const RG11B10UFLOAT_RENDERABLE: Features
Available on crate feature wgpu-27 only.
pub const RG11B10UFLOAT_RENDERABLE: Features
wgpu-27 only.Allows for usage of textures of format TextureFormat::Rg11b10Ufloat as a render target
Supported platforms:
- Vulkan
- DX12
- Metal
This is a web and native feature.
pub const BGRA8UNORM_STORAGE: Features
Available on crate feature wgpu-27 only.
pub const BGRA8UNORM_STORAGE: Features
wgpu-27 only.Allows the TextureUsages::STORAGE_BINDING usage on textures with format TextureFormat::Bgra8Unorm
Supported Platforms:
- Vulkan
- DX12
- Metal
This is a web and native feature.
pub const FLOAT32_FILTERABLE: Features
Available on crate feature wgpu-27 only.
pub const FLOAT32_FILTERABLE: Features
wgpu-27 only.Allows textures with formats “r32float”, “rg32float”, and “rgba32float” to be filterable.
Supported Platforms:
- Vulkan (mainly on Desktop GPUs)
- DX12
- Metal on macOS or Apple9+ GPUs, optional on iOS/iPadOS with Apple7/8 GPUs
- GL with one of
GL_ARB_color_buffer_float/GL_EXT_color_buffer_float/OES_texture_float_linear
This is a web and native feature.
pub const DUAL_SOURCE_BLENDING: Features
Available on crate feature wgpu-27 only.
pub const DUAL_SOURCE_BLENDING: Features
wgpu-27 only.Allows two outputs from a shader to be used for blending. Note that dual-source blending doesn’t support multiple render targets.
For more info see the OpenGL ES extension GL_EXT_blend_func_extended.
Supported platforms:
- OpenGL ES (with GL_EXT_blend_func_extended)
- Metal (with MSL 1.2+)
- Vulkan (with dualSrcBlend)
- DX12
This is a web and native feature.
pub const CLIP_DISTANCES: Features
Available on crate feature wgpu-27 only.
pub const CLIP_DISTANCES: Features
wgpu-27 only.Allows the use of @builtin(clip_distances) in WGSL.
Supported platforms:
- Vulkan (mainly on Desktop GPUs)
- GL (Desktop or
GL_EXT_clip_cull_distance)
This is a web and native feature.
pub const fn bits(&self) -> FeatureBits
Available on crate feature wgpu-27 only.
pub const fn bits(&self) -> FeatureBits
wgpu-27 only.Gets the set flags as a container holding an array of bits.
pub const fn empty() -> Features
Available on crate feature wgpu-27 only.
pub const fn empty() -> Features
wgpu-27 only.Returns self with no flags set.
pub const fn all() -> Features
Available on crate feature wgpu-27 only.
pub const fn all() -> Features
wgpu-27 only.Returns self with all flags set.
pub const fn contains(self, other: Features) -> bool
Available on crate feature wgpu-27 only.
pub const fn contains(self, other: Features) -> bool
wgpu-27 only.Whether all the bits set in other are all set in self
pub const fn intersects(self, other: Features) -> bool
Available on crate feature wgpu-27 only.
pub const fn intersects(self, other: Features) -> bool
wgpu-27 only.Returns whether any bit set in self matched any bit set in other.
pub const fn is_empty(self) -> bool
Available on crate feature wgpu-27 only.
pub const fn is_empty(self) -> bool
wgpu-27 only.Returns whether there is no flag set.
pub const fn is_all(self) -> bool
Available on crate feature wgpu-27 only.
pub const fn is_all(self) -> bool
wgpu-27 only.Returns whether the struct has all flags set.
pub const fn union(self, other: Features) -> Features
Available on crate feature wgpu-27 only.
pub const fn union(self, other: Features) -> Features
wgpu-27 only.Bitwise or - self | other
pub const fn intersection(self, other: Features) -> Features
Available on crate feature wgpu-27 only.
pub const fn intersection(self, other: Features) -> Features
wgpu-27 only.Bitwise and - self & other
pub const fn difference(self, other: Features) -> Features
Available on crate feature wgpu-27 only.
pub const fn difference(self, other: Features) -> Features
wgpu-27 only.Bitwise and of the complement of other - self & !other
pub const fn symmetric_difference(self, other: Features) -> Features
Available on crate feature wgpu-27 only.
pub const fn symmetric_difference(self, other: Features) -> Features
wgpu-27 only.Bitwise xor - self ^ other
pub const fn complement(self) -> Features
Available on crate feature wgpu-27 only.
pub const fn complement(self) -> Features
wgpu-27 only.Bitwise not - !self
pub fn set(&mut self, other: Features, set: bool)
Available on crate feature wgpu-27 only.
pub fn set(&mut self, other: Features, set: bool)
wgpu-27 only.Calls Self::insert if set is true and otherwise calls Self::remove.
pub fn insert(&mut self, other: Features)
Available on crate feature wgpu-27 only.
pub fn insert(&mut self, other: Features)
wgpu-27 only.Inserts specified flag(s) into self
pub fn remove(&mut self, other: Features)
Available on crate feature wgpu-27 only.
pub fn remove(&mut self, other: Features)
wgpu-27 only.Removes specified flag(s) from self
pub fn toggle(&mut self, other: Features)
Available on crate feature wgpu-27 only.
pub fn toggle(&mut self, other: Features)
wgpu-27 only.Toggles specified flag(s) in self
pub const fn from_bits(bits: FeatureBits) -> Option<Features>
Available on crate feature wgpu-27 only.
pub const fn from_bits(bits: FeatureBits) -> Option<Features>
wgpu-27 only.Takes in FeatureBits and returns None if there are invalid bits or otherwise Self with
those bits set
pub const fn from_bits_truncate(bits: FeatureBits) -> Features
Available on crate feature wgpu-27 only.
pub const fn from_bits_truncate(bits: FeatureBits) -> Features
wgpu-27 only.Takes in FeatureBits and returns Self with only valid bits (all other bits removed)
pub const fn from_bits_retain(bits: FeatureBits) -> Features
Available on crate feature wgpu-27 only.
pub const fn from_bits_retain(bits: FeatureBits) -> Features
wgpu-27 only.Takes in FeatureBits and returns Self with all bits that were set without removing
invalid bits
pub fn from_name(name: &str) -> Option<Features>
Available on crate feature wgpu-27 only.
pub fn from_name(name: &str) -> Option<Features>
wgpu-27 only.Takes in a name and returns Self if it matches or none if the name does not match the name of any of the flags. Name is capitalisation dependent.
pub fn from_internal_flags(
features_wgpu: FeaturesWGPU,
features_webgpu: FeaturesWebGPU,
) -> Features
Available on crate feature wgpu-27 only.
pub fn from_internal_flags( features_wgpu: FeaturesWGPU, features_webgpu: FeaturesWebGPU, ) -> Features
wgpu-27 only.Combines the features from the internal flags into the entire features struct
pub const fn iter(&self) -> Iter<Features>
Available on crate feature wgpu-27 only.
pub const fn iter(&self) -> Iter<Features>
wgpu-27 only.Returns an iterator over the set flags.
pub const fn iter_names(&self) -> IterNames<Features>
Available on crate feature wgpu-27 only.
pub const fn iter_names(&self) -> IterNames<Features>
wgpu-27 only.Returns an iterator over the set flags and their names.
§impl Features
impl Features
pub const fn all_webgpu_mask() -> Features
Available on crate feature wgpu-27 only.
pub const fn all_webgpu_mask() -> Features
wgpu-27 only.Mask of all features which are part of the upstream WebGPU standard.
pub const fn all_native_mask() -> Features
Available on crate feature wgpu-27 only.
pub const fn all_native_mask() -> Features
wgpu-27 only.Mask of all features that are only available when targeting native (not web).
pub const fn all_experimental_mask() -> Features
Available on crate feature wgpu-27 only.
pub const fn all_experimental_mask() -> Features
wgpu-27 only.Mask of all features which are experimental.
pub fn allowed_vertex_formats_for_blas(&self) -> Vec<VertexFormat>
Available on crate feature wgpu-27 only.
pub fn allowed_vertex_formats_for_blas(&self) -> Vec<VertexFormat>
wgpu-27 only.Vertex formats allowed for creating and building BLASes
Trait Implementations§
§impl BitAndAssign for Features
impl BitAndAssign for Features
§fn bitand_assign(&mut self, other: Features)
fn bitand_assign(&mut self, other: Features)
&= operation. Read more§impl BitOrAssign for Features
impl BitOrAssign for Features
§fn bitor_assign(&mut self, other: Features)
fn bitor_assign(&mut self, other: Features)
|= operation. Read more§impl BitXorAssign for Features
impl BitXorAssign for Features
§fn bitxor_assign(&mut self, other: Features)
fn bitxor_assign(&mut self, other: Features)
^= operation. Read more§impl Flags for Features
impl Flags for Features
§type Bits = FeatureBits
type Bits = FeatureBits
§fn bits(&self) -> FeatureBits
fn bits(&self) -> FeatureBits
§fn from_bits_retain(bits: FeatureBits) -> Features
fn from_bits_retain(bits: FeatureBits) -> Features
§fn known_bits(&self) -> Self::Bits
fn known_bits(&self) -> Self::Bits
§fn unknown_bits(&self) -> Self::Bits
fn unknown_bits(&self) -> Self::Bits
§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
§fn iter_defined_names() -> IterDefinedNames<Self>
fn iter_defined_names() -> IterDefinedNames<Self>
Self::FLAGS].§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in self and other.§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in self and other.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert] when value is true or [Flags::remove] when value is false.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in self and other.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in self and other.§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in self, truncating the result.§impl From<FeatureBits> for Features
impl From<FeatureBits> for Features
§fn from(value: FeatureBits) -> Features
fn from(value: FeatureBits) -> Features
§impl From<Features> for FeatureBits
impl From<Features> for FeatureBits
§fn from(value: Features) -> FeatureBits
fn from(value: Features) -> FeatureBits
§impl From<FeaturesWGPU> for Features
impl From<FeaturesWGPU> for Features
§fn from(features_wgpu: FeaturesWGPU) -> Features
fn from(features_wgpu: FeaturesWGPU) -> Features
§impl From<FeaturesWebGPU> for Features
impl From<FeaturesWebGPU> for Features
§fn from(features_webgpu: FeaturesWebGPU) -> Features
fn from(features_webgpu: FeaturesWebGPU) -> Features
impl Copy for Features
impl Eq for Features
impl StructuralPartialEq for Features
Auto Trait Implementations§
impl Freeze for Features
impl RefUnwindSafe for Features
impl Send for Features
impl Sync for Features
impl Unpin for Features
impl UnsafeUnpin for Features
impl UnwindSafe for Features
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.SharedString.