Intrepid/Prometeu/Runtime/pipeline/head This commit looks good
Add the windowless Studio host with authenticated binary control/frame channels, managed input, pause/resume/stop, frame ownership and save-aware shutdown. Preserve deterministic headless execution and add protocol/process fixtures. Separate unit CI and coverage from opt-in integration/socket qualification, retaining the prior combined coverage floors in the configuration history. Validation: tooling make verify passed runtime ci-domains and integration.
70 lines
2.2 KiB
Rust
70 lines
2.2 KiB
Rust
//! Observe complete synchronous submissions without changing machine/render semantics.
|
|
use prometeu_drivers::hardware::Hardware;
|
|
use prometeu_hal::*;
|
|
use prometeu_system::LatestRenderFrameStore;
|
|
|
|
pub(crate) struct StudioPlatform<'a> {
|
|
pub hardware: &'a mut Hardware,
|
|
pub store: &'a LatestRenderFrameStore,
|
|
}
|
|
impl RenderSubmissionSink for StudioPlatform<'_> {
|
|
fn submit_render_submission(
|
|
&mut self,
|
|
submission: RenderSubmission,
|
|
) -> Result<(), RenderSubmitError> {
|
|
let marker = (submission.frame_id, submission.ownership);
|
|
self.hardware.submit_render_submission(submission)?;
|
|
if marker.1.app_mode == app_mode::AppMode::Game {
|
|
let (w, h) = self.hardware.display_size();
|
|
let frame = OwnedRgba8888Frame::packed(
|
|
marker.0,
|
|
marker.1,
|
|
w,
|
|
h,
|
|
self.hardware.gfx.front_buffer().to_vec(),
|
|
)
|
|
.map_err(|_| RenderSubmitError::SubmissionRejected)?;
|
|
self.store.publish_frame(frame);
|
|
}
|
|
Ok(())
|
|
}
|
|
}
|
|
impl RuntimePlatform for StudioPlatform<'_> {
|
|
fn wall_clock(&self) -> &dyn WallClock {
|
|
self.hardware.wall_clock()
|
|
}
|
|
fn display_size(&self) -> (usize, usize) {
|
|
self.hardware.display_size()
|
|
}
|
|
fn render_submission_sink(&mut self) -> &mut dyn RenderSubmissionSink {
|
|
self
|
|
}
|
|
fn render_backend(&mut self) -> &mut dyn RenderBackend {
|
|
self.hardware
|
|
}
|
|
fn game2d_frame_composer(&mut self) -> &mut dyn Game2DFrameComposer {
|
|
self.hardware
|
|
}
|
|
fn audio(&self) -> &dyn AudioBridge {
|
|
self.hardware.audio()
|
|
}
|
|
fn audio_mut(&mut self) -> &mut dyn AudioBridge {
|
|
self.hardware.audio_mut()
|
|
}
|
|
fn input(&self) -> &dyn InputPlatform {
|
|
self.hardware.input()
|
|
}
|
|
fn input_mut(&mut self) -> &mut dyn InputPlatform {
|
|
self.hardware.input_mut()
|
|
}
|
|
fn assets(&self) -> &dyn AssetBridge {
|
|
self.hardware.assets()
|
|
}
|
|
fn assets_mut(&mut self) -> &mut dyn AssetBridge {
|
|
self.hardware.assets_mut()
|
|
}
|
|
fn telemetry(&self) -> &dyn TelemetryPlatform {
|
|
self.hardware.telemetry()
|
|
}
|
|
}
|