Bake sources: leave out null views, say why a real one fails
The 588 "failed" bake sources of the first runs (3,720 sources in 256 bakes) were null views: slot 1 and others hold views of no resource, which small numbers among the bake's words name all the time, and is_texture_view counts them (no buffer behind them). They have no host copy to make, so they were counted as refused. Now they are not sources at all. A real failure now says why (the first 64, a warning with the view): the host refused the copy, the staging buffer was deferred, uploads are refused after the host ran out of memory, or no upload was recorded (no console layout, an XOR mode, no staging buffer). Whether an upload was recorded is told by upload_from itself (UPLOAD_STAGED), and a source whose upload the pass recorded on the bake's list already counts as brought up to date (it was counted as failed or uploaded twice). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
dfb76df595
commit
082ebaf3b8
2 files changed
+76
-22
No files matched your search
@@ -753,6 +753,25 @@ pub(crate) struct Digest(u128);
|
||||
/// [`upload`] of the levels from `first` on, the ones a view shows: of a
|
||||
/// texture the title placed there may be no memory of the larger ones, and
|
||||
/// what lies there is another texture's. (After victory-amd 4436f8f1.)
|
||||
/// Whether `list` has recorded [`upload_from`]'s upload of `resource`
|
||||
/// from level `first` (or been asked to: see [`UPLOAD_STAGED`]).
|
||||
pub(crate) fn upload_listed(list: &HostList, resource: This, first: u32) -> bool {
|
||||
let first = if crate::resource::held_only() { first } else { 0 };
|
||||
list.used(upload_key(resource, first))
|
||||
}
|
||||
|
||||
/// The key [`upload_from`] asks `HostList::first_use` with.
|
||||
fn upload_key(resource: This, first: u32) -> usize {
|
||||
1 << 63 | (resource as usize) << 4 | first as usize & 15
|
||||
}
|
||||
|
||||
thread_local! {
|
||||
/// Set by [`upload_from`] when it found or made the texture's staging
|
||||
/// buffer (its upload is recorded or checked at submission): for a
|
||||
/// caller that must know the upload happened.
|
||||
pub(crate) static UPLOAD_STAGED: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
|
||||
}
|
||||
|
||||
pub(crate) fn upload_from(list: &HostList, resource: This, first: u32) {
|
||||
let first = if crate::resource::held_only() { first } else { 0 };
|
||||
let host_written = HOST_WRITTEN
|
||||
@@ -767,7 +786,7 @@ pub(crate) fn upload_from(list: &HostList, resource: This, first: u32) {
|
||||
}
|
||||
// Once a list for each first level; not again for one that the list's
|
||||
// upload of larger ones held too.
|
||||
if !list.first_use(1 << 63 | (resource as usize) << 4 | first as usize & 15) {
|
||||
if !list.first_use(upload_key(resource, first)) {
|
||||
return;
|
||||
}
|
||||
if !list.first_use(resource as usize) && staged_from(resource) <= first {
|
||||
@@ -781,6 +800,7 @@ pub(crate) fn upload_from(list: &HostList, resource: This, first: u32) {
|
||||
let Some(staging) = staging(resource, ©, first) else {
|
||||
return;
|
||||
};
|
||||
UPLOAD_STAGED.set(true);
|
||||
use std::sync::atomic::Ordering::Relaxed;
|
||||
let baking = BAKING.get();
|
||||
if baking {
|
||||
|
||||
Reference in new issue
Block a user