[pr-performance][shaders] Six translator levers on by default (+9 % fps, -5.0 ms of GPU time a frame, on an RTX 2080 Ti) #76
Loading…
Reference in a new issue
No description provided.
Delete branch "cafe/shader-levers"
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)
Cafe#9189What it changes
+9 % fps, -5.0 ms of GPU time a frame on an RTX 2080 Ti (same build, the six off against on).
Re-filed from CodeFloe PR 295 (that repo is gone; nothing was migrated). CodeFloe numbers are written without "#" here, since numbers restarted on this host. Brought up to
main1a5286a78by mergingmainin, without conflicts.Six translator changes, each measured on its own, on by default. Four are new, two change existing defaults. Each has a switch to turn it off by itself.
DARNER_LEGACY_FINITE=31(new; before, only values proven bounded)DARNER_MOVREL_WATERFALL(new, on unless0)v_movrels/v_movreld) run once per lane instead of once per distinct index, each pass a select over the whole register range.DARNER_LICM_CBUF=1(new;0off,2also descriptor handles)DARNER_SHADER_OPT=511(was 447)WIDEpass: up to 4 dwords of a console load in one call.DARNER_SHADER_LOOP_LIMIT_OF(new), default7b2c3c1db2298f44:1024CS_ShadowTileBalanceRTCostwalks an index range whose loop ran toward the 4,096-round compute cap; 1,024 is 4 times what the scene needed. Empty removes it.CS_ShadowRenderTiled,CS_GenerateShadowMasks_HairOnlylightAtlasalready does.LEGACY_FINITE,MOVREL_WATERFALLandLICM_CBUFare added to the shader cache key. The translated shaders change, so every player's pipelines are rebuilt once after this update.How it was tested
7e96ad684(main4a92569fbwith the six merged in);main1a5286a78merged in since as581ee600f, without conflicts and with no translator change between the two.DARNER_LEGACY_FINITE=0 DARNER_MOVREL_WATERFALL=0 DARNER_LICM_CBUF=0 DARNER_SHADER_OPT=447 DARNER_WAVE_FOLDED_SKIP=lightAtlas, and the loop limit pointed at no program.WIDEand hair masks together, +1.4 forLICM_CBUF. The replayed frames' pictures were unchanged.cargo test --release --locked -p darner-shader --lib: 490 passed, 68 failed;mainalone: 488 passed and the same 68 failed (the 2 more are this change's tests). The 68 need a Shader Model 6.6 device, which this Windows 10 PC can't give a test program.-p darner-gpu --libstops after 143 tests with exit code 3 here, the same onmainalone.LEGACY_FINITEtakes texture and buffer values as finite. If a game texture holds an infinity or NaN, 0 times it now gives NaN where it gave 0: look for black or bright specks.DARNER_LEGACY_FINITE=0brings back the old behaviour.Checklist
main.docs/asset-policy.md.Checked for overlap
4a92569fb7e96ad6840Nice. @TrustNo1 merge it
Would love to get some feedback on this too btw for folks that are GPU bound (or otherwise, just give me gpu time if you can).
I do pretty extensive correctness test even on my own captures, but still only just with my hardware and my driver.
Most of those optis should at least not hurt anybody though, like worst thing that hoisting a constant can do is that the compiler still just decides to read it in the loop anyway. 🤷♂️
Sup Cafe! Just compiled your PR and tested it.
Specs : 3060 ti (8 gig) 11700k I7 and 48 gig of DDR4.
FPS before was around 17-19 (without FG of course) and after running your PR it just jumped up to 21-23. Frame gen time also dropped by 5-6ms.
Very impressive buddy! If you need any more info I'll keep my eyes out. I'm also testing some tweaks and modifications to the code but have come up with NOTHING like this!
AMD numbers, as asked: RX 7900 XTX (24 GB, driver 32.0.32029.2010), Ryzen 7 7800X3D, Windows 11.
Card time in the title's lists: -2.5 ms a frame standing still (19.1 to 16.6 ms, -13 %), -2.3 ms on a walk. No fps change here: this PC is CPU-bound in this scene (the submitting thread 22-28 ms a frame), so the card's saving doesn't show as frame rate.
Setup: PR head
581ee600fbuilt as is (diag profile), the same build both ways. Old defaults set as in your description (DARNER_LEGACY_FINITE=0 DARNER_MOVREL_WATERFALL=0 DARNER_LICM_CBUF=0 DARNER_SHADER_OPT=447 DARNER_WAVE_FOLDED_SKIP=lightAtlas,DARNER_SHADER_LOOP_LIMIT_OFpointed at no program; the "these programs' loops stop sooner" warning was in every on-run's log and in none of the off-runs). Series S profile (1920x1080, no upscaler), hardware ray tracing, no frame generation, frame rate uncapped,DARNER_RELAY=2 DARNER_PORT_CBV=1. A heavy downtown save, pipelines warmed for both arms beforehand, the last 120 s of each run measured, arms alternated. No device losses, no pipelines compiled during the measured part.Standing still (same view every run, 5.5k draws a frame), two pairs (off, on, on, off):
Walking (a scripted 140 s walk; it wanders, so draws differ between runs by up to a third), three pairs (off, on, on, off, off, on):
The card was faster with the six on in all five pairs. Pair 2 of the walk had the smallest gap; its off-run walked a lighter stretch (5.6k against 7.6k draws).
Not covered: I measured the levers together, not one by one. Nobody has checked the picture by eye on this card yet (the specks risk you mention for
LEGACY_FINITE). I'll add a note here if we see any. I didn't check whether the unfolded list does anything on a wave64 AMD host; I'd expect it not to.@TrustNo1
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.