d3d12: support R9G9B9E5_SHAREDEXP & B5G5R5A1_UNORM UAVs via castable formats #188

Manually merged
github merged 2 commits from gh-pr/188/head into gh-pr/188/base 2026-11-26 06:37:12 +00:00
Owner

@⁠Vladimir-Human on GitHub · 2026-11-25 18:39 UTC · original
Vladimir-Human:d3d12/geforce-r9g9b9e5-uav → main · +2334 −53 · 14 files · 2 commits · merged 2026-11-25 19:20 UTC

AI-assisted PR.

Summary

Adds native-gated castable-format UAV support for DXGI_FORMAT_R9G9B9E5_SHAREDEXP (aliased to R32_UINT) and DXGI_FORMAT_B5G5R5A1_UNORM (aliased to R16_UINT) so typed UAVs on packed formats work cleanly on GPUs without native typed UAV support for those formats (for example NVIDIA GeForce 10de:2783 where yped_uav: R9G9B9E5=0 B5G5R5A1=0), while preserving the native path on adapters/drivers that support them directly (such as WARP 1414:008c).

Key Changes

  • Native adapter gating: Checks native typed-UAV capability across resource creation, heap allocation, placement, reserved resources, memory copies, and UAV view creation (
    untime/d3d12/src/device/dxgi.rs, llocation.rs,
    esources.rs, heap.rs, placement.rs,
    eserved.rs, copy_memory.rs, iews.rs).
  • Castable legacy-timeline creation: Uses D3D12_BARRIER_LAYOUT_COMMON resource creation combined with lazy per-device legacy InitTransition (COMMON -> host_initial when non-COMMON and non-simultaneous), keeping COPY-queue copies, implicit promotion/decay after UAV -> COMMON, reserved resources, placed aliased resources, and SIMULTANEOUS_ACCESS|UAV on D3D12's native legacy state timeline.
  • Buffer & null UAV handling: Handles non-null buffer typed UAVs before yte_view and native CreateUnorderedAccessView ( iews/creation.rs, iews/addressed.rs).
  • Tests: Added regression and live GPU/WARP allocation & view tests ( ests/device/allocation.rs, ests/device/allocation_regressions.rs, ests/device/views.rs).

Verification (91a9de2f37)

  • python -m unittest tests.test_repository_hygiene -v: 4/4 PASS
  • cargo test --manifest-path runtime/d3d12/Cargo.toml: 119 passed, 0 failed, 0 warnings (incl. device::allocation 8/8 PASS)
  • python build.py bvh & python build.py lanes: PASS
  • uild/lanes/lanes.exe --adapter 10de:2783 --selftest all: 12/12 PASS
  • uild/d3d12-smoke/d3d12-features.exe & d3d12-tables.exe (--adapter 10de:2783): PASS
  • Verified under D3D12 Debug Layer on RTX 4070 SUPER (10de:2783) and WARP (1414:008c): 0 unexpected errors/warnings.
  • Verified clean git merge-tree --write-tree against main (4cb6a4a), PR #185, and PR #186.
**@⁠Vladimir-Human** on GitHub · 2026-11-25 18:39 UTC · [original](https://github.com/brcly/TuxBox/pull/188) `Vladimir-Human:d3d12/geforce-r9g9b9e5-uav` → `main` · +2334 −53 · 14 files · 2 commits · merged 2026-11-25 19:20 UTC AI-assisted PR. ### Summary Adds native-gated castable-format UAV support for DXGI_FORMAT_R9G9B9E5_SHAREDEXP (aliased to R32_UINT) and DXGI_FORMAT_B5G5R5A1_UNORM (aliased to R16_UINT) so typed UAVs on packed formats work cleanly on GPUs without native typed UAV support for those formats (for example NVIDIA GeForce 10de:2783 where yped_uav: R9G9B9E5=0 B5G5R5A1=0), while preserving the native path on adapters/drivers that support them directly (such as WARP 1414:008c). ### Key Changes - **Native adapter gating**: Checks native typed-UAV capability across resource creation, heap allocation, placement, reserved resources, memory copies, and UAV view creation ( untime/d3d12/src/device/dxgi.rs, llocation.rs, esources.rs, heap.rs, placement.rs, eserved.rs, copy_memory.rs, iews.rs). - **Castable legacy-timeline creation**: Uses D3D12_BARRIER_LAYOUT_COMMON resource creation combined with lazy per-device legacy InitTransition (COMMON -> host_initial when non-COMMON and non-simultaneous), keeping COPY-queue copies, implicit promotion/decay after UAV -> COMMON, reserved resources, placed aliased resources, and SIMULTANEOUS_ACCESS|UAV on D3D12's native legacy state timeline. - **Buffer & null UAV handling**: Handles non-null buffer typed UAVs before yte_view and native CreateUnorderedAccessView ( iews/creation.rs, iews/addressed.rs). - **Tests**: Added regression and live GPU/WARP allocation & view tests ( ests/device/allocation.rs, ests/device/allocation_regressions.rs, ests/device/views.rs). ### Verification (91a9de2f3783cfad71fff1950abd3dc5fa2632bf) - python -m unittest tests.test_repository_hygiene -v: 4/4 PASS - cargo test --manifest-path runtime/d3d12/Cargo.toml: 119 passed, 0 failed, 0 warnings (incl. device::allocation 8/8 PASS) - python build.py bvh & python build.py lanes: PASS - uild/lanes/lanes.exe --adapter 10de:2783 --selftest all: 12/12 PASS - uild/d3d12-smoke/d3d12-features.exe & d3d12-tables.exe (--adapter 10de:2783): PASS - Verified under D3D12 Debug Layer on RTX 4070 SUPER (10de:2783) and WARP (1414:008c): 0 unexpected errors/warnings. - Verified clean git merge-tree --write-tree against main (4cb6a4a), PR #185, and PR #186.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:37:11 +00:00
github manually merged commit 91a9de2f37 into gh-pr/188/base 2026-11-26 06:37:12 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.