D3D12.X: resolve GPU-view CBVs, accept typeless sky domes, and add pre-sky fallback in ambient #2727

Open
github-bot wants to merge 1 commit from github-bot/gh-2727 into amd-dev AGit
Owner

@⁠Saksukella on GitHub · 2026-11-26 08:59 UTC · original
Saksukella:fix/ambient-sky-cbv-fallback → amd-dev · +65 −17 · 2 files · 1 commits · open

What is in it

  • crates/xcl/src/hle/d3d12x/ambient.rs:
    • is_sky_dome_target: accept DXGI_FORMAT_R16G16B16A16_TYPELESS alongside DXGI_FORMAT_R16G16B16A16_FLOAT (both are copy-compatible with ad.sky_copy R16G16B16A16_FLOAT).
    • AMBIENT_FILL_HLSL + after_compute_dispatch: pass sky_ready and cfg.least in the constant buffer so PassRole::TemporalResolve can still populate a floor ambient level before the first sky-dome capture instead of returning early (while PassRole::ReflectionHistory still waits for sky_ready).
    • resolve_cbv_va + scan_cbv_indices + find_dispatch_views: resolve GPU-view (PAGE_NOACCESS) CBV virtual addresses through kernelx::mirrors::mapped_source / mirrors::source before reading bindless descriptor indices, and scan all 64 slots (up from 32) in Param::Table for CBV V# descriptors.
    • Add rate-limited diagnostic logs for skipped list type, missing root-signature layout, and unsupported typed UAV load on ReflectionHistory.
    • Expose is_ambient_compute(blob) and extend ambient::tests (sky_dome_filter_rejects_r11g11b10_and_wrong_sizes + D3DCompile check on updated AMBIENT_FILL_HLSL).
  • crates/xcl/src/hle/d3d12x/real.rs:
    • Exclude stand-in ambient compute shaders (ambient::is_ambient_compute) from SubmitFlags::spared so CS_ScreenProbes_TemporalResolve and CS_UpdateHistory are not skipped as image-only compute shaders while building.
  • Target branch: amd-dev (where ambient.rs lives).

Tested

  • Hardware: AMD Radeon RX 9070 XT (driver 32.0.32029.2010), 24-thread x86_64 CPU, 32 GB RAM, Windows; rustc 1.100.0 (0ef1bc386 2026-11-09); debug (tests) and release (xcl.exe).
  • cargo test -p xcl --lib ambient::tests: 5 passed, 0 failed (0.03s, including sm5_ambient_hlsl_shaders_compile_cleanly via D3DCompile).

Regression run

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: AMD Radeon RX 9070 XT
title: b8db18c2
seconds: 60
exit: 0x0
frames shown: 1624 (PresentX 1624)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 19700 MB
xcl-smoke v1
commit: c0f5f3fa2251df0900b8e9e5b00acfb1d63637c8
gpu: AMD Radeon RX 9070 XT
title: b8db18c2
seconds: 60
exit: 0x0
frames shown: 1671 (PresentX 1671)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16063 MB

Not tested

  • NVIDIA and Intel GPU adapters (tested on AMD Radeon RX 9070 XT only).

AI use

  • Antigravity + Gemini (web-server-mcp agent team): assisted with auditing ambient.rs and real.rs, diagnosing why stand-in ambient dispatches did not fire, implementing the fixes and tests, and running local tests and smoke verification. All diffs and measurements were verified locally on hardware.
**@⁠Saksukella** on GitHub · 2026-11-26 08:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/2727) `Saksukella:fix/ambient-sky-cbv-fallback` → `amd-dev` · +65 −17 · 2 files · 1 commits · open **What is in it** - `crates/xcl/src/hle/d3d12x/ambient.rs`: - `is_sky_dome_target`: accept `DXGI_FORMAT_R16G16B16A16_TYPELESS` alongside `DXGI_FORMAT_R16G16B16A16_FLOAT` (both are copy-compatible with `ad.sky_copy` `R16G16B16A16_FLOAT`). - `AMBIENT_FILL_HLSL` + `after_compute_dispatch`: pass `sky_ready` and `cfg.least` in the constant buffer so `PassRole::TemporalResolve` can still populate a floor ambient level before the first sky-dome capture instead of returning early (while `PassRole::ReflectionHistory` still waits for `sky_ready`). - `resolve_cbv_va` + `scan_cbv_indices` + `find_dispatch_views`: resolve GPU-view (`PAGE_NOACCESS`) CBV virtual addresses through `kernelx::mirrors::mapped_source` / `mirrors::source` before reading bindless descriptor indices, and scan all 64 slots (up from 32) in `Param::Table` for CBV `V#` descriptors. - Add rate-limited diagnostic logs for skipped list type, missing root-signature layout, and unsupported typed UAV load on `ReflectionHistory`. - Expose `is_ambient_compute(blob)` and extend `ambient::tests` (`sky_dome_filter_rejects_r11g11b10_and_wrong_sizes` + D3DCompile check on updated `AMBIENT_FILL_HLSL`). - `crates/xcl/src/hle/d3d12x/real.rs`: - Exclude stand-in ambient compute shaders (`ambient::is_ambient_compute`) from `SubmitFlags::spared` so `CS_ScreenProbes_TemporalResolve` and `CS_UpdateHistory` are not skipped as image-only compute shaders while building. - Target branch: `amd-dev` (where `ambient.rs` lives). **Tested** - Hardware: AMD Radeon RX 9070 XT (driver `32.0.32029.2010`), 24-thread x86_64 CPU, 32 GB RAM, Windows; `rustc 1.100.0 (0ef1bc386 2026-11-09)`; debug (tests) and release (`xcl.exe`). - `cargo test -p xcl --lib ambient::tests`: 5 passed, 0 failed (`0.03s`, including `sm5_ambient_hlsl_shaders_compile_cleanly` via `D3DCompile`). **Regression run** ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: AMD Radeon RX 9070 XT title: b8db18c2 seconds: 60 exit: 0x0 frames shown: 1624 (PresentX 1624) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 19700 MB ``` ``` xcl-smoke v1 commit: c0f5f3fa2251df0900b8e9e5b00acfb1d63637c8 gpu: AMD Radeon RX 9070 XT title: b8db18c2 seconds: 60 exit: 0x0 frames shown: 1671 (PresentX 1671) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16063 MB ``` **Not tested** - NVIDIA and Intel GPU adapters (tested on AMD Radeon RX 9070 XT only). **AI use** - Antigravity + Gemini (`web-server-mcp` agent team): assisted with auditing `ambient.rs` and `real.rs`, diagnosing why stand-in ambient dispatches did not fire, implementing the fixes and tests, and running local tests and smoke verification. All diffs and measurements were verified locally on hardware.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:04:39 +00:00
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 origin '+refs/pull/2727/head:github-bot/gh-2727'
git switch 'github-bot/gh-2727'

Merge

Merge the changes and update on Forgejo.
git switch 'amd-dev'
git merge --no-ff 'github-bot/gh-2727'
git switch 'github-bot/gh-2727'
git rebase 'amd-dev'
git switch 'amd-dev'
git merge --ff-only 'github-bot/gh-2727'
git switch 'github-bot/gh-2727'
git rebase 'amd-dev'
git switch 'amd-dev'
git merge --no-ff 'github-bot/gh-2727'
git switch 'amd-dev'
git merge --squash 'github-bot/gh-2727'
git switch 'amd-dev'
git merge --ff-only 'github-bot/gh-2727'
git switch 'amd-dev'
git merge 'github-bot/gh-2727'
git push origin 'amd-dev'
This discussion has been locked. Commenting is limited to contributors.
No description provided.