Skip to content

Shaders: VICTORY_WAVE_WIDE_ONLY turns the wave-wide form on for named programs (the two water volumetrics computes on NVIDIA) - #695

Open
FrancescoGelosoEterea wants to merge 1 commit into
fxceless:mainfrom
FrancescoGelosoEterea:wave-wide-only
Open

FrancescoGelosoEterea wants to merge 1 commit into
fxceless:mainfrom
FrancescoGelosoEterea:wave-wide-only

Conversation

@FrancescoGelosoEterea

Copy link
Copy Markdown

Why

On current main (310c6eb), two water_shading compute programs translate but stay at WaveSize(64), so a 32-lane host refuses them:

host pipeline refused error=0x80070057 shaders=[compute 5dc3b25986622949]
host pipeline refused error=0x80070057 shaders=[compute 6f225b641c5b0708]

They are CS_TransmissionVolumetrics_Tiled and CS_TransmissionVolumetrics_Tiled_LocalLights. Their thread groups are one console wave (64 threads). VICTORY_WAVE_WHY gives LDS in a group over 32, an LDS read and write in one lane-branch region, v_readlane. The forms tried after that stop at "a first-lane read where not every lane runs" and "a wave reduction where not every lane runs".

The wave-wide form (widen) handles exactly this case: it takes the lane branches around that code with the whole wave. With it, the two programs lower to WaveSize(32), with 4 and 7 branches taken wave-wide. Since e9765a7, that form is off unless VICTORY_WAVE_WIDE=1, because it left the particle light-atlas programs standing on the card. So it can only be turned on for every program at once.

What

VICTORY_WAVE_WIDE_ONLY=<hash prefix>,... turns the wave-wide form on only for the containers it names. A container is named by the hash the log uses: the first 16 hex digits of the container's BLAKE3.

  • emit::wave_wide_only(hash) reads the list.
  • emit::with_wave_wide(on, f) sets a thread-local flag around one translation, which the retry ladder reads next to VICTORY_WAVE_WIDE.
  • Both the game's translation (shader_cache::host_shader) and victory translate use it.
  • VICTORY_WAVE_WIDE_ONLY is part of the shader cache key, as VICTORY_WAVE_WIDE is.

Without the variable nothing changes.

Tested

RTX 5070 Ti, driver 621.24, Ryzen 7 9800X3D, Windows 11. Own 1.0.2.1 copy.

Not tested

  • That the volumetrics look right. The room scene does not show much water, and I have not compared frames with the programs off and on.
  • Any program other than these two under the wave-wide form.
  • AMD: a 64-lane host never reaches this path.

🤖 Generated with Claude Code

…amed containers alone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VibeClauding

Copy link
Copy Markdown

Note for the two water volumetrics this PR puts in VICTORY_WAVE_WIDE_ONLY: on an RTX 3070, Series S, running them in the wide form washed the view out of the cell window to near white in every frame from 2400 on. The same build without them in the list stayed clear (A/B, runs 82 and 84, numbers on #823). The other two programs (2cc4c197ee29e291, 369cbe906ea72764) showed no such effect.

AI-assisted (Claude Code).

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