pub struct RenderAgent { /* private fields */ }Expand description
The agent responsible for managing the state and logic of the rendering pipeline.
Implementations§
Source§impl RenderAgent
impl RenderAgent
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new RenderAgent with default lanes and automatic strategy selection.
Sourcepub fn render(
&mut self,
encoder: &mut dyn CommandEncoder,
render_ctx: &RenderContext<'_>,
)
pub fn render( &mut self, encoder: &mut dyn CommandEncoder, render_ctx: &RenderContext<'_>, )
Renders the scene using the provided encoder and render context.
This is the main rendering method that encodes GPU commands via the selected lane. Shadow lanes are executed first, followed by the selected render lane.
Sourcepub fn with_strategy(strategy: RenderingStrategy) -> Self
pub fn with_strategy(strategy: RenderingStrategy) -> Self
Creates a new RenderAgent with the specified rendering strategy.
Sourcepub fn with_telemetry_sender(self, sender: Sender<TelemetryEvent>) -> Self
pub fn with_telemetry_sender(self, sender: Sender<TelemetryEvent>) -> Self
Attaches a telemetry sender so the agent can emit GpuReport events to the DCC.
Sourcepub fn set_strategy(&mut self, strategy: RenderingStrategy)
pub fn set_strategy(&mut self, strategy: RenderingStrategy)
Sets the rendering strategy.
Sourcepub fn strategy(&self) -> RenderingStrategy
pub fn strategy(&self) -> RenderingStrategy
Returns the current rendering strategy.
Sourcepub fn select_lane(&self) -> &dyn Lane
pub fn select_lane(&self) -> &dyn Lane
Selects the appropriate render lane based on the current strategy.
Sourcepub fn prepare_frame(
&mut self,
world: &mut World,
graphics_device: &dyn GraphicsDevice,
)
pub fn prepare_frame( &mut self, world: &mut World, graphics_device: &dyn GraphicsDevice, )
Prepares all rendering data for the current frame.
This method runs the entire Control Plane logic for rendering:
- Prepares GPU resources for any newly loaded meshes.
- Extracts all visible objects from the ECS into the internal
RenderWorld.
Sourcepub fn produce_render_objects(&self) -> Vec<RenderObject>
pub fn produce_render_objects(&self) -> Vec<RenderObject>
Translates the prepared data from the RenderWorld into a list of RenderObjects.
This method should be called after prepare_frame. It reads the intermediate
RenderWorld and produces the final, low-level data structure required by
the RenderSystem.
Uses the selected lane’s domain-specific pipeline selection if available, otherwise falls back to a default pipeline.
Sourcepub fn extract_camera_view(&self, world: &World) -> ViewInfo
pub fn extract_camera_view(&self, world: &World) -> ViewInfo
Extracts the active camera from the ECS world and generates a ViewInfo.
This method queries the ECS for entities with both a Camera and GlobalTransform
component, finds the first active camera, and constructs a ViewInfo containing
the camera’s view and projection matrices.
§Arguments
world: The ECS world containing camera entities
§Returns
A ViewInfo containing the camera’s matrices and position. If no active camera
is found, returns a default ViewInfo with identity matrices.
Sourcepub fn last_frame_time(&self) -> Duration
pub fn last_frame_time(&self) -> Duration
Returns the duration of the last frame’s render pass.
Sourcepub fn frame_count(&self) -> u64
pub fn frame_count(&self) -> u64
Returns the total number of frames rendered.
Sourcepub fn current_strategy_id(&self) -> StrategyId
pub fn current_strategy_id(&self) -> StrategyId
Returns the current GORNA strategy ID.
Sourcepub fn render_world(&self) -> &RenderWorld
pub fn render_world(&self) -> &RenderWorld
Returns a reference to the internal RenderWorld.
Sourcepub fn render_world_mut(&mut self) -> &mut RenderWorld
pub fn render_world_mut(&mut self) -> &mut RenderWorld
Returns a mutable reference to the internal RenderWorld.
Sourcepub fn gpu_meshes(&self) -> &Arc<RwLock<Assets<GpuMesh>>>
pub fn gpu_meshes(&self) -> &Arc<RwLock<Assets<GpuMesh>>>
Returns a reference to the GPU meshes cache.
Trait Implementations§
Source§impl Agent for RenderAgent
impl Agent for RenderAgent
Source§fn negotiate(&mut self, request: NegotiationRequest) -> NegotiationResponse
fn negotiate(&mut self, request: NegotiationRequest) -> NegotiationResponse
Source§fn apply_budget(&mut self, budget: ResourceBudget)
fn apply_budget(&mut self, budget: ResourceBudget)
Source§fn update(&mut self, context: &mut EngineContext<'_>)
fn update(&mut self, context: &mut EngineContext<'_>)
Source§fn report_status(&self) -> AgentStatus
fn report_status(&self) -> AgentStatus
Source§fn execute(&mut self)
fn execute(&mut self)
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Auto Trait Implementations§
impl Freeze for RenderAgent
impl !RefUnwindSafe for RenderAgent
impl Send for RenderAgent
impl Sync for RenderAgent
impl Unpin for RenderAgent
impl !UnwindSafe for RenderAgent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().