pub trait PrepareJobEntryPoints<'prepare>: Sync + Send + Sized {
type RenderObjectInstanceJobContextT;
type RenderObjectInstancePerViewJobContextT;
type FramePacketDataT: 'static + Sync + Send + FramePacketData;
type SubmitPacketDataT: 'static + Sync + Send + SubmitPacketData;
// Required methods
fn feature_debug_constants(&self) -> &'static RenderFeatureDebugConstants;
fn feature_index(&self) -> RenderFeatureIndex;
// Provided methods
fn begin_per_frame_prepare(
&self,
_context: &PreparePerFrameContext<'prepare, '_, Self>
) { ... }
fn prepare_render_object_instance(
&self,
_job_context: &mut Self::RenderObjectInstanceJobContextT,
_context: &PrepareRenderObjectInstanceContext<'prepare, '_, Self>
) { ... }
fn prepare_render_object_instance_per_view(
&self,
_job_context: &mut Self::RenderObjectInstancePerViewJobContextT,
_context: &PrepareRenderObjectInstancePerViewContext<'prepare, '_, Self>
) { ... }
fn end_per_view_prepare(
&self,
_context: &PreparePerViewContext<'prepare, '_, Self>
) { ... }
fn end_per_frame_prepare(
&self,
_context: &PreparePerFrameContext<'prepare, '_, Self>
) { ... }
fn new_render_object_instance_job_context(
&'prepare self
) -> Option<Self::RenderObjectInstanceJobContextT> { ... }
fn new_render_object_instance_per_view_job_context(
&'prepare self
) -> Option<Self::RenderObjectInstancePerViewJobContextT> { ... }
}
Expand description
PrepareJobEntryPoints
provides a generic set of callbacks for a RenderFeature
compatible with the PrepareJob
struct. This simplifies the work of implementing
the RenderFeaturePrepareJob
trait.
Required Associated Types§
sourcetype RenderObjectInstanceJobContextT
type RenderObjectInstanceJobContextT
JobContext
for the prepare_render_object_instance
entry point.
sourcetype RenderObjectInstancePerViewJobContextT
type RenderObjectInstancePerViewJobContextT
JobContext
for the prepare_render_object_instance_per_view
entry point.
type FramePacketDataT: 'static + Sync + Send + FramePacketData
type SubmitPacketDataT: 'static + Sync + Send + SubmitPacketData
Required Methods§
fn feature_debug_constants(&self) -> &'static RenderFeatureDebugConstants
fn feature_index(&self) -> RenderFeatureIndex
Provided Methods§
sourcefn begin_per_frame_prepare(
&self,
_context: &PreparePerFrameContext<'prepare, '_, Self>
)
fn begin_per_frame_prepare( &self, _context: &PreparePerFrameContext<'prepare, '_, Self> )
Called once at the start of the prepare
step when any RenderView
in the frame is
relevant to this RenderFeature
.
sourcefn prepare_render_object_instance(
&self,
_job_context: &mut Self::RenderObjectInstanceJobContextT,
_context: &PrepareRenderObjectInstanceContext<'prepare, '_, Self>
)
fn prepare_render_object_instance( &self, _job_context: &mut Self::RenderObjectInstanceJobContextT, _context: &PrepareRenderObjectInstanceContext<'prepare, '_, Self> )
Called once for each instance of an Entity
and RenderObject
in the frame matching this
RenderFeature
.
sourcefn prepare_render_object_instance_per_view(
&self,
_job_context: &mut Self::RenderObjectInstancePerViewJobContextT,
_context: &PrepareRenderObjectInstancePerViewContext<'prepare, '_, Self>
)
fn prepare_render_object_instance_per_view( &self, _job_context: &mut Self::RenderObjectInstancePerViewJobContextT, _context: &PrepareRenderObjectInstancePerViewContext<'prepare, '_, Self> )
Called once for each instance of an Entity
and RenderObject
in each RenderView
relevant
to this RenderFeature
.
sourcefn end_per_view_prepare(
&self,
_context: &PreparePerViewContext<'prepare, '_, Self>
)
fn end_per_view_prepare( &self, _context: &PreparePerViewContext<'prepare, '_, Self> )
Called once for each relevant RenderView
. This function is only run after all instances of
prepare_render_object_instance_per_view
have finished for that RenderView
.
sourcefn end_per_frame_prepare(
&self,
_context: &PreparePerFrameContext<'prepare, '_, Self>
)
fn end_per_frame_prepare( &self, _context: &PreparePerFrameContext<'prepare, '_, Self> )
Called once at the end of the prepare
step when any RenderView
in the frame is
relevant to this RenderFeature
.