Fix D3D12 frame and texture handling #69

Manually merged
github merged 1 commit from gh-pr/69/head into gh-pr/69/base 2026-11-26 04:07:53 +00:00
Owner

@⁠Tems-py on GitHub · 2026-11-22 23:33 UTC · original
Tems-py:fix/d3d12-frame-and-texture-handling → main · +86 −49 · 5 files · 1 commits · merged 2026-11-23 09:59 UTC

Summary

  • Bind the selected private D3D12 view heap for local descriptor indices and retain the shared heap for shared indices.
  • Preserve placed texture identities in aliasing barriers and remove resource tracking on final release.
  • Queue the PresentX copy before reporting the flip, retain its source until the copy fence completes, and skip allocator reuse when the fence wait times out.
  • Serialize texture refreshes and preserve pending CPU writes when registering textures.
**@⁠Tems-py** on GitHub · 2026-11-22 23:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/69) `Tems-py:fix/d3d12-frame-and-texture-handling` → `main` · +86 −49 · 5 files · 1 commits · merged 2026-11-23 09:59 UTC ## Summary - Bind the selected private D3D12 view heap for local descriptor indices and retain the shared heap for shared indices. - Preserve placed texture identities in aliasing barriers and remove resource tracking on final release. - Queue the PresentX copy before reporting the flip, retain its source until the copy fence completes, and skip allocator reuse when the fence wait times out. - Serialize texture refreshes and preserve pending CPU writes when registering textures.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:07:51 +00:00
github manually merged commit 21e42cf75c into gh-pr/69/base 2026-11-26 04:07:53 +00:00
Author
Owner

@⁠Tems-py on GitHub · 2026-11-22 23:37 UTC · original

obraz fixes flicker on intel arc
**@⁠Tems-py** on GitHub · 2026-11-22 23:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/69#issuecomment-7087717560) <img width="1792" height="1084" alt="obraz" src="https://github.com/user-attachments/assets/abd88af3-bab6-4941-b728-53b67f004e61" /> fixes flicker on intel arc
Author
Owner

@⁠Foniass on GitHub · 2026-11-23 02:39 UTC · original

For the reviewer, since #84 touches the same problem: on NVIDIA the shared shader-visible heap holds 1 000 000 view descriptors. Minecraft's eight view heaps need 1 179 632, so the last two got no range in it, and their draws read other heaps' slots (blank frames). This PR's first item binds such a heap separately. #84 gives every view heap its place in the shared heap a page at a time instead, so no heap is left out, and draws that mix descriptors from several heaps keep working.

The two don't fight: with #84 every view heap is in the shared heap, so the pc_heaps change here never has a private heap to pick. They merge cleanly, and main + #84 + #86 + #68 + #67 + this PR passes the full test suite on an RTX 5070 Ti. The rest of this PR (aliasing barriers, PresentX ordering, texture refresh) is independent of #84.

Intel Arc: if its MaxViewDescriptorHeapSize is also 1 000 000, #84 alone should fix the flicker there too. Not tested, there's no Arc here.

**@⁠Foniass** on GitHub · 2026-11-23 02:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/69#issuecomment-7090107940) For the reviewer, since #84 touches the same problem: on NVIDIA the shared shader-visible heap holds 1 000 000 view descriptors. Minecraft's eight view heaps need 1 179 632, so the last two got no range in it, and their draws read other heaps' slots (blank frames). This PR's first item binds such a heap separately. #84 gives every view heap its place in the shared heap a page at a time instead, so no heap is left out, and draws that mix descriptors from several heaps keep working. The two don't fight: with #84 every view heap is in the shared heap, so the `pc_heaps` change here never has a private heap to pick. They merge cleanly, and `main` + #84 + #86 + #68 + #67 + this PR passes the full test suite on an RTX 5070 Ti. The rest of this PR (aliasing barriers, PresentX ordering, texture refresh) is independent of #84. Intel Arc: if its `MaxViewDescriptorHeapSize` is also 1 000 000, #84 alone should fix the flicker there too. Not tested, there's no Arc here.
Author
Owner

@⁠ivall on GitHub · 2026-11-23 09:59 UTC · original

Merged. Checked on an RX 9070 (RDNA4): cargo test --workspace with the retail samples (shader pack, console DLLs, texture archive) – natively, and with XCL_SPLIT_WAVE64=1 (new in ba905cf: forces the split wave64 form on RDNA, which runs both wave sizes, so the NVIDIA path can be checked on AMD). XDefiant (title screen correct, 6 299 translated pipelines, 0 translation errors), Minecraft and Unicorn Overlord run.

One change on top (593a237): with #84 every view heap goes into the shared heap and is created CPU-only, so a heap that found no room there is a non-shader-visible PC heap – binding it in pc_heaps would be invalid. A title's own view heap is now bound only when it is shader visible; otherwise the shared heap stays bound, as before.

**@⁠ivall** on GitHub · 2026-11-23 09:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/69#issuecomment-7097359457) Merged. Checked on an RX 9070 (RDNA4): `cargo test --workspace` with the retail samples (shader pack, console DLLs, texture archive) – natively, and with `XCL_SPLIT_WAVE64=1` (new in ba905cf: forces the split wave64 form on RDNA, which runs both wave sizes, so the NVIDIA path can be checked on AMD). XDefiant (title screen correct, 6 299 translated pipelines, 0 translation errors), Minecraft and Unicorn Overlord run. One change on top (593a237): with #84 every view heap goes into the shared heap and is created CPU-only, so a heap that found no room there is a non-shader-visible PC heap – binding it in `pc_heaps` would be invalid. A title's own view heap is now bound only when it is shader visible; otherwise the shared heap stays bound, as before.
This discussion has been locked. Commenting is limited to contributors.
No description provided.