#[non_exhaustive]pub enum BindingType {
UniformBuffer {
dynamic: bool,
min_binding_size: Option<NonZero<u64>>,
},
StorageBuffer {
dynamic: bool,
min_binding_size: Option<NonZero<u64>>,
readonly: bool,
},
Sampler {
comparison: bool,
},
SampledTexture {
dimension: TextureViewDimension,
component_type: TextureComponentType,
multisampled: bool,
},
StorageTexture {
dimension: TextureViewDimension,
format: TextureFormat,
readonly: bool,
},
}
Expand description
Specific type of a binding.
WebGPU spec: https://gpuweb.github.io/gpuweb/#dictdef-gpubindgrouplayoutentry
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UniformBuffer
A buffer for uniform values.
Example GLSL syntax:
layout(std140, binding = 0)
uniform Globals {
vec2 aUniform;
vec2 anotherUniform;
};
Fields
dynamic: bool
Indicates that the binding has a dynamic offset.
One offset must be passed to [RenderPass::set_bind_group
] for each dynamic binding in increasing order of binding number.
min_binding_size: Option<NonZero<u64>>
Minimum size of the corresponding BufferBinding
required to match this entry.
When pipeline is created, the size has to cover at least the corresponding structure in the shader
plus one element of the unbound array, which can only be last in the structure.
If None
, the check is performed at draw call time instead of pipeline and bind group creation.
StorageBuffer
A storage buffer.
Example GLSL syntax:
layout (set=0, binding=0) buffer myStorageBuffer {
vec4 myElement[];
};
Fields
dynamic: bool
Indicates that the binding has a dynamic offset.
One offset must be passed to [RenderPass::set_bind_group
] for each dynamic binding in increasing order of binding number.
min_binding_size: Option<NonZero<u64>>
Minimum size of the corresponding BufferBinding
required to match this entry.
When pipeline is created, the size has to cover at least the corresponding structure in the shader
plus one element of the unbound array, which can only be last in the structure.
If None
, the check is performed at draw call time instead of pipeline and bind group creation.
Sampler
A sampler that can be used to sample a texture.
Example GLSL syntax:
layout(binding = 0)
uniform sampler s;
Fields
SampledTexture
A texture.
Example GLSL syntax:
layout(binding = 0)
uniform texture2D t;
Fields
dimension: TextureViewDimension
Dimension of the texture view that is going to be sampled.
component_type: TextureComponentType
Component type of the texture. This must be compatible with the format of the texture.
StorageTexture
A storage texture.
Example GLSL syntax:
layout(set=0, binding=0, r32f) uniform image2D myStorageImage;
Note that the texture format must be specified in the shader as well. A list of valid formats can be found in the specification here: https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.html#layout-qualifiers
Fields
dimension: TextureViewDimension
Dimension of the texture view that is going to be sampled.
format: TextureFormat
Format of the texture.
Trait Implementations§
Source§impl Clone for BindingType
impl Clone for BindingType
Source§fn clone(&self) -> BindingType
fn clone(&self) -> BindingType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more