A render target's frame count follows its storage, not the guest's texture object, and a mesh draw no longer waits for a pipeline that is known to be compiling.

Found in the first run of the previous two commits (a first visit of Kokiri Forest from a state that had only seen Hyrule Field):

- The count of frames a target was rendered in started again whenever the guest's texture object changed, and the game initializes its render target objects anew every frame at the same storage: the log showed `seen 2129/2128 in 1 frames`, so no target ever became steady and the rule did nothing. The owner of an image is now the storage address the texture cache keys it by. An image handed on to a texture elsewhere still starts at none.
- A one-shot mesh draw waited its 8 ms in every frame that met the same pipeline while it compiled for 150 to 1100 ms: 17 waits, 170 ms, every draw skipped at the end, up to four in one frame. A mesh pipeline that has been building for longer than that wait is a compile, and the draws after the first do not wait for it (vk_pipeline_building_ms).
- The last wait of a full-screen draw with no picture to hold was 40 ms a draw, and two such draws made 86 ms in one frame. It is 40 ms a frame now.
- A one-shot vertex draw skipped at the end of its wait gets its log line however short the wait was (seven were skipped with no line, so their targets could not be named).

That run against the same cell of the earlier comparison (same exe path, cache state, route and settings; one run each): the load's worst wait of the draws in one frame 99 ms against 735 ms, no mesh wait over 13 ms against 524 and 206 ms. Two long frames remain in both runs (628 and 862 ms here, 660 and 854 ms there): two compute pipelines built at their first dispatch, about 395 and 397 ms.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 12:14:29 -05:00
parent 9d257edf5a
commit e9ec6de6bc
6 changed files with 66 additions and 32 deletions

View File

@@ -11,8 +11,8 @@
static int fails;
#define CHECK(c, ...) do { if (!(c)) { fails++; printf("FAIL line %d: ", __LINE__); printf(__VA_ARGS__); printf("\n"); } } while (0)
static TfrTarget T(uint64_t image, uint32_t level, uint32_t layer, uint64_t serial) {
return (TfrTarget){image, level, layer, serial};
static TfrTarget T(uint64_t image, uint32_t level, uint32_t layer, uint64_t owner) {
return (TfrTarget){image, level, layer, owner};
}
// The verdict with the steady rule and without it; *by: only the steady rule made it per-frame.
@@ -84,7 +84,8 @@ int main(void) {
tfr_note(&scene_d, f2), tfr_note(&icon, f2);
CHECK(pass(&icon, 1, &scene_d, f2, 1, 1, NULL) == 0, "an icon's first capture is one-shot though its depth buffer is recent");
CHECK(pass(&icon, 1, &scene_d, f2, 1, 0, NULL) == 0, "and was before the rule");
// an image taken over by another texture starts again: the per-frame history of its handle is not the new texture's
// an image handed on to a texture at other storage starts again: the per-frame history of its handle is not the
// new texture's
TfrTarget reused = T(scene.image, 0, 0, 500);
CHECK(tfr_steady(&scene, f2 + 300) == 1, "the scene target is steady");
CHECK(pass(&reused, 1, NULL, f2 + 300, 1, 1, NULL) == 0, "the same image as another texture is not steady");