Limits

Type Alias Limits 

Source
pub type Limits = Limits;

Aliased Type§

#[repr(C)]
pub struct Limits {
Show 44 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_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_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_binding_array_elements_per_shader_stage: u32, pub max_binding_array_sampler_elements_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_buffer_size: u64, pub max_vertex_attributes: u32, pub max_vertex_buffer_array_stride: u32, pub min_uniform_buffer_offset_alignment: u32, pub min_storage_buffer_offset_alignment: u32, pub max_inter_stage_shader_components: u32, pub max_color_attachments: u32, pub max_color_attachment_bytes_per_sample: 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, pub min_subgroup_size: u32, pub max_subgroup_size: u32, pub max_push_constant_size: u32, pub max_non_sampler_bindings: u32, pub max_task_workgroup_total_count: u32, pub max_task_workgroups_per_dimension: u32, pub max_mesh_output_layers: u32, pub max_mesh_multiview_count: u32, pub max_blas_primitive_count: u32, pub max_blas_geometry_count: u32, pub max_tlas_instance_count: u32, pub max_acceleration_structures_per_shader_stage: u32,
}

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::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_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_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 8. 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_binding_array_elements_per_shader_stage: u32

Amount of individual resources within binding arrays that can be accessed in a single shader stage. Applies to all types of bindings except samplers.

This “defaults” to 0. However if binding arrays are supported, all devices can support 500,000. Higher is “better”.

§max_binding_array_sampler_elements_per_shader_stage: u32

Amount of individual samplers within binding arrays that can be accessed in a single shader stage.

This “defaults” to 0. However if binding arrays are supported, all devices can support 1,000. 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_vertex_buffers: u32

Maximum length of VertexState::buffers when creating a RenderPipeline. Defaults to 8. 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_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”.

§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). Defaults to 60. Higher is “better”.

§max_color_attachments: u32

The maximum allowed number of color attachments.

§max_color_attachment_bytes_per_sample: u32

The maximum number of bytes necessary to hold one sample (pixel or subpixel) of render pipeline output data, across all color attachments as described by [TextureFormat::target_pixel_byte_cost] and [TextureFormat::target_component_alignment]. Defaults to 32. Higher is “better”.

⚠️ Rgba8Unorm/Rgba8Snorm/Bgra8Unorm/Bgra8Snorm are deceptively 8 bytes per sample. ⚠️

§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 ComputePass::dispatch(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”.

§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
  • OpenGL doesn’t natively support push constants, and are emulated with uniforms, so this number is less useful but likely 256.
§max_non_sampler_bindings: u32

Maximum number of live non-sampler bindings.

This limit only affects the d3d12 backend. Using a large number will allow the device to create many bind groups at the cost of a large up-front allocation at device creation.

§max_task_workgroup_total_count: u32

The maximum total value of xyz for a given draw_mesh_tasks command

§max_task_workgroups_per_dimension: u32

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

§max_mesh_output_layers: u32

The maximum number of layers that can be output from a mesh shader

§max_mesh_multiview_count: u32

The maximum number of views that can be used by a mesh shader

§max_blas_primitive_count: u32

The maximum number of primitive (ex: triangles, aabbs) a BLAS is allowed to have. Requesting more than 0 during device creation only makes sense if [Features::EXPERIMENTAL_RAY_QUERY] is enabled.

§max_blas_geometry_count: u32

The maximum number of geometry descriptors a BLAS is allowed to have. Requesting more than 0 during device creation only makes sense if [Features::EXPERIMENTAL_RAY_QUERY] is enabled.

§max_tlas_instance_count: u32

The maximum number of instances a TLAS is allowed to have. Requesting more than 0 during device creation only makes sense if [Features::EXPERIMENTAL_RAY_QUERY] is enabled.

§max_acceleration_structures_per_shader_stage: u32

The maximum number of acceleration structures allowed to be used in a shader stage. Requesting more than 0 during device creation only makes sense if [Features::EXPERIMENTAL_RAY_QUERY] is enabled.