[−][src]Struct web_glitz::pipeline::resources::ResourceBindingsLayoutBuilder
Builds a ResourceBindingsLayoutDescriptor.
Example
use web_glitz::pipeline::resources::{ResourceSlotDescriptor, ResourceBindingsLayoutBuilder, LayoutAllocationHint, ResourceSlotIdentifier, ResourceSlotKind}; let mut builder = ResourceBindingsLayoutBuilder::new(Some(LayoutAllocationHint { bind_groups: 2, total_resource_slots: 3, })); let resource_bindings_layout = builder .add_bind_group(0)? .add_resource_slot(ResourceSlotDescriptor { slot_index: 0, slot_identifier: ResourceSlotIdentifier::Static("buffer_0"), slot_kind: ResourceSlotKind::UniformBuffer })? .finish() .add_bind_group(1)? .add_resource_slot(ResourceSlotDescriptor { slot_index: 0, slot_identifier: ResourceSlotIdentifier::Static("texture_0"), slot_kind: ResourceSlotKind::SampledTexture })? .add_resource_slot(ResourceSlotDescriptor { slot_index: 1, slot_identifier: ResourceSlotIdentifier::Static("texture_1"), slot_kind: ResourceSlotKind::SampledTexture })? .finish() .finish();
Note that all bind groups must be added in increasing order of bind group index and no 2 bind groups may declare the same bind group index (but bind group indices do not have to be contiguous); all resource slots must be added to their respective bind groups in increaseing order of slot index and no 2 resource slots within the same bind group may declare the same slot index (but slot indices do not have to be contiguous).
Implementations
impl ResourceBindingsLayoutBuilder[src]
pub fn new(allocation_hint: Option<LayoutAllocationHint>) -> Self[src]
Creates a new [ResourceBindingsLayoutDescriptorBuilder].
An optional LayoutAllocationHint to indicate to the builder how much memory should be allocated to accommodate the result. Note that providing an inaccurate hint will not result in any errors, but may result in more than 1 allocation or the allocation of extraneous memory.
pub fn add_bind_group(
self,
bind_group_index: u32
) -> Result<BindGroupLayoutBuilder, InvalidBindGroupSequence>[src]
self,
bind_group_index: u32
) -> Result<BindGroupLayoutBuilder, InvalidBindGroupSequence>
Adds a bind group to the layout with the given bind_group_index.
Returns a builder that may be used to add resource slots to the bind group's layout, or
returns an [InvalidBindGroupIndex] error if the bind_group_index is not greater than the
previous bind group index (if any): bind groups must be added to the layout in ascending
order of bind group index and no two bind groups may declare the same bind group index.
pub fn finish(self) -> ResourceBindingsLayoutDescriptor[src]
Finishes this builder and returns the resulting ResourceBindingsLayoutDescriptor.
Auto Trait Implementations
impl RefUnwindSafe for ResourceBindingsLayoutBuilder
impl Send for ResourceBindingsLayoutBuilder
impl Sync for ResourceBindingsLayoutBuilder
impl Unpin for ResourceBindingsLayoutBuilder
impl UnwindSafe for ResourceBindingsLayoutBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<D, T> IntoBuffer<T> for D where
D: Borrow<T> + 'static,
T: Copy + 'static, [src]
D: Borrow<T> + 'static,
T: Copy + 'static,
fn into_buffer<Rc>(Self, &Rc, BufferId, UsageHint) -> Buffer<T> where
Rc: RenderingContext + Clone + 'static, [src]
Rc: RenderingContext + Clone + 'static,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,