pub trait MewBindGroup {
type BufferSet;
type BufferArray<T>;
// Required methods
fn new(bind_group: BindGroup, buffers: Self::BufferSet) -> Self;
fn layout_entries() -> &'static Self::BufferArray<BindGroupLayoutEntry>;
fn layout_desc() -> BindGroupLayoutDescriptor<'static>;
fn layout_desc_with<'a>(
entries: &'a Self::BufferArray<BindGroupLayoutEntry>,
) -> BindGroupLayoutDescriptor<'a>;
fn bind_group_entries(
buffers: &Self::BufferSet,
) -> Self::BufferArray<BindGroupEntry<'_>>;
fn bind_group_desc<'a>(
layout: &'a MewBindGroupLayout<Self>,
entries: &'a Self::BufferArray<BindGroupEntry<'_>>,
) -> BindGroupDescriptor<'a>;
}Expand description
Trait for bind group wrapper types, to get layouts and descriptors about the inner bind group.
The number of internal buffers must be defined in the generic parameter,
because associated consts are “uNsTAbLe”, apparently.
Ideally, avoid using this - it’s horribly designed, so just use the
bind_group macro.
Required Associated Types§
Sourcetype BufferArray<T>
type BufferArray<T>
A generic array the length of the number of buffers (literally [T; N]).
Required Methods§
Sourcefn new(bind_group: BindGroup, buffers: Self::BufferSet) -> Self
fn new(bind_group: BindGroup, buffers: Self::BufferSet) -> Self
Construct by pairing the bind group with its buffers.
Sourcefn layout_entries() -> &'static Self::BufferArray<BindGroupLayoutEntry>
fn layout_entries() -> &'static Self::BufferArray<BindGroupLayoutEntry>
Get an array of layout entries for all child buffers.
Sourcefn layout_desc() -> BindGroupLayoutDescriptor<'static>
fn layout_desc() -> BindGroupLayoutDescriptor<'static>
Get a static layout descriptor.
Sourcefn layout_desc_with<'a>(
entries: &'a Self::BufferArray<BindGroupLayoutEntry>,
) -> BindGroupLayoutDescriptor<'a>
fn layout_desc_with<'a>( entries: &'a Self::BufferArray<BindGroupLayoutEntry>, ) -> BindGroupLayoutDescriptor<'a>
Get a layout descriptor using dynamic layout entries (not recommended, I forgor why I put this in).
Sourcefn bind_group_entries(
buffers: &Self::BufferSet,
) -> Self::BufferArray<BindGroupEntry<'_>>
fn bind_group_entries( buffers: &Self::BufferSet, ) -> Self::BufferArray<BindGroupEntry<'_>>
Get an array of bind group entries, for use with Self::bind_group_desc.
Necessary to keep borrow checker happy.
Sourcefn bind_group_desc<'a>(
layout: &'a MewBindGroupLayout<Self>,
entries: &'a Self::BufferArray<BindGroupEntry<'_>>,
) -> BindGroupDescriptor<'a>
fn bind_group_desc<'a>( layout: &'a MewBindGroupLayout<Self>, entries: &'a Self::BufferArray<BindGroupEntry<'_>>, ) -> BindGroupDescriptor<'a>
Get a bind group descriptor using its layout and an array of its entries
from Self::bind_group_entries.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.