Limits

Struct Limits 

Source
pub struct Limits {
Show 15 fields pub max_bind_groups: u32, pub max_bindings_per_bind_group: u32, pub max_dynamic_uniform_buffers_per_pipeline_layout: u32, pub max_dynamic_storage_buffers_per_pipeline_layout: u32, pub max_uniform_buffer_binding_size: u32, pub max_storage_buffer_binding_size: u32, pub max_buffer_size: u64, 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, pub min_subgroup_size: u32, pub max_subgroup_size: u32,
}
Expand description

Limits for a device.

This is a trimmed-down version of wgpu::Limits with only compute-related parameters.

This can be used to, for example, dynamically set workgroup or dispatch dimensions for optimization purposes.

Fields§

§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_bindings_per_bind_group: u32

Maximum binding index allowed in create_bind_group_layout. Defaults to 1000. 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_uniform_buffer_binding_size: u32

Maximum size in bytes of a binding to a uniform buffer. Defaults to 64 KiB. Higher is “better”.

§max_storage_buffer_binding_size: u32

Maximum size in bytes of a binding to a storage buffer. Defaults to 128 MiB. Higher is “better”.

§max_buffer_size: u64

A limit above which buffer allocations are guaranteed to fail. Defaults to 256 MiB. Higher is “better”.

Buffer allocations below the maximum buffer size may not succeed depending on available memory, fragmentation, and other factors.

§max_compute_workgroup_storage_size: u32

Maximum number of bytes used for workgroup memory in a compute entry point. Defaults to 16384. Higher is “better”.

§max_compute_invocations_per_workgroup: u32

Maximum value of the product of the workgroup_size dimensions for a compute entry-point. Defaults to 256. Higher is “better”.

§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. Higher is “better”.

§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. Higher is “better”.

§max_compute_workgroup_size_z: u32

The maximum value of the workgroup_size Z dimension for a compute stage ShaderModule entry-point. Defaults to 64. Higher is “better”.

§max_compute_workgroups_per_dimension: u32

The maximum value for each dimension of a Device::execute(..., [x, y, z]) operation. Defaults to 65535. Higher is “better”.

§min_subgroup_size: u32

Minimal number of invocations in a subgroup. Higher is “better”.

§max_subgroup_size: u32

Maximal number of invocations in a subgroup. Lower is “better”.

Trait Implementations§

Source§

impl Debug for Limits

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Limits> for Limits

Source§

fn from(limits: Limits) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Limits

§

impl RefUnwindSafe for Limits

§

impl Send for Limits

§

impl Sync for Limits

§

impl Unpin for Limits

§

impl UnwindSafe for Limits

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,