Merge pull request #365 from FIocker/gpu/publish-initialized-descriptor-heap
GPU: replay pending descriptors before publishing the host heap
This commit is contained in:
1 file changed
+12
-9
@@ -85,15 +85,18 @@ impl Heap {
|
|||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let mut pending = self.pending.lock().unwrap_or_else(|e| e.into_inner());
|
let mut pending = self.pending.lock().unwrap_or_else(|e| e.into_inner());
|
||||||
let h = self
|
// A recorder can take the fast path as soon as the OnceLock is
|
||||||
.host
|
// initialized. Publish only after replaying the queued writes.
|
||||||
.get_or_init(|| host::HostHeap::new(self.samplers(), self.desc.count))
|
self.host
|
||||||
.as_ref()?;
|
.get_or_init(|| {
|
||||||
let step = u64::from(increment(self.desc.kind)?);
|
let step = u64::from(increment(self.desc.kind)?);
|
||||||
for i in pending.drain(..) {
|
let h = host::HostHeap::new(self.samplers(), self.desc.count)?;
|
||||||
h.mirror(i, self.start + u64::from(i) * step, false);
|
for i in pending.drain(..) {
|
||||||
}
|
h.mirror(i, self.start + u64::from(i) * step, false);
|
||||||
Some(h)
|
}
|
||||||
|
Some(h)
|
||||||
|
})
|
||||||
|
.as_ref()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The descriptor index of `handle` in this heap, if it lies in it.
|
/// The descriptor index of `handle` in this heap, if it lies in it.
|
||||||
|
|||||||
Reference in new issue
Block a user