Struct wgpu::Limits[][src]

#[repr(C)]
pub struct Limits {
Show 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,
}

Represents the sets of limits an adapter/device supports.

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 2048. 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 16384. 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.

Trait Implementations

impl Clone for Limits[src]

pub fn clone(&self) -> Limits[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Limits[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl Default for Limits[src]

pub fn default() -> Limits[src]

Returns the “default value” for a type. Read more

impl<'de> Deserialize<'de> for Limits[src]

pub fn deserialize<__D>(
    __deserializer: __D
) -> Result<Limits, <__D as Deserializer<'de>>::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Hash for Limits[src]

pub fn hash<__H>(&self, state: &mut __H) where
    __H: Hasher
[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl Ord for Limits[src]

pub fn cmp(&self, other: &Limits) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl PartialEq<Limits> for Limits[src]

pub fn eq(&self, other: &Limits) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

pub fn ne(&self, other: &Limits) -> bool[src]

This method tests for !=.

impl PartialOrd<Limits> for Limits[src]

pub fn partial_cmp(&self, other: &Limits) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Serialize for Limits[src]

pub fn serialize<__S>(
    &self,
    __serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl Eq for Limits[src]

impl StructuralEq for Limits[src]

impl StructuralPartialEq for Limits[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> CallHasher for T where
    T: Hash

pub fn get_hash<H>(&self, hasher: H) -> u64 where
    H: Hasher

impl<T> Downcast<T> for T

pub fn downcast(&self) -> &T

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

pub fn equivalent(&self, key: &K) -> bool[src]

Compare self to key and return true if they are equal.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> Upcast<T> for T

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]