[−][src]Macro wgpu_bind_dsl::binding_layout
this macro builds a wgpu::BindingLayoutDescriptor
with a format not unlike json.
Syntax
( visibility expression | field ) => { ( bind_location => type )* }
visibility expressions: Fragment, Vertex, Compute, None.
these can be enclosed in brackets and seperated with the binary or operator to use multiple visibility flags. this corresponds to the
visibility field in the wgpu::BindGroupLayoutEntry
struct.
fields: Label
instead of taking a binding label takes a &'static str literal. this field is
totally optional and corresponds with the label
field in the wgpu::BindGroupLayoutEntry
struct
textures are described using their equivalent opengl samplers, in the form Tex{Dimension}{MS}?
i.e. Tex2DArrayMS
being an sampled texture with dimension D2Array
with multisampling turned
on.
type:
Buffer: (Dyn)?,
StorageBuffer: (Dyn)? + (Readonly)? ,
Sampler: (Cmp)?,
glsl_sampler_decl
Usage:
let desc = binding_layout! { Label => "OptionalName", Vertex => { 1 => Buffer, 2 => StorageBuffer: Dyn, }, Fragment => { 2 => Sampler, 3 => Sampler: Cmp, }, Compute => { 1 => Buffer: Dyn, 2 => StorageBuffer: Dyn + Readonly, }, { Compute | Fragment } => { 5 => Tex2D<Sint>: Storage<R8Unorm> + Readonly, }, };