Shaders: the tiled shadows and the hair shadow masks are folded by default on 32-lane hosts, so their tile votes are whole again #504
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!504
Loading…
Reference in a new issue
No description provided.
Delete branch "ntsthay/fold-tiled-shadows"
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?
Contributor role (optional)
What it changes
UNFOLDED_BY_DEFAULTinemit/mod.rsnow holds onlylightAtlas. The tiled shadow programs (CS_ShadowRenderTiled*) and the hair shadow masks (CS_GenerateShadowMasks_HairOnly) are folded by default again on 32-lane hosts. The README row ofDARNER_WAVE_FOLDED_SKIPalready said the default skips only the particle light atlas, so the code now matches it.Unfolded, these programs fall to local waves, and local waves are not exact for them.
CS_ShadowRenderTiledCascadesCB(be6ce5d849d51127in 1.0.2.1) holds a vote over its 8x8 tile at 0x2420 to 0x2434. It takesv_readfirstlaneof the shadow estimate, compares every lane to it withv_cmp_eq, counts the lanes that differ withs_bcnt1, and skips the PCF filtering when all 64 lanes agree. With local waves each 32-lane half votes alone. One half skips the filter and the other does not, so the sun's shadow edges on faces and roads come out in half-tile blocks, a grid that is easy to see with a low sun. Folded, one host wave holds the whole console wave and the vote counts all 64 lanes.On the cost: the comment said these programs saved 1.3 ms of an RTX 2080 Ti's replayed frame unfolded. On an RTX 4080 the difference is within noise (below).
DARNER_WAVE_FOLDED_SKIP=lightAtlas,CS_ShadowRenderTiled,CS_GenerateShadowMasks_HairOnlybrings back the old default.How it was tested
Tested revision: this commit on main
c8258f9.cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with--all-features: clean.darner translateof the title'sshaders.rpfwith this commit,DARNER_HOST_WAVE=32 DARNER_WAVE_WHY=1and no other switch, over the nineCS_ShadowRenderTiled*programs andCS_GenerateShadowMasks_HairOnly: all ten come outfolded (before wave-wide)with 32-lane waves ("10 emitted of 10 compute programs"). Before, all ten were local waves (APPROXIMATE).In game: RTX 4080, driver 620.73, Linux under Proton (proton-cachyos), Series S profile, DLAA, hardware RT, no frame generation. Four unattended runs of 200 s from the same daytime save, taking turns. The numbers below are median frame times after the first minute of world. The build was main
d91d8e4plus other PRs, withDARNER_WAVE_FOLDED_SKIP=lightAtlasstanding in for this change:With the fold, the blocks on faces and on road shadows were gone when I looked in play. I have not measured a 20-series card; there the 1.3 ms may still hold, and it would be worth a check by someone with one.
Changes a default: yes, on 32-lane hosts (NVIDIA). These programs are translated again once. Cards with 64-lane waves do not fold, so nothing changes there.
Checklist
main.docs/asset-policy.md.emit/mod.rs.Checked for overlap
UNFOLDED_BY_DEFAULT.DARNER_PAIR_FIRST(PAIR_FIRST_BY_DEFAULT, off by default) is another way to make the tiled shadows exact. In a census of 1.0.2.1 withDARNER_HOST_WAVE=32, the pair form only takesCS_ShadowRenderTiledCascadesCB. The other eight variants are refused with "a lane mask exchanged after its block, in a group of several console waves" and fall back to local waves, so the fold is what covers the whole family.Shaders: the tiled shadows and the hair shadow masks are folded by default on 32-lane hosts, so their tile votes are whole againto [pr-fix][shaders] Shaders: the tiled shadows and the hair shadow masks are folded by default on 32-lane hosts, so their tile votes are whole again[pr-fix][shaders] Shaders: the tiled shadows and the hair shadow masks are folded by default on 32-lane hosts, so their tile votes are whole againto Shaders: the tiled shadows and the hair shadow masks are folded by default on 32-lane hosts, so their tile votes are whole againTest needed — commit
4302b88f; what to check:UNFOLDED_BY_DEFAULTinemit/mod.rsnow holds onlylightAtlas. The tiled shadow programs (CS_ShadowRenderTiled*) and the hair shadow masks (CS_GenerateShadowMasks_HairOnly) are folded by default again on 32-lane hosts. The README row ofDARNER_WAVE_FOLDED_SKIPalready said the default skips only the particle light atlas, so the code now matches it.Unfolded, these programs fall to local waves, and local waves are not exact for them.
CS_ShadowRenderTiledCascadesCB(be6ce5d849d51127in 1.0.2.1) holds a vote over its 8x8 tile at 0x2420 to 0x2434. It takesv_readfirstlaneof the shadow estimate, compares every lane to it withv_cmp_eq, counts the lanes that differ withs_bcnt1, and skips the PCF filtering when all 64 lanes agree. With local waves each 32-lane half votes alone. One half skips the filter and the other does not, so the sun's shadow edges on faces and roads come out in half-tile blocks, a grid that is easy to see with a low sun. Folded, one host wave holds the whole console wave and the vote counts all 64 lanes.On the cost: the comment said these programs saved 1.3 ms of an RTX 2080 Ti's replayed frame unfolded. On an RTX 4080 the difference is with
Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.