pub trait MewPipeline {
type BindGroupSet;
type BindGroupArray<T>;
type VertexArray<T>;
type FragmentArray<T>;
// Required methods
fn new(pipeline: RenderPipeline) -> Self;
fn bind_group_layout_types_array( ) -> Self::BindGroupArray<(TypeId, BindGroupLayoutDescriptor<'static>)>;
fn map_bind_group_array<A, B, F: FnMut(A) -> B>(
array: Self::BindGroupArray<A>,
f: F,
) -> Self::BindGroupArray<B>;
fn bind_group_ref_array(
layout_array: &Self::BindGroupArray<BindGroupLayout>,
) -> Self::BindGroupArray<&BindGroupLayout>;
fn layout_desc<'a, 'b>(
bind_group_layouts: &'a Self::BindGroupArray<&'b BindGroupLayout>,
) -> PipelineLayoutDescriptor<'a>;
fn fragment_targets<'a>(
surface_fmt: Option<TextureFormat>,
) -> Self::FragmentArray<Option<ColorTargetState>>;
fn pipeline_desc<'a>(
layout: &'a MewPipelineLayout<Self>,
shader: &'a ShaderModule,
vertex_entry: Option<&'a str>,
fragment_entry: Option<&'a str>,
fragment_targets: &'a Self::FragmentArray<Option<ColorTargetState>>,
) -> RenderPipelineDescriptor<'a>;
}Expand description
Trait for pipeline wrapper types, to get layouts and descriptors about the inner pipeline.
The number of internal bind groups must be defined in the generic parameter,
because associated consts are “uNsTAbLe”, apparently.
Ideally, avoid using this directly - it’s horribly designed, so just look
away and use the pipeline macro.
Required Associated Types§
Sourcetype BindGroupSet
type BindGroupSet
A tuple of the pipeline’s internal bind groups (max of 4).
Sourcetype BindGroupArray<T>
type BindGroupArray<T>
A generic array the length of the number of bind groups
(literally [T; N]).
Sourcetype VertexArray<T>
type VertexArray<T>
A generic array the length of the number of vertex types
(literally [T; N]).
Sourcetype FragmentArray<T>
type FragmentArray<T>
A generic array the length of the number of fragment targets
(literally [T; N]).
Required Methods§
Sourcefn bind_group_layout_types_array() -> Self::BindGroupArray<(TypeId, BindGroupLayoutDescriptor<'static>)>
fn bind_group_layout_types_array() -> Self::BindGroupArray<(TypeId, BindGroupLayoutDescriptor<'static>)>
Get an array of internal bind group layouts.
fn map_bind_group_array<A, B, F: FnMut(A) -> B>( array: Self::BindGroupArray<A>, f: F, ) -> Self::BindGroupArray<B>
fn bind_group_ref_array( layout_array: &Self::BindGroupArray<BindGroupLayout>, ) -> Self::BindGroupArray<&BindGroupLayout>
Sourcefn layout_desc<'a, 'b>(
bind_group_layouts: &'a Self::BindGroupArray<&'b BindGroupLayout>,
) -> PipelineLayoutDescriptor<'a>
fn layout_desc<'a, 'b>( bind_group_layouts: &'a Self::BindGroupArray<&'b BindGroupLayout>, ) -> PipelineLayoutDescriptor<'a>
Get the layout descriptor for the pipeline. Requires the output from
Self::bind_group_layout_types_array because const fns in traits are
“uNsTAbLe”, apparently, and lifetimes exist.
fn fragment_targets<'a>( surface_fmt: Option<TextureFormat>, ) -> Self::FragmentArray<Option<ColorTargetState>>
fn pipeline_desc<'a>( layout: &'a MewPipelineLayout<Self>, shader: &'a ShaderModule, vertex_entry: Option<&'a str>, fragment_entry: Option<&'a str>, fragment_targets: &'a Self::FragmentArray<Option<ColorTargetState>>, ) -> RenderPipelineDescriptor<'a>
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.