Repository navigation
Conversation
…tream #2055) Ported from upstream VIctory commit bca3ecd (pull request #2055, Flare): a cache entry that cannot be written (its folder is a file, the disk is full, a scanner holds it) made victory_pipeline::Cache::get_or_convert fail, and cached propagated that error: the shader was translated once and then lost for the run - every pipeline behind it dropped, though the translation itself had been made. The converter keeps the translation it just made (Translate.made), the cache error leaves the entry for a later run instead of failing the shader, and the caller gets the translation without reading the entry back (the first read of a new file costs about as much as a small translation where a virus scanner looks at it: 0.5-3 ms here). Adapted to this fork: its encode takes a HostShader (a refusal is not cached), so the made translation is stored only when the conversion succeeds. Test: a_translation_is_made_once_when_its_entry_cannot_be_written (the cache root is a file). It fails before the change ("when the file already exists ... os error 183") and passes after; the translation runs once. cargo test -p victory-gpu --lib: 218 passed, 0 failed, 6 ignored; cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A shader cache entry that cannot be written - its folder replaced by a file, the disk full, a scanner holding the file - makes
victory_pipeline::Cache::get_or_convertreturn an error after the translation has already run.shader_cache::cachedpropagated that error with?, so the translation was made once and then lost: the shader never got a host pipeline for the run, and its draws were dropped even though the work had succeeded.Upstream VIctory fixed this in commit bca3ecd (pull request #2055, by Flare); this is that fix ported and adapted to the fork.
Change
Translatekeeps theHostShaderits conversion made.encodetakes aHostShader(a refusal is not cached), so only a successful translation is kept.Tests
a_translation_is_made_once_when_its_entry_cannot_be_written: the cache root is replaced by a file, socreate_dir_allfails. Before the change this test fails withErr(... os error 183); with it the translation is returned and the converter ran exactly once.cargo test -p victory-gpu --lib --locked: 218 passed, 0 failed, 6 ignored.cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean.cachedand a cache folder only.(CI note: the
checkjob on main is currently red on the asset-policy violation; #1322 fixes that, after which this can be rebased.)