vk: a mesh fallback program whose compute pipeline failed is not compiled again #1317
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!1317
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/mesh-fallback-failed-pipeline-once"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fallback_compute_pipelines(gpu/vk/vk_draw.cpp) builds the task and mesh compute pipelines on a program's first fallback draw. When one fails, nothing is kept, so every later draw of that program compiles it again. With a driver that faults on the module, each try is one more fault caught byguarded_compute:a5da9f84b72d1471in one Kokiri Forest run, and 2–3 fps, because the replay retried that pipeline on every draw.With this change, the failure is remembered by the program's key and variant, and its draws are left out without another try. That is what the first failure already did for that draw. A program the driver can't compile then costs one missing effect instead of the frame rate. The fix behind those faults is the separate #792 port. This change only stops the next bad module from costing the frame rate again.
std::setof (key, variant) under the function's existing mutex, soProgramkeeps its layout and the program cache's stamp doesn't change.tests/test_mesh_fallback_failed_once.pychecks that the record is kept, checked under the lock beforeguarded_compute, and written before the return. I validated the test by mutation: it fails on main, without the check and without the insert.hookshot_vk.sobuilds on Linux with it, andpython -I -B tests/run_all.pypasses, exceptnx2/test_nup_read_name.py(zstandardis missing on my machine; it fails the same way on main). It has not been run in game: with #792's fixes, the GTX 1070 no longer reaches this path.Looks good. The failed set is checked and written under the same
muas the rest of the function,key/variantare both onProgram, and the earlyreturn falseis the same thing the old failure path already did for that draw, so callers (fallback_record-> SKIP_HERE) behave the same, just without the retry. Test checks the right ordering (check after the lock, beforeguarded_compute; insert before the return).Overlap with #1314: both touch
gpu/vk/vk_draw.cpp, but in different places (this one is insidefallback_compute_pipelines, #1314 starts a few lines later infallback_recordand indraw()), so they should merge cleanly, and they are complementary: #1314 makes sure the descriptors are right, this stops a module that still fails from being retried every draw. Their tests check different blocks, no conflict there either.Nits, nothing blocking:
madeare never destroyed (was already the case before, but now it happens once per program instead of per draw, so it's bounded).No CI checks are reported for the branch, and I didn't build it.