Specialize typed buffers for direct compute dispatches #239
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!239
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-239"
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?
@NemesisDawn on GitHub · 2026-11-23 06:40 UTC · original
NemesisDawn:issue105-compute-review→main· +1111 −52 · 14 files · 1 commits · draftAdds opt-in typed buffer format selection for direct compute dispatches.
The runtime selects the matching integer pipeline, caches it for reuse,
and restores the original pipeline after dispatch.
Validation: Three targeted WARP shader tests passed. The RTX 5080 test
verified unsigned and signed writes, cache reuse, and pipeline restoration.
Disabled by default. Graphics and indirect dispatch remain outside this change.
Refs #105.
@kiwe147 on GitHub · 2026-11-23 19:15 UTC · original
Tested head
8bb728c922, applied withgit apply(whitespace ignored, the line endings of my checkout differ) onmainf89e410, this PR alone. It applied without conflicts and built.Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, NVIDIA GeForce RTX 3080 (driver 621.24), MSVC, Rust 1.91.1.
tombox-xshaderfast set and the tests this PR adds inexec(WARP andTOMBOX_EXEC_HW=1)d3d12_xs --lib -- --test-threads=1main: the console-dump fixture test needs console DLLs)hw_issue105_compute_switches_and_restores_pipeline, plainhw_ -- --ignoredTOMBOX_TBUF_COMPUTE=1and thenTOMBOX_PSO_ASYNC=0TOMBOX_TBUF_COMPUTE=1 TOMBOX_PSO_ASYNC=0One crash with the switches on. With both variables set, the full
hw_run ends withSTATUS_ACCESS_VIOLATIONathw_tests::device_place_hw::hw_structured_uav_on_a_sub_page_uav_buffer_keeps_the_device. Onmainwith the same variables that test passes. It also passes with this PR alone. The pair reproduces it, 3 of 3 runs:The new test passes and the next test in the same process crashes, so I think the new test leaves state behind (for example in
tbuf_compute). I did not trace it further. Without the switches nohw_test crashes (53 passed; 10 failed: the 9upload_ww_hwtests, which need the built xg_xs/xg_x dll and fail the same onmain, plus the new test above).AI-assisted: yes (Claude Code)
@omonkeyz on GitHub · 2026-11-25 13:51 UTC · original
Thanks. Before this can be applied: kiwe147's repro (TOMBOX_TBUF_COMPUTE=1 TOMBOX_PSO_ASYNC=0 cargo test -p d3d12_xs --lib -- --ignored --test-threads=1 hw_issue105 hw_structured_uav_on_a_sub_page_uav_buffer_keeps_the_device) crashes the test after yours 3 of 3 times, so some state outlives the test. Two things to check: install() overwrites NEXT[idx] with whatever is in the slot, so a second install chains the hook to itself; and Plan keeps the device pointer without AddRef. Please also make the hw test skip (not fail) when the variables are not set, and mark the PR ready when done.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.