pub trait Vertex:
Send
+ Sync
+ NoUninit {
type PipelineParam: SystemParam;
type PipelineProp: Send + Sync;
type PipelineKey: Send + Sync + Clone + Eq + PartialEq + Hash;
type Command: VertexCommand<Vertex = Self>;
type BatchParam: SystemParam;
type BatchProp: Send + Sync;
type Item: CachedRenderPipelinePhaseItem + SortedPhaseItem;
type RenderCommand: RenderCommand<Self::Item> + Send + Sync;
const SHADER: &'static str;
const LAYOUT: &'static [VertexAttribute];
const DEPTH_FORMAT: Option<TextureFormat> = _;
// Required methods
fn init_pipeline(
param: SystemParamItem<'_, '_, Self::PipelineParam>,
) -> Self::PipelineProp;
fn specialize_pipeline(
key: Self::PipelineKey,
prop: &Self::PipelineProp,
desc: &mut RenderPipelineDescriptor,
);
fn create_item(
layer: f32,
entity: (Entity, MainEntity),
pipeline: CachedRenderPipelineId,
draw_function: DrawFunctionId,
command: usize,
) -> Self::Item;
fn create_batch(
param: &mut SystemParamItem<'_, '_, Self::BatchParam>,
key: Self::PipelineKey,
) -> Self::BatchProp;
// Provided method
fn setup(app: &mut App) { ... }
}Expand description
The heart of Hephae. Instances of Vertex directly represent the elements of the vertex buffer
in the GPU.
Required Associated Constants§
Sourceconst SHADER: &'static str
const SHADER: &'static str
Path to the shader rendering vertex attributes of this type. Entry points should be
vertex(...) and fragment(...).
Sourceconst LAYOUT: &'static [VertexAttribute]
const LAYOUT: &'static [VertexAttribute]
Vertex attribute layout of this type. Ideally should match the fields implementors
declare.
Provided Associated Constants§
Sourceconst DEPTH_FORMAT: Option<TextureFormat> = _
const DEPTH_FORMAT: Option<TextureFormat> = _
Format of the depth-stencil pass supplied to the rendering pipeline creation parameters.
Defaults to [Some(TextureFormat::Depth32Float)], which is the default for 2D core pipeline
depth-stencil format. None means the pipeline will not have a depth-stencil state.
Required Associated Types§
Sourcetype PipelineParam: SystemParam
type PipelineParam: SystemParam
System parameter to fetch when initializing
HephaePipeline to create a
PipelineProp.
Sourcetype PipelineProp: Send + Sync
type PipelineProp: Send + Sync
The additional property of the common pipeline definition
that may used when specializing based on PipelineKey. For example,
this may be used to create a
BindGroupLayout for texture-sampling.
Sourcetype PipelineKey: Send + Sync + Clone + Eq + PartialEq + Hash
type PipelineKey: Send + Sync + Clone + Eq + PartialEq + Hash
Key used to specialize the render pipeline. For example, this may be an
AssetId<Image> used to reference a
GpuImage for texture-sampling.
Sourcetype Command: VertexCommand<Vertex = Self>
type Command: VertexCommand<Vertex = Self>
The vertex command that [Drawer<Vertex = Self>] may output. These commands will be sorted
according to their Z-layers and then extracted out into the batches.
Sourcetype BatchParam: SystemParam
type BatchParam: SystemParam
System parameter to fetch when creating the batch.
Sourcetype BatchProp: Send + Sync
type BatchProp: Send + Sync
Additional property that is embedded into
HephaeBatch components for use in
RenderCommand. For example, this may be an
AssetId<Image> from
PipelineKey to attach the associated bind
group for texture-sampling.
Sourcetype Item: CachedRenderPipelinePhaseItem + SortedPhaseItem
type Item: CachedRenderPipelinePhaseItem + SortedPhaseItem
The PhaseItem that this vertex works with.
Sourcetype RenderCommand: RenderCommand<Self::Item> + Send + Sync
type RenderCommand: RenderCommand<Self::Item> + Send + Sync
Additional GPU render commands to invoke before actually drawing the vertex and index
buffers. For example, this may be used to set the texture-sampling bind group provided by
BatchProp.
Required Methods§
Sourcefn init_pipeline(
param: SystemParamItem<'_, '_, Self::PipelineParam>,
) -> Self::PipelineProp
fn init_pipeline( param: SystemParamItem<'_, '_, Self::PipelineParam>, ) -> Self::PipelineProp
Creates the additional render pipeline property for use in specialization.
Sourcefn specialize_pipeline(
key: Self::PipelineKey,
prop: &Self::PipelineProp,
desc: &mut RenderPipelineDescriptor,
)
fn specialize_pipeline( key: Self::PipelineKey, prop: &Self::PipelineProp, desc: &mut RenderPipelineDescriptor, )
Sourcefn create_item(
layer: f32,
entity: (Entity, MainEntity),
pipeline: CachedRenderPipelineId,
draw_function: DrawFunctionId,
command: usize,
) -> Self::Item
fn create_item( layer: f32, entity: (Entity, MainEntity), pipeline: CachedRenderPipelineId, draw_function: DrawFunctionId, command: usize, ) -> Self::Item
Creates the phase item associated with a VertexCommand based on its layer, render and
main entity, rendering pipeline ID, draw function ID, and command index.
Sourcefn create_batch(
param: &mut SystemParamItem<'_, '_, Self::BatchParam>,
key: Self::PipelineKey,
) -> Self::BatchProp
fn create_batch( param: &mut SystemParamItem<'_, '_, Self::BatchParam>, key: Self::PipelineKey, ) -> Self::BatchProp
Creates additional batch property for use in rendering.
Provided Methods§
Sourcefn setup(app: &mut App)
fn setup(app: &mut App)
Further customizes the application. Called in Plugin::finish. For example, this may be
used to add systems extracting texture atlas pages and validating bind groups associated
with them.
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.