pub struct BindGroupLayoutEntry {
pub binding: u32,
pub visibility: u32,
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 bitmask controls
which shader stages can read the binding (VERTEX = 0x1,
FRAGMENT = 0x2, COMPUTE = 0x4); VERTEX | FRAGMENT = 0x3 and
VERTEX | FRAGMENT | COMPUTE = 0x7 are the most common values.
Fields§
§binding: u32The binding slot (matches @binding(N) in the shader).
visibility: u32Visibility bitmask (VERTEX = 0x1, FRAGMENT = 0x2, COMPUTE = 0x4).
ty: BindGroupEntryTypeThe resource kind bound at this slot.
Implementations§
Source§impl BindGroupLayoutEntry
impl BindGroupLayoutEntry
Sourcepub fn uniform(binding: u32, visibility: u32) -> Self
pub fn uniform(binding: u32, visibility: u32) -> Self
Convenience constructor for a uniform-buffer binding slot.
Sourcepub fn storage(binding: u32, visibility: u32, read_only: bool) -> Self
pub fn storage(binding: u32, visibility: u32, 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>).
Sourcepub fn texture(binding: u32, visibility: u32, sample_type: &str) -> Self
pub fn texture(binding: u32, visibility: u32, sample_type: &str) -> Self
Convenience constructor for a sampled texture binding slot.
sample_type must be one of "float", "unfilterable-float",
"depth", "sint", "uint".
Sourcepub fn texture_multisampled(
binding: u32,
visibility: u32,
sample_type: &str,
) -> Self
pub fn texture_multisampled( binding: u32, visibility: u32, sample_type: &str, ) -> Self
Convenience constructor for a multisampled sampled texture binding slot.
Sourcepub fn storage_texture(
binding: u32,
visibility: u32,
format: &str,
read_only: bool,
) -> Self
pub fn storage_texture( binding: u32, visibility: u32, format: &str, read_only: bool, ) -> Self
Convenience constructor for a storage-texture binding slot.
format is a GpuTextureFormat string such as "rgba8unorm" or "r32float".
Sourcepub fn sampler(binding: u32, visibility: u32) -> Self
pub fn sampler(binding: u32, visibility: u32) -> Self
Convenience constructor for a filtering sampler binding slot.
Sourcepub fn sampler_non_filtering(binding: u32, visibility: u32) -> Self
pub fn sampler_non_filtering(binding: u32, visibility: u32) -> Self
Convenience constructor for a non-filtering sampler binding slot.
Sourcepub fn sampler_comparison(binding: u32, visibility: u32) -> Self
pub fn sampler_comparison(binding: u32, visibility: u32) -> Self
Convenience constructor for a comparison sampler binding slot.