Expand description
Part of rafx-framework. Handles extracting, preparing, and writing draw calls
Modules§
Structs§
- Begin
Submit Node Batch Args - Default
JobContext - A
JobContextis definable by eachRenderFeature. It is used to bundle any expensive work, like acquiring locks or other resources, into fewer call-sites for any work occurring on the same thread. TheJobContextwill not be shared between threads. UseDefaultJobContextif theRenderFeaturedoes not need to acquire resources. - Extract
Job - An
ExtractJobimplements theRenderFeatureExtractJobtrait by wrapping an instance of anExtractJobEntryPointstype defined at compile-time. TheExtractJobcontains the frame packet and presents the correct context (likeExtractPerFrameContext) to each entry point defined inExtractJobEntryPoints. - Extract
PerFrame Context - Extract
PerView Context - Extract
Render Object Instance Context - Extract
Render Object Instance PerView Context - Frame
Packet - Read documentation on
FramePacketData. - Frame
Packet Metadata - Frame
Packet Size - Prepare
Job - A
PrepareJobimplements theRenderFeaturePrepareJobtrait by wrapping an instance of anPrepareJobEntryPointstype defined at compile-time. ThePrepareJobcontains the frame & submit packets and presents the correct context (likePreparePerFrameContext) to each entry point defined inRenderFeaturePrepareJob. - Prepare
PerFrame Context - Prepare
PerView Context - Prepare
Render Object Instance Context - Prepare
Render Object Instance PerView Context - Prepared
Render Data - The sorted
SubmitNodes for eachRenderViewandRenderPhasewith all relevantRenderFeature’sRenderFeatureWriteJobs. - Render
Feature Debug Constants - Render
Feature Flag Mask - Render
Feature Flag Mask Builder - Render
Feature Mask - Render
Feature Mask Builder - Render
Feature Submit Node - A type-erased struct representing some
RenderFeature’sSubmitNode. ThePreparedRenderDatawill iterate through the sorted slice ofRenderFeatureSubmitNodein aViewPhaseSubmitNodeBlockand call the functions on theRenderFeatureWriteJobspecified by theRenderFeatureIndex. - Render
JobBegin Execute Graph Context - Render
JobCommand Buffer Context - Render
JobExtract Allocation Context - Render
JobExtract Context - Holds references to resources valid for the entirety of the
extractstep as represented by the'extractlifetime.RenderFeatureExtractJobs should cache any resources needed from theRenderJobExtractContextduring theirnewfunction. - Render
JobPrepare Context - Holds references to resources valid for the entirety of the
preparestep as represented by the'preparelifetime.RenderFeaturePrepareJobs should cache any resources needed from theRenderJobPrepareContextduring theirnewfunction. - Render
JobWrite Context - Holds references to resources valid for the entirety of the
writestep as represented by the'writelifetime.RenderFeatureWriteJobs should cache any resources needed from theRenderJobWriteContextduring theirnewfunction. - Render
Object Handle - A reference to a
RenderObjectwith a reference-counted pointer. When the last instance of aRenderObjectHandleis dropped, the referencedRenderObjectwill be freed from theRenderObjectSet. This is returned byregister_render_objecton theRenderObjectSetand may be used to query or mutate theRenderObjectwith thegetorget_mutmethods. - Render
Object Id - A weak
RenderObjectHandle. This is a reference to aRenderObjectthat is not used in reference-counting by theRenderObjectSet. Create aRenderObjectIdwith theas_id()method on aRenderObjectHandle. TheRenderObjectcan be queried with theget_idmethod on theRenderObjectSet. - Render
Object Instance - A specific
EntityandRenderObjectrepresented by theObjectIdandRenderObjectId. ARenderObjectis associated with a particularRenderFeatureby theRenderFeatureIndex. TheFramePacketonly contains uniqueRenderObjectInstances. - Render
Object Instance PerView - A specific
RenderObjectInstanceas viewed by someRenderView. - Render
Object Set - Render
Objects JobContext - Use
RenderObjectsJobContextif theRenderFeatureonly needs to lock aRenderObjectsMap. - Render
Phase Mask - Render
Phase Mask Builder - Render
Registry - Render
Registry Builder - Render
Submit Node Args - Render
View - The
RendererprocessesRenderViews during the execution of theRenderGraph. EachRenderViewis associated with a specificViewFrustumin the game world. TheRenderViewmay be registered for specificRenderFeatures by aRenderFeatureMaskorRenderPhases by theRenderPhaseMask. If aRenderViewis not registered for aRenderFeatureorRenderPhasethen it will not be processed by that feature or phase. - Render
View Depth Range - Render
View Set - Render
View Visibility Query - The
RenderObjects visible to a specificRenderViewfor the current frame. EachRenderObjectis represented by aRenderViewObjectwith theObjectIdreturned by theVisibilityObjectand aRenderObjectId. If aVisibilityObjecthas multipleRenderObjects associated with it, the results will be returned as 0 or moreRenderViewObjects. The visibleRenderObjects will only containRenderObjects associated with aRenderFeatureincluded by theRenderView’sRenderFeatureMask. - Submit
Node - Each
SubmitNodecontains the data needed for theRenderFeature’sRenderFeatureWriteJobto render a draw call by referencing data in the frame packet, submit packet, render objects set, or some other storage.SubmitNodes will be sorted by theRenderPhaseafter they are combined into aViewPhaseSubmitNodeBlock. - Submit
Node Block - The
SubmitNodeBlockis a collection ofSubmitNodeassociated with a particularRenderFeature,RenderView, andRenderPhase. There should be a 1:1 mapping betweenSubmitNodes and draw calls from theRenderFeature’sWriteJob. TheRendererwill combine allSubmitNodeBlocks sharing the sameRenderViewandRenderPhaseinto a sortedViewPhaseSubmitNodeBlock. - Submit
Packet - Read documentation on
SubmitPacketData. - View
Packet - Read documentation on
FramePacketData. - View
Packet Size - View
Phase - A combination of a particular
RenderViewandRenderPhase. TheViewPhaseSubmitNodeBlocks in thePreparedRenderDataare indexed by theViewPhase. - View
Phase Submit Node Block - The
ViewPhaseSubmitNodeBlockis a collection ofRenderFeatureSubmitNodeassociated with a particularRenderView, andRenderPhase. In other words, theViewPhaseSubmitNodeBlockis the combination of all the feature-specificRenderFeatureSubmitNodeBlocks with the sameRenderViewandRenderPhase. - View
Submit Packet - Read documentation on
SubmitPacketData. - View
Visibility Job - Determines the visible
RenderObjects in a givenRenderViewand returns the results in theRenderViewVisibilityQuery. It is thread-safe to callquery_visibilityon multipleRenderViews simultaneously.
Constants§
Traits§
- Extract
JobEntry Points ExtractJobEntryPointsprovides a generic set of callbacks for aRenderFeaturecompatible with theExtractJobstruct. This simplifies the work of implementing theRenderFeatureExtractJobtrait.- Frame
Packet Data - The
FramePacketis the data that must be extracted from either theAssetManageror the game’sWorldduring theExtractstep. After theExtractstep has finished, there is no more access allowed to either theAssetManageror the game’sWorld. TheFramePacketmust be considered immutable after theExtractstep has finished. - Prepare
JobEntry Points PrepareJobEntryPointsprovides a generic set of callbacks for aRenderFeaturecompatible with thePrepareJobstruct. This simplifies the work of implementing theRenderFeaturePrepareJobtrait.- Render
Feature - Render
Feature Extract Job - A type-erased trait used by the
Renderer,RenderFrameJob, andRendererThreadPoolto control the workload of the rendering process without identifying specific types used in eachRenderFeature’s frame packet or workload. SeeExtractJoband theExtractJobEntryPointsfor implementation details. - Render
Feature Flag - Render
Feature Frame Packet - A type-erased trait used by the
Renderer,RenderFrameJob, andRendererThreadPoolto control the workload of the rendering process without identifying specific types used in eachRenderFeature’s frame packet or workload. SeeFramePacketandViewPacketfor implementation details. - Render
Feature Frame Packet AsConcrete - Provides
as_concretemethod to downcast as a concrete type. - Render
Feature Frame Packet Into Concrete - Provides
into_concretemethod to downcast into a concrete type. - Render
Feature Prepare Job - A type-erased trait used by the
Renderer,RenderFrameJob, andRendererThreadPoolto control the workload of the rendering process without identifying specific types used in eachRenderFeature’s frame packet or workload. SeePrepareJoband thePrepareJobEntryPointsfor implementation details. - Render
Feature Submit Node Block - A type-erased trait used by the
Renderer,RenderFrameJob, andRendererThreadPoolto control the workload of the rendering process without identifying specific types used in eachRenderFeature’s frame packet or workload. SeeSubmitNodeBlockfor implementation details. - Render
Feature Submit Packet - A type-erased trait used by the
Renderer,RenderFrameJob, andRendererThreadPoolto control the workload of the rendering process without identifying specific types used in eachRenderFeature’s frame packet or workload. SeeSubmitPacketandViewSubmitPacketfor implementation details. - Render
Feature Submit Packet AsConcrete - Provides
as_concretemethod to downcast as a concrete type. - Render
Feature Submit Packet Into Concrete - Provides
into_concretemethod to downcast into a concrete type. - Render
Feature View Packet - A type-erased trait used by the
Renderer,RenderFrameJob, andRendererThreadPoolto control the workload of the rendering process without identifying specific types used in eachRenderFeature’s frame packet or workload. SeeViewPacketfor implementation details. - Render
Feature View Packet AsConcrete - Provides
as_concretemethod to downcast as a concrete type. - Render
Feature View Packet Into Concrete - Provides
into_concretemethod to downcast into a concrete type. - Render
Feature View Submit Packet - A type-erased trait used by the
Renderer,RenderFrameJob, andRendererThreadPoolto control the workload of the rendering process without identifying specific types used in eachRenderFeature’s frame packet or workload. SeeViewSubmitPacketfor implementation details. - Render
Feature View Submit Packet AsConcrete - Provides
as_concretemethod to downcast as a concrete type. - Render
Feature View Submit Packet Into Concrete - Provides
into_concretemethod to downcast into a concrete type. - Render
Feature Write Job - A type-erased trait used by the
Renderer,RenderFrameJob, andRendererThreadPoolto control the workload of the rendering process without identifying specific types used in eachRenderFeature’s frame packet or workload. - Render
Phase - Submit
Packet Data - The
SubmitPacketis the data that must be prepared from in order for theRenderFeature’sWriteJobto create each draw call. The draw calls may reference data in either theFramePacketor theSubmitPacket. Each draw call is represented by exactly 1SubmitNode. In order to allocate theSubmitPacket, theRenderFeatureis given a reference to the populatedFramePacketfrom that frame. TheRenderFeaturemust size theSubmitPacketappropriately. TheSubmitPacketmust be considered immutable after thePreparestep has finished.
Type Aliases§
- Extract
Resources - Render
Feature Flag Index - The
IDof a registeredRenderFeatureFlag. - Render
Feature Index - The
IDof a registeredRenderFeature. - Render
Object Count - Render
Object Instance Id - The
IDof aRenderObjectInstancein a specificFramePacketfor the current frame. - Render
Object Instance Object Ids - Render
Object Instance PerView Id - The
IDof aRenderObjectInstancein a specificViewPacketfor the current frame. - Render
Objects Map - Render
Phase Index - The
IDof a registeredRenderPhase. - Render
View Count - Render
View Index - Render
View Submit Node Count - The total number of submit nodes needed by each
RenderView. TheRenderViewis represented by theRenderViewIndexkey and the count of submit nodes are contained by aVec<usize>where the count at each indexIcorresponds to theRenderPhasewithRenderPhaseIndexequal toI. - Submit
Node Blocks - A collection containing all
SubmitNodes across allRenderFeatures matching aRenderViewandRenderPhasewhere theSubmitNodes are sorted by theRenderPhase’s sort function. TheRenderViewandRenderPhasepair is represented by theViewPhasekey and theSubmitNodes are contained by theViewPhaseSubmitNodeBlock. - Submit
Node Id - The
IDof aSubmitNodein a specificRenderFeaturein the current frame. - Submit
Node Sort Function - The sort function used by a particular
RenderPhase. This is usually one of the following: - Submit
Node Sort Key - A generic key usable by the
SubmitNodeSortFunctionfor the purpose of sorting the collection ofRenderFeatureSubmitNodein a particularViewPhase. This can be used to minimize state changes in the rendering pipeline, e.g. by setting the bits of the key so that higher bits represent more expensive state changes like shaders and lower bits represent cheaper state changes like uniforms. - View
Frame Index - The index of a
RenderViewin thisRenderFeature’sFramePacketfor the current frame. - Visibility
Vecs - Visible
Render Objects