Resolve distance-dependent black shoreline rendering #4

Open
opened 2026-12-06 00:19:56 +00:00 by github-bot · 0 comments
Owner

@⁠VictoryX-dev on GitHub · 2026-12-03 02:57 UTC · original

Problem

Certain shoreline surfaces appear normal from a distance but turn black when the camera approaches closely.

Known Evidence

  • Confirmed in gameplay: Distance-dependent shoreline blackening remains reproducible in Series S gameplay checkpoints.
  • Experimental / Synthetic fixtures (off by default, unmeasured in gameplay):
    • VICTORY_DEPTH_READ_SAMPLED=1 (draw.rs, draw/depth_read_state_tests.rs): transitions read-only depth planes sampled by shaders to D3D12_RESOURCE_STATE_DEPTH_READ | D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE (or non-pixel equivalent) so AMD HTILE decompresses before shader sampling. On an RX 9070 XT synthetic fixture, enabling the switch restored the expected sampled depth (z = 0.875 vs corrupted 0.373 without it), and all 22 depth state fixtures pass both off and on.
    • VICTORY_CARD_LEVELS=3 (diagnostics builds only, texture/levels.rs): secondary hypothesis investigating textures grown on the GPU (lower mips copied on-card while higher mips stream into title memory and appear via widened SRVs).
  • Engineering target: Correct shoreline rendering at all camera distances across AMD, NVIDIA and Intel GPUs.

Approaches That Did Not Work

  • VICTORY_CARD_LEVELS=2 (kept off): Uploading all non-card-written subresources unconditionally risks copying foreign bytes from reused title memory on textures that were never widened by the title.

Relevant Source Modules

  • runtime/crates/victory-gpu/src/draw.rs
  • runtime/crates/victory-gpu/src/draw/depth_read_state_tests.rs
  • runtime/crates/victory-gpu/src/texture/levels.rs
  • runtime/crates/victory-gpu/src/texture/levels_tests.rs
  • runtime/crates/victory-gpu/src/resource.rs
  • runtime/crates/victory-gpu/src/descriptor.rs

Expected Contribution

  • Validate VICTORY_DEPTH_READ_SAMPLED=1 in gameplay checkpoints (both visually on close-up shorelines and for frame-time/barrier overhead via VICTORY_AB=20,VICTORY_DEPTH_READ_SAMPLED).
  • If shoreline blackening persists with VICTORY_DEPTH_READ_SAMPLED=1, inspect material bindings, depth/stencil plane separation and widened-SRV texture mip growth (VICTORY_CARD_LEVELS=3) and build a synthetic fixture reproducing the remaining failure path.

Acceptance Criteria

  • Close-up and distant shoreline rendering verified correct in gameplay without visual regressions elsewhere.
  • All depth-state and texture-level synthetic fixtures pass with D3D12 debug validation clean.
  • Any promoted barrier/state change is measured for performance impact in a release-package run.
**@⁠VictoryX-dev** on GitHub · 2026-12-03 02:57 UTC · [original](https://github.com/VictoryX-dev/VictoryX/issues/4) ## Problem Certain shoreline surfaces appear normal from a distance but turn black when the camera approaches closely. ## Known Evidence - **Confirmed in gameplay:** Distance-dependent shoreline blackening remains reproducible in Series S gameplay checkpoints. - **Experimental / Synthetic fixtures (off by default, unmeasured in gameplay):** - `VICTORY_DEPTH_READ_SAMPLED=1` (`draw.rs`, `draw/depth_read_state_tests.rs`): transitions read-only depth planes sampled by shaders to `D3D12_RESOURCE_STATE_DEPTH_READ | D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE` (or non-pixel equivalent) so AMD HTILE decompresses before shader sampling. On an RX 9070 XT synthetic fixture, enabling the switch restored the expected sampled depth (`z = 0.875` vs corrupted `0.373` without it), and all 22 depth state fixtures pass both off and on. - `VICTORY_CARD_LEVELS=3` (diagnostics builds only, `texture/levels.rs`): secondary hypothesis investigating textures grown on the GPU (lower mips copied on-card while higher mips stream into title memory and appear via widened SRVs). - **Engineering target:** Correct shoreline rendering at all camera distances across AMD, NVIDIA and Intel GPUs. ## Approaches That Did Not Work - **`VICTORY_CARD_LEVELS=2` (kept off):** Uploading all non-card-written subresources unconditionally risks copying foreign bytes from reused title memory on textures that were never widened by the title. ## Relevant Source Modules - `runtime/crates/victory-gpu/src/draw.rs` - `runtime/crates/victory-gpu/src/draw/depth_read_state_tests.rs` - `runtime/crates/victory-gpu/src/texture/levels.rs` - `runtime/crates/victory-gpu/src/texture/levels_tests.rs` - `runtime/crates/victory-gpu/src/resource.rs` - `runtime/crates/victory-gpu/src/descriptor.rs` ## Expected Contribution - Validate `VICTORY_DEPTH_READ_SAMPLED=1` in gameplay checkpoints (both visually on close-up shorelines and for frame-time/barrier overhead via `VICTORY_AB=20,VICTORY_DEPTH_READ_SAMPLED`). - If shoreline blackening persists with `VICTORY_DEPTH_READ_SAMPLED=1`, inspect material bindings, depth/stencil plane separation and widened-SRV texture mip growth (`VICTORY_CARD_LEVELS=3`) and build a synthetic fixture reproducing the remaining failure path. ## Acceptance Criteria - [ ] Close-up and distant shoreline rendering verified correct in gameplay without visual regressions elsewhere. - [ ] All depth-state and texture-level synthetic fixtures pass with D3D12 debug validation clean. - [ ] Any promoted barrier/state change is measured for performance impact in a release-package run.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-06 00:19:56 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
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
github/VictoryX-dev--VictoryX#4
No description provided.