feat: report invalidated rendering dependency identities and versions
Verify Tessera GUI / verify (push) Failing after 9m24s
Verify Tessera GUI / verify (push) Failing after 9m24s
This commit is contained in:
+22
-4
@@ -22,6 +22,8 @@ pub(crate) struct Presentation {
|
||||
pub published_version: u64,
|
||||
pub force_frame: bool,
|
||||
pub paint_reads: std::collections::BTreeMap<ObjectRef, u64>,
|
||||
pub dependency_invalidations: usize,
|
||||
pub last_invalid_dependency: String,
|
||||
pub layout_reads: std::collections::BTreeMap<ObjectRef, u64>,
|
||||
pub measure_cache: crate::source_layout::Cache,
|
||||
pub snapshot_visited: usize,
|
||||
@@ -30,13 +32,27 @@ pub(crate) struct Presentation {
|
||||
|
||||
impl Presentation {
|
||||
pub fn observe_changes(&mut self, vm: &Vm, changes: &ChangeBatch) {
|
||||
if self
|
||||
.paint_reads
|
||||
if let Some((phase, object, version)) = self
|
||||
.layout_reads
|
||||
.iter()
|
||||
.chain(self.layout_reads.iter())
|
||||
.any(|(object, version)| vm.change_version(*object).ok() != Some(*version))
|
||||
.map(|(object, version)| ("layout", object, version))
|
||||
.chain(
|
||||
self.paint_reads
|
||||
.iter()
|
||||
.map(|(object, version)| ("paint", object, version)),
|
||||
)
|
||||
.find(|(_, object, version)| vm.change_version(**object).ok() != Some(**version))
|
||||
{
|
||||
self.force_frame = true;
|
||||
self.dependency_invalidations = self.dependency_invalidations.saturating_add(1);
|
||||
let kind = vm
|
||||
.object(*object)
|
||||
.map(|value| value.payload().kind_name())
|
||||
.unwrap_or("released");
|
||||
self.last_invalid_dependency = format!(
|
||||
"{phase} {kind} {object}: {version} -> {:?}",
|
||||
vm.change_version(*object).ok()
|
||||
);
|
||||
}
|
||||
self.render_cache.invalidate(ChangeBatch {
|
||||
changes: changes.changes.clone(),
|
||||
@@ -91,6 +107,8 @@ impl Presentation {
|
||||
published_version: 0,
|
||||
force_frame: false,
|
||||
paint_reads: std::collections::BTreeMap::new(),
|
||||
dependency_invalidations: 0,
|
||||
last_invalid_dependency: String::new(),
|
||||
layout_reads: std::collections::BTreeMap::new(),
|
||||
measure_cache: crate::source_layout::Cache::default(),
|
||||
snapshot_visited: 0,
|
||||
|
||||
Reference in New Issue
Block a user