Struct bevy::render::options::WgpuLimits
[−]#[repr(C)]pub struct WgpuLimits {Show 27 fields
pub max_texture_dimension_1d: u32,
pub max_texture_dimension_2d: u32,
pub max_texture_dimension_3d: u32,
pub max_texture_array_layers: u32,
pub max_bind_groups: u32,
pub max_dynamic_uniform_buffers_per_pipeline_layout: u32,
pub max_dynamic_storage_buffers_per_pipeline_layout: u32,
pub max_sampled_textures_per_shader_stage: u32,
pub max_samplers_per_shader_stage: u32,
pub max_storage_buffers_per_shader_stage: u32,
pub max_storage_textures_per_shader_stage: u32,
pub max_uniform_buffers_per_shader_stage: u32,
pub max_uniform_buffer_binding_size: u32,
pub max_storage_buffer_binding_size: u32,
pub max_vertex_buffers: u32,
pub max_vertex_attributes: u32,
pub max_vertex_buffer_array_stride: u32,
pub max_push_constant_size: u32,
pub min_uniform_buffer_offset_alignment: u32,
pub min_storage_buffer_offset_alignment: u32,
pub max_inter_stage_shader_components: u32,
pub max_compute_workgroup_storage_size: u32,
pub max_compute_invocations_per_workgroup: u32,
pub max_compute_workgroup_size_x: u32,
pub max_compute_workgroup_size_y: u32,
pub max_compute_workgroup_size_z: u32,
pub max_compute_workgroups_per_dimension: u32,
}
Expand description
Represents the sets of limits an adapter/device supports.
We provide three different defaults.
Limits::downlevel_defaults()
. This is a set of limits that is guarenteed to work on almost all backends, including “downlevel” backends such as OpenGL and D3D11, other than WebGL. For most applications we recommend using these limits, assuming they are high enough for your application, and you do not intent to support WebGL.Limits::downlevel_webgl2_defaults()
This is a set of limits that is lower even than the [downlevel_defaults()
], configured to be low enough to support running in the browser using WebGL2.Limits::default()
. This is the set of limits that is guarenteed to work on all modern backends and is guarenteed to be supported by WebGPU. Applications needing more modern features can use this as a reasonable set of limits if they are targetting only desktop and modern mobile devices.
We recommend starting with the most restrictive limits you can and manually increasing the limits you need boosted. This will let you stay running on all hardware that supports the limits you need.
Limits “better” than the default must be supported by the adapter and requested when requesting a device. If limits “better” than the adapter supports are requested, requesting a device will panic. Once a device is requested, you may only use resources up to the limits requested even if the adapter supports “better” limits.
Requesting limits that are “better” than you need may cause performance to decrease because the implementation needs to support more than is needed. You should ideally only request exactly what you need.
See also: https://gpuweb.github.io/gpuweb/#dictdef-gpulimits
Fields
max_texture_dimension_1d: u32
Maximum allowed value for the size.width
of a texture created with TextureDimension::D1
.
Defaults to 8192. Higher is “better”.
max_texture_dimension_2d: u32
Maximum allowed value for the size.width
and size.height
of a texture created with TextureDimension::D2
.
Defaults to 8192. Higher is “better”.
max_texture_dimension_3d: u32
Maximum allowed value for the size.width
, size.height
, and size.depth_or_array_layers
of a texture created with TextureDimension::D3
.
Defaults to 2048. Higher is “better”.
max_texture_array_layers: u32
Maximum allowed value for the size.depth_or_array_layers
of a texture created with
TextureDimension::D1
or TextureDimension::D2
.
Defaults to 256. Higher is “better”.
max_bind_groups: u32
Amount of bind groups that can be attached to a pipeline at the same time. Defaults to 4. Higher is “better”.
max_dynamic_uniform_buffers_per_pipeline_layout: u32
Amount of uniform buffer bindings that can be dynamic in a single pipeline. Defaults to 8. Higher is “better”.
max_dynamic_storage_buffers_per_pipeline_layout: u32
Amount of storage buffer bindings that can be dynamic in a single pipeline. Defaults to 4. Higher is “better”.
max_sampled_textures_per_shader_stage: u32
Amount of sampled textures visible in a single shader stage. Defaults to 16. Higher is “better”.
max_samplers_per_shader_stage: u32
Amount of samplers visible in a single shader stage. Defaults to 16. Higher is “better”.
max_storage_buffers_per_shader_stage: u32
Amount of storage buffers visible in a single shader stage. Defaults to 4. Higher is “better”.
max_storage_textures_per_shader_stage: u32
Amount of storage textures visible in a single shader stage. Defaults to 4. Higher is “better”.
max_uniform_buffers_per_shader_stage: u32
Amount of uniform buffers visible in a single shader stage. Defaults to 12. Higher is “better”.
max_uniform_buffer_binding_size: u32
Maximum size in bytes of a binding to a uniform buffer. Defaults to 64 KB. Higher is “better”.
max_storage_buffer_binding_size: u32
Maximum size in bytes of a binding to a storage buffer. Defaults to 128 MB. Higher is “better”.
max_vertex_buffers: u32
Maximum length of VertexState::buffers
when creating a RenderPipeline
.
Defaults to 8. Higher is “better”.
max_vertex_attributes: u32
Maximum length of VertexBufferLayout::attributes
, summed over all VertexState::buffers
,
when creating a RenderPipeline
.
Defaults to 16. Higher is “better”.
max_vertex_buffer_array_stride: u32
Maximum value for VertexBufferLayout::array_stride
when creating a RenderPipeline
.
Defaults to 2048. Higher is “better”.
max_push_constant_size: u32
Amount of storage available for push constants in bytes. Defaults to 0. Higher is “better”.
Requesting more than 0 during device creation requires Features::PUSH_CONSTANTS
to be enabled.
Expect the size to be:
- Vulkan: 128-256 bytes
- DX12: 256 bytes
- Metal: 4096 bytes
- DX11 & OpenGL don’t natively support push constants, and are emulated with uniforms, so this number is less useful but likely 256.
min_uniform_buffer_offset_alignment: u32
Required BufferBindingType::Uniform
alignment for BufferBinding::offset
when creating a BindGroup
, or for set_bind_group
dynamicOffsets
.
Defaults to 256. Lower is “better”.
min_storage_buffer_offset_alignment: u32
Required BufferBindingType::Storage
alignment for BufferBinding::offset
when creating a BindGroup
, or for set_bind_group
dynamicOffsets
.
Defaults to 256. Lower is “better”.
max_inter_stage_shader_components: u32
Maximum allowed number of components (scalars) of input or output locations for inter-stage communication (vertex outputs to fragment inputs).
max_compute_workgroup_storage_size: u32
Maximum number of bytes used for workgroup memory in a compute entry point.
max_compute_invocations_per_workgroup: u32
Maximum value of the product of the workgroup_size
dimensions for a compute entry-point.
max_compute_workgroup_size_x: u32
The maximum value of the workgroup_size X dimension for a compute stage ShaderModule
entry-point.
Defaults to 256.
max_compute_workgroup_size_y: u32
The maximum value of the workgroup_size Y dimension for a compute stage ShaderModule
entry-point.
Defaults to 256.
max_compute_workgroup_size_z: u32
The maximum value of the workgroup_size Z dimension for a compute stage ShaderModule
entry-point.
Defaults to 256.
max_compute_workgroups_per_dimension: u32
The maximum value for each dimension of a ComputePass::dispatch(x, y, z)
operation.
Defaults to 65535.
Implementations
impl Limits
impl Limits
pub fn downlevel_defaults() -> Limits
pub fn downlevel_defaults() -> Limits
These default limits are guarenteed to be compatible with GLES-3.1, and D3D11
pub fn downlevel_webgl2_defaults() -> Limits
pub fn downlevel_webgl2_defaults() -> Limits
These default limits are guarenteed to be compatible with GLES-3.0, and D3D11, and WebGL2
pub fn using_resolution(self, other: Limits) -> Limits
pub fn using_resolution(self, other: Limits) -> Limits
Modify the current limits to use the resolution limits of the other.
This is useful because the swapchain might need to be larger than any other image in the application.
If your application only needs 512x512, you might be running on a 4k display and need extremely high resolution limits.
pub fn using_alignment(self, other: Limits) -> Limits
pub fn using_alignment(self, other: Limits) -> Limits
Modify the current limits to use the buffer alignment limits of the adapter.
This is useful for when you’d like to dynamically use the “best” supported buffer alignments.
Trait Implementations
impl Ord for Limits
impl Ord for Limits
impl PartialOrd<Limits> for Limits
impl PartialOrd<Limits> for Limits
pub fn partial_cmp(&self, other: &Limits) -> Option<Ordering>
pub fn partial_cmp(&self, other: &Limits) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Limits
impl StructuralEq for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnwindSafe for Limits
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<F, A>impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<F, A>impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
Convert 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
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> FromWorld for T where
T: Default,
impl<T> FromWorld for T where
T: Default,
pub fn from_world(_world: &mut World) -> T
pub fn from_world(_world: &mut World) -> T
Creates Self
using data from the given World
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> TypeData for T where
T: 'static + Send + Sync + Clone,
impl<T> TypeData for T where
T: 'static + Send + Sync + Clone,
pub fn clone_type_data(&self) -> Box<dyn TypeData + 'static, Global>ⓘNotable traits for Box<F, A>impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more