Skip to content

Shader: opt-in VICTORY_EARLY_DEPTH - #47

Open
UwUCammie wants to merge 1 commit into
borntofrag34:linux-winefrom
UwUCammie:perf/shader-early-depth-fast-legacy-mul-uniformity
Open

UwUCammie wants to merge 1 commit into
borntofrag34:linux-winefrom
UwUCammie:perf/shader-early-depth-fast-legacy-mul-uniformity

Conversation

@UwUCammie

@UwUCammie UwUCammie commented Nov 29, 2026 •

Copy link
Copy Markdown

Cut down to VICTORY_EARLY_DEPTH alone, as discussed below.

A pixel program whose console state says DB_SHADER_CONTROL.DEPTH_BEFORE_SHADER and that exports neither depth nor stencil gets DXIL's ForceEarlyDepthStencil (from elaboratecl/VIctory-AMD-4K 2e478277). Off by default, and part of the shader cache key only while it is on, so nothing changes without it.

On my line it has been on in all the runs of the gap counts in #73, including the 11,070 frames with no gap, so it does not cause one-frame dropouts there. I have no speed number I trust: the one I first gave was for this and two other switches together.

@borntofrag34

Copy link
Copy Markdown
Owner

Thanks! Tested on an RX 7900 GRE (RADV, Mesa 26.3.1, Proton/Wine 11, vkd3d-proton 3.2.0), town walk at 1920x1080, all three switches on (with a warm-up run into their own cache) against all off, same build:

  • On (run 338): 24.6 ms/frame median, but at 4,403 draws/frame. Off (run 339): 27.4 ms at 6,825 draws. The walk took different paths: the "on" run walked into the tattoo shop.
  • Fitted on draws: +0.55 ± 0.92 ms/frame for "on" at the same draws, so there's no gain visible here. In town the CPU sets the pace on this machine (the card works ~80-90 %), so card-side shader savings don't show.
  • Kept frames show no visible artifacts, but they aren't identical shots. Real refusals over all 25,790 shaders were not counted.

Not merging for now. Leaving it open in case a card-bound scene (or a reproducible input replay) shows a gain. Notes in docs/linux-wine.md, "The fork's pull request 47 in town: no gain shown".

@UwUCammie

UwUCammie commented Nov 30, 2026 •

Copy link
Copy Markdown
Author

Correction to what I first wrote here: I blamed these switches for a picture bug, and that was wrong.

The bug: on my line all plants vanish for a single frame now and then. At night the street lights behind them show for that frame and the exposure reacts, so the picture pulses darker. I counted it with the pop watch at eight blocks or more and got 35 gaps in 22,757 frames with the switches on and 0 in 30,463 off.

Then I kept every frame and looked for smaller ones. With the switches off it happens just as often (5 in 3,728 frames, against 5 in 4,132 on), it just mostly drops fewer plants, so it fell under my threshold. So the switches change how much goes missing, not whether it happens.

What does stop it is the heap sync in #73: 0 in 3,269 frames with the same count. I'm working on its cost there.

What still stands: VICTORY_FAST_LEGACY_MUL without the zero rule turns 0 x infinity into a NaN, so I wouldn't merge that part, and in three alternating pairs I saw no speed difference with the group off.

@borntofrag34

Copy link
Copy Markdown
Owner

Thanks for finding this before it went in. Yes, please cut it down to VICTORY_EARLY_DEPTH on its own, off by default. We'll measure it in town with VICTORY_AB and count one-frame gaps with the pop watch (#72 makes it work with our UI plane) before merging. VICTORY_FAST_LEGACY_MUL stays out: 0 x infinity has to give 0, not NaN. The legacy multiply-add goes through #74 / #67 with the refusal count. VICTORY_FIRST_LANE_OPT can come back as a PR of its own if you split it out and it is clean on its own.

…r the pixel programs that ask for it

A pixel program with DB_SHADER_CONTROL.DEPTH_BEFORE_SHADER and no depth or
stencil export gets DXIL's ForceEarlyDepthStencil (from
elaboratecl/VIctory-AMD-4K 2e478277). Off by default; part of the cache key
only while on.
@UwUCammie
UwUCammie force-pushed the perf/shader-early-depth-fast-legacy-mul-uniformity branch from 873b4f3 to 92c14d8 Compare November 30, 2026 15:13
@UwUCammie UwUCammie changed the title Shader: opt-in VICTORY_EARLY_DEPTH, VICTORY_FAST_LEGACY_MUL, and uniformity-based VICTORY_FIRST_LANE_OPT Shader: opt-in VICTORY_EARLY_DEPTH Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants