descriptor/host: default to PORTABLE_VIEWS (1M) so AMD GPUs match replacement shader heap slots #676
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!676
Loading…
Reference in a new issue
No description provided.
Delete branch "ggwp/Darner:fix/amd-portable-views"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Contributor role (optional)
What it changes
The problem on
post-merge: On Tier 3 AMD GPUs (tested on AMD Radeon 8060S / RDNA 3.5),probe_view_limit()allocatesUNCAPPED_VIEWS(1 << 21= 2,097,152) instead ofPORTABLE_VIEWS(1,000,000). That placesview_title_limitat1,703,934,HEAP_VIEW_SLOT(dynamic_base) at1,703,935, single/staged descriptors at1,703,935..2,097,150, andview_heap_limitat2,097,151.However, the precompiled replacement shaders in
shaders/replace/(85.hlsl+trace_shadow_rays.hlsli) hardcode the 1MPORTABLE_VIEWSheap layout:min(..., 999999u)— clamping every single/staged view on AMD down to slot999,999(in the middle of AMD's title descriptor region).HEAP_VIEW_SLOT = 606783u— reading placedtable_cbvrows from slot606,783instead of1,703,935.min(..., 606782u)— clamping title bindless indices>= 606,782to a non-null slot on AMD.As a result, dynamically translated geometry/sky/fog/emissive shaders render, while lighting, shadows, and RTGI replacement shaders read/write invalid slots and leave opaque surfaces pitch black.
Fix: Default
probe_view_limit()toPORTABLE_VIEWS(1,000,000) on all hosts via a testable helperselect_view_heap_size(), withDARNER_UNCAPPED_VIEWS=1kept as an opt-in switch for A/B testing. Added unit tests pinning thatPORTABLE_VIEWSproduces606_782/606_783/999_999and that the default path does not allocate an uncapped probe heap.it affects every AMD GPU (RDNA 1 / 2 / 3 / 3.5 / 4 — RX 5000, 6000, 7000, 8000S/800M, 9000) and likely Intel Arc too, not just RDNA 3.5.
Here's why:
• NVIDIA caps shader-visible CBV/SRV/UAV descriptor heaps at 1,000,000 in its D3D12 driver, so fits(1 << 21) returns false and NVIDIA always takes PORTABLE_VIEWS (1,000,000) — matching the hardcoded 606782u / 606783u / 999999u constants in shaders/replace/.
• AMD (all Tier 3 RDNA GPUs, including RDNA 2/3/3.5/4 — the comment in wt-darner-post-merge/crates/darner-gpu/src/descriptor/host.rs:217-220 even notes UNCAPPED_VIEWS was added for an RDNA 3 RX 7900 XT) and Intel Arc allow CreateDescriptorHeap with 2,097,152 (1 << 21) descriptors, so fits(UNCAPPED_VIEWS) returns true and every one of them shifts dynamic/staged views to 1,703,935..2,097,150 — breaking all 85 replacement shaders in the exact same way.
How it was tested
Tested revision:
6e96150(based onpost-merge28a9b42)Commands and results:
cargo test --offline -p darner-gpu descriptor::host::tests— 2 passed, 0 failedcargo clippy --offline -p darner-gpu --tests— 0 new warningscargo build --offline --release -p darner— succeededChanges a default: yes, for Tier 3 GPUs whose D3D12 driver accepts
1 << 21shader-visible CBV/SRV/UAV descriptors (AMD). No change on NVIDIA or other cards already capped atPORTABLE_VIEWS(1,000,000).A/B result on AMD Radeon 8060S (RDNA 3.5), Series X profile, 2560x1440, title upscaler (
DLSS: OFF),RAY TRACING: HARDWARE,FG: OFF:UNCAPPED_VIEWS2M)PORTABLE_VIEWS1M)Checks run on that revision:
cargo test,cargo clippy,cargo build --release(all passed).Gameplay: AMD Radeon 8060S (64 GB), Series X, 2560x1440, upscaler off (title upscaler), frame gen off, ray tracing hardware.
Hardware dependence: Affects Tier 3 GPUs that accept
> 1,000,000shader-visible descriptors (AMD RDNA). No behavioral change on NVIDIA.Coverage gaps: Untested on other AMD RDNA generations (RDNA 2 / RDNA 3 / RDNA 4) and Intel Arc, though all share the same
probe_view_limit()path and embeddedshaders/replace/constants.Checklist
post-merge.Checked for overlap
[pr-fix][rendering][AMD] descriptor/host: default to PORTABLE_VIEWS (1M) so AMD GPUs match replacement shader heap slotsto descriptor/host: default to PORTABLE_VIEWS (1M) so AMD GPUs match replacement shader heap slotsView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.