[pr-fix][rendering] The CPU occlusion image gets a far-plane stand-in where its view is not made (DARNER_OCCLUSION_FAR, on) #335

Open
co11ector wants to merge 1 commit from co11ector/occlusion-far into main AGit
First-time contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

  • The problem on main: read from the code only. neutral_for gives every 2D texture slot whose host copy is not made the gray stand-in, 0x80 in every channel, which a shader reads as 0.5. For one texture of the title that value is wrong: the CPU occlusion image (128x72 R32_FLOAT), which CS_InitDepthPyramidWithCpuOcclusion3x3 reads as the pyramid's seed and the batch cull passes then read. Its depths are linear, about 1 to 2,300 (those measured on the same title in ReVIctory's notes), so 0.5 is nearer than anything in the image: the cull drops every batch for that frame (trees, props and buildings gone for a blink; #263, and jaxe reproduces it).

  • This gives that image's slots a 128x72 R32_FLOAT texture of 1e6 instead (the image's own size, so that a read by texel index finds the far depth as a sampled read does), and DARNER_OCCLUSION_FAR=0 keeps the gray stand-in. The image is recognized by shape (2D, R32_FLOAT, 128x72): from the view's own words when it is a placed texture (its host copy not made is the case that matters) or from the resource when it has one. From ReVIctory's VICTORY_OCCLUSION_FAR, in turn from VIda 471c423.

How it was tested

  • Tested revision: 4f54eb1, based on main's f3840d7.

  • Commands and results:

    • cargo clippy --workspace --all-targets --locked -- -D warnings — clean.
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings — clean.
    • cargo test -p darner-gpu --locked descriptor::host — 106 passed, 0 failed, 1 ignored.
    • cargo test -p darner-gpu --locked — the parallel lib suite exited with 0xc0000005 on this machine (STATUS_ACCESS_VIOLATION; the GPU-using tests run in parallel here). The descriptor::host tests above are the ones this change touches.
  • Changes a default: yes, for every card: a slot of the occlusion image shows 1e6 instead of 0.5.

  • A/B result: none yet, and I do not claim this fixes the flicker reported in #263. In a 20-minute session on this machine the image's slot was neutralized once, at start, and the in-game flicker still reproduced. What is verified is that the shape matches and the stand-in is taken:

    occlusion: the CPU occlusion image (128x72 R32_FLOAT) gets a far-plane stand-in instead of the gray one (DARNER_OCCLUSION_FAR=0: off)
    occlusion: the far-plane stand-in took the CPU occlusion image's slot (1 so far; DARNER_OCCLUSION_FAR=0: off)
    
  • Gates run on that revision: gate 1 and gate 2; gate 3 as noted above (descriptor::host only).

  • Gameplay, when relevant: RX 9070 XT 16 GB, Adrenalin 32.0.32029.2010, i5-13600KF, 32 GB RAM, Windows 11; Series S profile, 720 render → 1440 output, FSR 4 Quality, FSR 4 frame generation 2x, textures High, ray tracing off, 30 fps cap.

  • Shader wave sizes tested: not relevant.

  • Hardware dependence: likely general (the image is the title's, not the card's); tested on one AMD card only.

  • Coverage gaps: no A/B of the visible flicker; the neutralized slot was seen once at start here, so a scene where it happens repeatedly is untested.

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 main.
  • The diff follows docs/asset-policy.md.
  • 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: #245 (stand-in texture allocation retries, same file), #231 (descriptor writes, same file), #307 (diagnostics in the same file), #292 (constant buffer reads, same file), #220 (resource.rs).
  • Replaces or overlaps: none found (no open PR gives the occlusion image a stand-in).
## Contributor role (optional) - Fluxer ID: ## What it changes - The problem on main: read from the code only. `neutral_for` gives every 2D texture slot whose host copy is not made the gray stand-in, 0x80 in every channel, which a shader reads as 0.5. For one texture of the title that value is wrong: the CPU occlusion image (128x72 R32_FLOAT), which `CS_InitDepthPyramidWithCpuOcclusion3x3` reads as the pyramid's seed and the batch cull passes then read. Its depths are linear, about 1 to 2,300 (those measured on the same title in ReVIctory's notes), so 0.5 is nearer than anything in the image: the cull drops every batch for that frame (trees, props and buildings gone for a blink; #263, and jaxe reproduces it). - This gives that image's slots a 128x72 R32_FLOAT texture of 1e6 instead (the image's own size, so that a read by texel index finds the far depth as a sampled read does), and `DARNER_OCCLUSION_FAR=0` keeps the gray stand-in. The image is recognized by shape (2D, R32_FLOAT, 128x72): from the view's own words when it is a placed texture (its host copy not made is the case that matters) or from the resource when it has one. From ReVIctory's `VICTORY_OCCLUSION_FAR`, in turn from VIda 471c423. ## How it was tested - Tested revision: 4f54eb1, based on `main`'s f3840d7. - Commands and results: - `cargo clippy --workspace --all-targets --locked -- -D warnings` — clean. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` — clean. - `cargo test -p darner-gpu --locked descriptor::host` — 106 passed, 0 failed, 1 ignored. - `cargo test -p darner-gpu --locked` — the parallel lib suite exited with 0xc0000005 on this machine (STATUS_ACCESS_VIOLATION; the GPU-using tests run in parallel here). The descriptor::host tests above are the ones this change touches. - Changes a default: yes, for every card: a slot of the occlusion image shows 1e6 instead of 0.5. - A/B result: **none yet**, and I do not claim this fixes the flicker reported in #263. In a 20-minute session on this machine the image's slot was neutralized once, at start, and the in-game flicker still reproduced. What is verified is that the shape matches and the stand-in is taken: ``` occlusion: the CPU occlusion image (128x72 R32_FLOAT) gets a far-plane stand-in instead of the gray one (DARNER_OCCLUSION_FAR=0: off) occlusion: the far-plane stand-in took the CPU occlusion image's slot (1 so far; DARNER_OCCLUSION_FAR=0: off) ``` - Gates run on that revision: gate 1 and gate 2; gate 3 as noted above (descriptor::host only). - Gameplay, when relevant: RX 9070 XT 16 GB, Adrenalin 32.0.32029.2010, i5-13600KF, 32 GB RAM, Windows 11; Series S profile, 720 render → 1440 output, FSR 4 Quality, FSR 4 frame generation 2x, textures High, ray tracing off, 30 fps cap. - Shader wave sizes tested: not relevant. - Hardware dependence: likely general (the image is the title's, not the card's); tested on one AMD card only. - Coverage gaps: no A/B of the visible flicker; the neutralized slot was seen once at start here, so a scene where it happens repeatedly is untested. ## 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 `main`. - [x] The diff follows `docs/asset-policy.md`. - [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: #245 (stand-in texture allocation retries, same file), #231 (descriptor writes, same file), #307 (diagnostics in the same file), #292 (constant buffer reads, same file), #220 (`resource.rs`). - Replaces or overlaps: none found (no open PR gives the occlusion image a stand-in).
co11ector changed title from Give the CPU occlusion image a far-plane stand-in where its view is not made (DARNER_OCCLUSION_FAR, on) to [pr-fix][rendering][AMD] The CPU occlusion image gets a far-plane stand-in where its view is not made (DARNER_OCCLUSION_FAR, on) 2026-12-04 15:18:06 +00:00
co11ector changed title from [pr-fix][rendering][AMD] The CPU occlusion image gets a far-plane stand-in where its view is not made (DARNER_OCCLUSION_FAR, on) to [pr-fix][rendering] The CPU occlusion image gets a far-plane stand-in where its view is not made (DARNER_OCCLUSION_FAR, on) 2026-12-04 15:22:31 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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 origin '+refs/pull/335/head:co11ector/occlusion-far'
git switch 'co11ector/occlusion-far'

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 'main'
git merge --no-ff 'co11ector/occlusion-far'
git switch 'co11ector/occlusion-far'
git rebase 'main'
git switch 'main'
git merge --ff-only 'co11ector/occlusion-far'
git switch 'co11ector/occlusion-far'
git rebase 'main'
git switch 'main'
git merge --no-ff 'co11ector/occlusion-far'
git switch 'main'
git merge --squash 'co11ector/occlusion-far'
git switch 'main'
git merge --ff-only 'co11ector/occlusion-far'
git switch 'main'
git merge 'co11ector/occlusion-far'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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!335
No description provided.