Report layers rendered to iced_beacon

This commit is contained in:
Héctor Ramón Jiménez 2025-04-29 23:01:45 +02:00
parent fae95d6095
commit 613c706a39
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
6 changed files with 45 additions and 6 deletions

View file

@ -48,6 +48,7 @@ pub enum Event {
MessageLogged { number: usize, message: String },
CommandsSpawned(usize),
SubscriptionsTracked(usize),
LayersRendered(usize),
}
impl Client {

View file

@ -127,6 +127,7 @@ pub fn run() -> impl Stream<Item = Event> {
let mut last_tasks = 0;
let mut last_subscriptions = 0;
let mut last_present_window = None;
let mut last_present_layers = 0;
drop(task::spawn(async move {
let mut last_message_number = None;
@ -199,6 +200,9 @@ pub fn run() -> impl Stream<Item = Event> {
) => {
last_tasks = commands;
}
client::Event::LayersRendered(layers) => {
last_present_layers = layers;
}
client::Event::SpanStarted(
span::Stage::Update,
) => {
@ -264,7 +268,10 @@ pub fn run() -> impl Stream<Item = Event> {
}
}
span::Stage::Present(window) => {
Span::Present { window }
Span::Present {
window,
layers: last_present_layers,
}
}
span::Stage::Custom(name) => {
Span::Custom { name }

View file

@ -33,6 +33,7 @@ pub enum Span {
},
Present {
window: window::Id,
layers: usize,
},
Custom {
name: String,
@ -70,7 +71,7 @@ impl Span {
Span::Draw { window } => Stage::Draw(*window),
Span::Prepare { primitive, .. } => Stage::Prepare(*primitive),
Span::Render { primitive, .. } => Stage::Render(*primitive),
Span::Present { window } => Stage::Present(*window),
Span::Present { window, .. } => Stage::Present(*window),
Span::Custom { name, .. } => Stage::Custom(name.clone()),
}
}