Runtime: the unslotted-attachment-read check reads the heap block's own id and lets go of the pass before the draw is recorded

ae4dfd67b9 did not build: memory::Block keeps its id under its memory, and the
pass borrowed for the check was held by the resolves iterator past the draw's
mutable borrows. The check now runs in its own block. Verified by the clippy,
lavapipe and RADV 780M jobs named with this branch's report.
This commit is contained in:
Anees Iqbal committed 2026-11-23 21:54:23 -08:00
1 parent 3b76e461a2
commit 2c95b330e5
2 files changed
+9 -8

No files matched your search

@@ -3141,15 +3141,16 @@ impl RenderCommandEncoder {
// A draw that may read beyond its slots, while a declared read covers an attachment the
// pass holds out of its home layout: such a read names the texture's own element, whose
// layout is the home one (`Metrics::unslotted_attachment_reads`).
let pass = &self.pass;
let resolves = (pass.resolving.then(|| pass.resolves()))
.into_iter()
.flatten();
let unslotted = (draws.reads_unbound || commands)
&& (pass.targets())
let unslotted = (draws.reads_unbound || commands) && {
let pass = &self.pass;
let resolves = (pass.resolving.then(|| pass.resolves()))
.into_iter()
.flatten();
(pass.targets())
.map(|t| (&t.texture, t.moves()))
.chain(resolves.map(|r| (&r.texture, r.moves())))
.any(|(texture, moved)| moved && self.declared.reads(texture));
.any(|(texture, moved)| moved && self.declared.reads(texture))
};
let tables = &self.tables;
let factors = (self.factors.as_ref())
.filter(|_| draws.patches)
+1 -1
View File
@@ -3925,7 +3925,7 @@ impl TextureInner {
/// `use_heap` declaration names.
pub(crate) fn heap_block(&self) -> Option<BlockId> {
match &self.image_of()?._under {
Some(Under::Heap { block, .. }) => Some(block.id),
Some(Under::Heap { block, .. }) => Some(block.memory.id),
_ => None,
}
}