[pr-fix][rendering][shaders] Water: TV_GenerateTiles as lane pairs on 32-lane hosts (squares on the water) #700

Open
untried844 wants to merge 1 commit from untried844/Darner:water-generate-tiles-pairs into post-merge
First-time contributor

Refs #664

What it changes

  • The problem on post-merge: square blocks of 16x16 render pixels on and above the water where the water light is missing (issue #664), on a 32-lane host.

A frame capture (--features diagnostics, F7) shows the blocks already in the half-size transmission target that CS_TV_Tiled 5dc3b25986622949 and TV_Tiled_LocalLights 6f225b641c5b0708 write over the tile lists. The tiles nobody wrote lie on the 8x8 group grid of the program that builds those lists, TV_GenerateTiles 1aa247ed3653b616: of 51 such tiles in the captured frame, 43 are at x mod 8 = 0 or 7 and nearly all at y mod 8 = 0, 4, 5 or 6, the first rows of a host wave. So tiles are lost when the lists are built, as local waves (Rule::LocalWaves).

This gives the program Rule::LanePairs in by_hash/whole.rs, two console lanes to a host thread, so one reservation covers the whole group. The source note is extended to say why.

Ruled out on the way, each by a run: render size, ray tracing off, the replacement shaders, #674, a loop stopped at the iteration limit (DARNER_LOOP_REPORT=1: none), and TV_Tiled_LocalLights as lane pairs (no change).

How it was tested

  • Tested revision: this commit on post-merge 28a9b42, in a build that also held my other local changes (#666 patch, tiled shadows, audio, full screen).

  • Commands and results: cargo build --release --locked -p darner on this branch alone: builds. darner translate of the title's shaders with DARNER_HOST_MAX_WAVE=32: the program is emitted in the paired form with 32-lane waves.

  • Changes a default: yes, for 32-lane hosts (NVIDIA). This one program is translated again once.

  • A/B result, same save and view (dock, daylight), same settings:

    A (Rule::LocalWaves) B (Rule::LanePairs)
    Squares on and above the water present, every run gone
  • Checks run on that revision: cargo build. cargo test -p darner-shader has no tests on this line. cargo clippy not run.

  • Gameplay: Intel Core i9-13900K · 32 GB DDR5-6400 (2 sticks) · NVIDIA GeForce RTX 4090 24 GB, driver 621.40 · Windows 11 Pro build 26300. Series X profile, 2560x1440 output, DLSS Quality (1712x960 render) and DLAA, HDR on, frame generation 2x, hardware ray tracing.

  • Hardware dependence: may depend on the host's wave size and driver; untested on other cards.

  • Coverage gaps: one card. Frame time not measured. A flicker in water reflections was seen a few times on builds with this change and could not be reproduced on demand, with or without it; not tied to it.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
  • This PR contains one change based on post-merge (28a9b42).
  • The diff contains no game files, code or assets.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found for this program or issue
  • Replaces or overlaps: none found

The change was written with a coding agent (AI-assisted) and run by me in the game.

Refs #664 ## What it changes - The problem on `post-merge`: square blocks of 16x16 render pixels on and above the water where the water light is missing (issue #664), on a 32-lane host. A frame capture (`--features diagnostics`, F7) shows the blocks already in the half-size transmission target that `CS_TV_Tiled` `5dc3b25986622949` and `TV_Tiled_LocalLights` `6f225b641c5b0708` write over the tile lists. The tiles nobody wrote lie on the 8x8 group grid of the program that builds those lists, `TV_GenerateTiles` `1aa247ed3653b616`: of 51 such tiles in the captured frame, 43 are at x mod 8 = 0 or 7 and nearly all at y mod 8 = 0, 4, 5 or 6, the first rows of a host wave. So tiles are lost when the lists are built, as local waves (`Rule::LocalWaves`). This gives the program `Rule::LanePairs` in `by_hash/whole.rs`, two console lanes to a host thread, so one reservation covers the whole group. The source note is extended to say why. Ruled out on the way, each by a run: render size, ray tracing off, the replacement shaders, #674, a loop stopped at the iteration limit (`DARNER_LOOP_REPORT=1`: none), and `TV_Tiled_LocalLights` as lane pairs (no change). ## How it was tested - Tested revision: this commit on `post-merge` `28a9b42`, in a build that also held my other local changes (#666 patch, tiled shadows, audio, full screen). - Commands and results: `cargo build --release --locked -p darner` on this branch alone: builds. `darner translate` of the title's shaders with `DARNER_HOST_MAX_WAVE=32`: the program is emitted in the paired form with 32-lane waves. - Changes a default: yes, for 32-lane hosts (NVIDIA). This one program is translated again once. - A/B result, same save and view (dock, daylight), same settings: | | A (`Rule::LocalWaves`) | B (`Rule::LanePairs`) | |---|---|---| | Squares on and above the water | present, every run | gone | - Checks run on that revision: `cargo build`. `cargo test -p darner-shader` has no tests on this line. `cargo clippy` not run. - Gameplay: Intel Core i9-13900K · 32 GB DDR5-6400 (2 sticks) · NVIDIA GeForce RTX 4090 24 GB, driver 621.40 · Windows 11 Pro build 26300. Series X profile, 2560x1440 output, DLSS Quality (1712x960 render) and DLAA, HDR on, frame generation 2x, hardware ray tracing. - Hardware dependence: may depend on the host's wave size and driver; untested on other cards. - Coverage gaps: one card. Frame time not measured. A flicker in water reflections was seen a few times on builds with this change and could not be reproduced on demand, with or without it; not tied to it. ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - [x] This PR contains one change based on `post-merge` (`28a9b42`). - [x] The diff contains no game files, code or assets. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found for this program or issue - Replaces or overlaps: none found The change was written with a coding agent (AI-assisted) and run by me in the game.
Refs #664. As local waves the program still lost tiles of its two lists on a 32-lane host, and the two tiled transmission programs never wrote those tiles: squares of 16x16 render pixels on and above the water. Rule::LanePairs runs each console wave whole.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'water-generate-tiles-pairs:untried844-water-generate-tiles-pairs'
git switch 'untried844-water-generate-tiles-pairs'

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.

git switch 'post-merge'
git merge --no-ff 'untried844-water-generate-tiles-pairs'
git switch 'untried844-water-generate-tiles-pairs'
git rebase 'post-merge'
git switch 'post-merge'
git merge --ff-only 'untried844-water-generate-tiles-pairs'
git switch 'untried844-water-generate-tiles-pairs'
git rebase 'post-merge'
git switch 'post-merge'
git merge --no-ff 'untried844-water-generate-tiles-pairs'
git switch 'post-merge'
git merge --squash 'untried844-water-generate-tiles-pairs'
git switch 'post-merge'
git merge --ff-only 'untried844-water-generate-tiles-pairs'
git switch 'post-merge'
git merge 'untried844-water-generate-tiles-pairs'
git push origin 'post-merge'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!700
No description provided.