The frame line says how many indirect records ran empty for want of their list's budget, and the largest cost; VICTORY_INDIRECT_REST=0: a record that does not fit takes nothing from the ones after it

Belobug (76387c2d) found draws flickering because the records past a list's
budget were not the same ones from frame to frame. Whether ours are refused
is not known: the count says it (atomics only when there is something to
say). Off by default; the records' order and costs stay what they were.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-25 15:46:34 -06:00
1 parent ca1d519f18
commit 449830f6fd
3 files changed
+87 -18

No files matched your search

+15 -2
View File
@@ -124,7 +124,7 @@ void main(uint3 id : SV_DispatchThreadID, uint gi : SV_GroupIndex) {
for (uint j = 0; j < n; j++) {
uint c = costs[j];
if (c > 0 && next < BUDGET) {
next = (BUDGET - next <= c) ? BUDGET : (next + c);
next = (BUDGET - next < c) ? (REST ? BUDGET : next) : (next + c);
}
}
if (next == before) break;
@@ -134,15 +134,28 @@ void main(uint3 id : SV_DispatchThreadID, uint gi : SV_GroupIndex) {
before = prev;
}
uint at = before;
uint refused = 0;
uint biggest = 0;
for (uint k = 0; k < n; k++) {
uint c = costs[k];
uint fit = 1;
if (c > 0) {
fit = (at < BUDGET && BUDGET - at >= c) ? 1u : 0u;
at = (at >= BUDGET || BUDGET - at <= c) ? BUDGET : (at + c);
at = (at >= BUDGET || BUDGET - at < c) ? (REST ? BUDGET : at) : (at + c);
refused += 1 - fit;
biggest = max(biggest, c);
}
fits[k] = fit;
}
// Diagnostics: the records that run empty for want of budget, and
// the largest cost there was (small ones are not told).
uint told;
if (refused > 0) {
budget.InterlockedAdd(12, refused, told);
}
if (biggest >= (1u << 22)) {
budget.InterlockedMax(16, biggest, told);
}
}
GroupMemoryBarrierWithGroupSync();
if (gi == 0 && n > 0 && all_asked > 0) {