pub struct BindGroupLayoutEntry {
pub binding: u32,
pub visibility: ShaderStage,
pub ty: BindGroupEntryType,
}Expand description
A single entry inside a GpuBindGroupLayoutDescriptor.
Together these describe one slot of the bind group layout used by
a render / compute pipeline. The visibility field names the
shader stages that can read the binding as ShaderStage values
combined with |; a hand-written 0x1 / 0x2 / 0x4 there
silently produced a binding the shader could not see.
Fields§
§binding: u32The binding slot (matches @binding(N) in the shader).
visibility: ShaderStageThe shader stages that can read this binding. Combine several
with |, e.g. ShaderStage::Vertex | ShaderStage::Fragment.
ty: BindGroupEntryTypeThe resource kind bound at this slot.
Implementations§
Source§impl BindGroupLayoutEntry
impl BindGroupLayoutEntry
Sourcepub fn uniform(binding: u32, visibility: ShaderStage) -> Self
pub fn uniform(binding: u32, visibility: ShaderStage) -> Self
Convenience constructor for a uniform-buffer binding slot.
§Arguments
u32- The binding index within the bind group.ShaderStage- The shader stages that can access the slot.
Sourcepub fn storage(binding: u32, visibility: ShaderStage, read_only: bool) -> Self
pub fn storage(binding: u32, visibility: ShaderStage, read_only: bool) -> Self
Convenience constructor for a storage-buffer binding slot.
read_only = true selects read-only-storage (matches var<storage, read>);
read_only = false selects storage (matches var<storage, read_write>).
§Arguments
u32- The binding index within the bind group.ShaderStage- The shader stages that can access the slot.bool- Whether shaders may only read from the buffer.
Sourcepub fn texture(binding: u32, visibility: ShaderStage, sample_type: &str) -> Self
pub fn texture(binding: u32, visibility: ShaderStage, sample_type: &str) -> Self
Convenience constructor for a sampled texture binding slot.
sample_type must be one of "float", "unfilterable-float",
"depth", "sint", "uint".
§Arguments
u32- The binding index within the bind group.ShaderStage- The shader stages that can access the slot.&str- The texel sample type name used by the shader.
Sourcepub fn texture_multisampled(
binding: u32,
visibility: ShaderStage,
sample_type: &str,
) -> Self
pub fn texture_multisampled( binding: u32, visibility: ShaderStage, sample_type: &str, ) -> Self
Convenience constructor for a multisampled sampled texture binding slot.
§Arguments
u32- The binding index within the bind group.ShaderStage- The shader stages that can access the slot.&str- The texel sample type name used by the shader.
Sourcepub fn storage_texture(
binding: u32,
visibility: ShaderStage,
format: &str,
read_only: bool,
) -> Self
pub fn storage_texture( binding: u32, visibility: ShaderStage, format: &str, read_only: bool, ) -> Self
Convenience constructor for a storage-texture binding slot.
format is a GpuTextureFormat string such as "rgba8unorm" or "r32float".
§Arguments
u32- The binding index within the bind group.ShaderStage- The shader stages that can access the slot.&str- The storage texture format name.bool- Whether shaders may only read from the texture.
Sourcepub fn sampler(binding: u32, visibility: ShaderStage) -> Self
pub fn sampler(binding: u32, visibility: ShaderStage) -> Self
Convenience constructor for a filtering sampler binding slot.
§Arguments
u32- The binding index within the bind group.ShaderStage- The shader stages that can access the slot.
Sourcepub fn sampler_non_filtering(binding: u32, visibility: ShaderStage) -> Self
pub fn sampler_non_filtering(binding: u32, visibility: ShaderStage) -> Self
Convenience constructor for a non-filtering sampler binding slot.
§Arguments
u32- The binding index within the bind group.ShaderStage- The shader stages that can access the slot.
Sourcepub fn sampler_comparison(binding: u32, visibility: ShaderStage) -> Self
pub fn sampler_comparison(binding: u32, visibility: ShaderStage) -> Self
Convenience constructor for a comparison sampler binding slot.
§Arguments
u32- The binding index within the bind group.ShaderStage- The shader stages that can access the slot.