Title slots show a new texture after its upload has run (VICTORY_SHOW_AFTER=1; off), and the book says more of one
Three losses were page faults in a texture made and shown in the last tenth of a second. With the switch the texture pass, and a draw's table for the title's slots, put a neutral 1x1 texture (or the old view of the same texture) there until the submission with the upload has finished. The book's report has the piece and its block, the submissions at the making, the upload's submission, and what the slot showed before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
3d738f0f3e
commit
886e2040fc
4 files changed
+389
-13
No files matched your search
@@ -2329,19 +2329,33 @@ impl State {
|
||||
let shows_other = !baking
|
||||
&& crate::resource::held_only()
|
||||
&& heap.handle(index).is_some_and(|handle| host.texture_slot_shows_other(index, handle));
|
||||
// A slot that shows nothing of it yet, or something else, shows it
|
||||
// when the upload has run too.
|
||||
let late = !shows_other
|
||||
&& !baking
|
||||
&& crate::descriptor::host::show_after()
|
||||
&& heap.handle(index).is_some_and(|handle| !host.texture_slot_made_from(index, handle));
|
||||
let view = heap.handle(index).and_then(|handle| {
|
||||
if shows_other { crate::descriptor::view(handle) } else { host.mirror(index, handle, true) }
|
||||
if shows_other || late { crate::descriptor::view(handle) } else { host.mirror(index, handle, true) }
|
||||
});
|
||||
let at_once = || {
|
||||
if late && let Some(handle) = heap.handle(index) {
|
||||
let _ = host.mirror(index, handle, true);
|
||||
}
|
||||
};
|
||||
let placed = view.as_ref().and_then(crate::descriptor::host::placed_texture);
|
||||
let resource = match placed.as_ref().or(view.as_ref()) {
|
||||
Some(&View::Shader(resource, _)) => resource as This,
|
||||
_ => {
|
||||
at_once();
|
||||
host.texture_slot_done(index, write, None);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
let title_fills = crate::resource::host_resource(resource).is_some_and(crate::texture::title_written);
|
||||
let texture = crate::resource::host_resource(resource);
|
||||
let title_fills = texture.is_some_and(crate::texture::title_written);
|
||||
if !title_fills {
|
||||
at_once();
|
||||
// a render target, a depth or unordered access texture: the host's own
|
||||
host.texture_slot_done(index, write, None);
|
||||
continue;
|
||||
@@ -2361,6 +2375,14 @@ impl State {
|
||||
if shows_other && let Some(handle) = heap.handle(index) {
|
||||
let _ = host.mirror(index, handle, true);
|
||||
}
|
||||
// Its bytes are in, or on the way there in a list before.
|
||||
if late && texture.is_some_and(crate::pool::fresh) {
|
||||
if let Some(handle) = heap.handle(index) {
|
||||
host.texture_slot_show_after(list, index, handle);
|
||||
}
|
||||
} else {
|
||||
at_once();
|
||||
}
|
||||
let again = partly.map(|mapped| (frame + 1, mapped));
|
||||
let memory = if again.is_none() && heap_recheck() { crate::texture::title_span(resource, first) } else { None };
|
||||
match memory {
|
||||
@@ -2382,6 +2404,26 @@ impl State {
|
||||
if shows_other && let Some(handle) = heap.handle(index) {
|
||||
host.texture_slot_flip(list, index, handle);
|
||||
}
|
||||
if late && let Some(handle) = heap.handle(index) {
|
||||
host.texture_slot_show_after(list, index, handle);
|
||||
}
|
||||
#[cfg(feature = "diagnostics")]
|
||||
if crate::book::on()
|
||||
&& let Some(texture) = texture.filter(|t| crate::pool::fresh(t))
|
||||
{
|
||||
use windows::core::Interface;
|
||||
let raw = texture.as_raw() as usize;
|
||||
let asked = crate::host::submissions();
|
||||
list.defer_host(move || {
|
||||
let (started, finished) = crate::host::submissions();
|
||||
crate::book::note(raw, || {
|
||||
format!(
|
||||
"; upload for slot {index} recorded at submissions {asked:?}, sent as submission {started} (finished {finished}) at {:.3} s",
|
||||
crate::host::now_ms() as f64 / 1e3
|
||||
)
|
||||
});
|
||||
});
|
||||
}
|
||||
// A texture view the host refuses removes the device: name it.
|
||||
static GONE: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
|
||||
if !GONE.load(Ordering::Relaxed)
|
||||
@@ -3158,7 +3200,7 @@ impl State {
|
||||
listed.tabled = Some((title + k, kind.is_some()));
|
||||
host.texture_slot_tabled(title + k, kind.is_some());
|
||||
if kind.is_some() {
|
||||
host.mirror(title + k, table + u64::from(k) * 32, true);
|
||||
host.mirror_after(list, title + k, table + u64::from(k) * 32);
|
||||
}
|
||||
}
|
||||
if was != (listed.ready, listed.tabled) {
|
||||
@@ -3195,7 +3237,7 @@ impl State {
|
||||
{
|
||||
host.texture_slot_tabled(title + k, kind.is_some());
|
||||
if kind.is_some() {
|
||||
host.mirror(title + k, table + u64::from(k) * 32, true);
|
||||
host.mirror_after(list, title + k, table + u64::from(k) * 32);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user