d3d12, dxbc: convert slot 80 thread-dimension dispatches using bound PSO numthreads #170
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!170
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/170/head"
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?
@Vladimir-Human on GitHub · 2026-11-25 12:58 UTC · original
Vladimir-Human:d3d12/slot80-thread-dimensions→main· +517 −28 · 10 files · 1 commits · merged 2026-11-25 14:21 UTCRefs #164
Summary
Handle
COMPUTE_DISPATCH_INITIATOR__USE_THREAD_DIMENSIONS(0x20) in command-list slot 80 (dispatch_flagged):tuxbox-dxbc(runtime/dxbc/src/fspx.rs,runtime/dxbc/src/lib.rs): addshader_compute_threadsto extract[numthreads(x, y, z)]from compute DXBC containers (PSV0, SM4/5SHEXdcl_thread_groupskippingCUSTOMDATA, and XboxXDAT/FSSMcompute preambles undernative-bindings), plus unit tests.tuxbox-d3d12(runtime/d3d12/src/device/compute.rs,device/stream.rs,commands/compute_bindings.rs,commands/compute.rs,commands.rs):compute_threads: Option<[u32; 3]>on slot 62 (create_pipeline_x) and slot 86 (stream::create) compute pipelines (includingnull_compute/null_pipelinestand-ins), and track it on the command list's bound pipeline acrossCreateCommandListX,Reset,SetPipelineState, andClearState.dispatch_flagged, convertflags & 0x20thread counts toceil(t / g)groups via overflow-safeu32::div_ceil(0 -> 0), keep0x0/0x8000(CS_W32_EN) dispatches as group counts, fail closed (E_INVALIDARG/E_NOTIMPL+ diagnostic) when0x20is set without known[numthreads], and log once on partial boundary round-ups (t % g != 0) because desktopDispatchdoes not mask surplus boundary threads without altering shader/root ABIs.examples/lanes/selftest.cpp,examples/lanes/README.md,project_tuxbox/verify.py): addthread-dimensions(lanes-selftest-thread-dimensions) covering slot 62 + slot 86 PSOs,Reset/SetPipelineState/ClearState, fail-closed missing/cleared PSO refusal,0x20/0x8020exact guard preservation,x=70000(> 65535group limit) scaling,13partial threads,0threads, and group-mode (0x0,0x8000) dispatches.Verified on Lanes
python tuxbox.py checkpassed on this branch (not fully runnable on native Windows before MSVC/verify fixes in #169:buffer_import_guest.cppfails/W4 /WX,verify.pyfails on MSVC#ordinalimports,tests/hits Linux-onlyfcntl/os.sched_getaffinityerrors, andlanes-shader-cacheis Proton-only; equivalent Rust CI checks, Windows-compatible Python tests, provider/Lanes build, and directlanes.exeGPU runs passed below)thread-dimensionsinexamples/lanes/selftest.cppandlanes-selftest-thread-dimensionsinproject_tuxbox/verify.py)GPU, driver and backend: NVIDIA GeForce RTX 4070 SUPER (
pci=10de:2783), NVIDIA driver32.0.16.2114, Windows 11 native backend (MSVC19.44.35207, Windows SDK10.0.26100.0DXC, Rust1.95.0).Paste the summary printed at the end:
Checks
cargo test --locked -p tuxbox-dxbc --features native-bindings: 55 passed, 0 failedcargo test --locked -p tuxbox-d3d12: 99 passed, 0 failedcargo test --locked -p tuxbox-xg-layout: 14 passed, 0 failedcargo test --locked --manifest-path tools/shader-compiler/Cargo.toml: 279 unit + 2 integration passed, 0 failedcargo check --locked --target x86_64-pc-windows-msvc -p tuxbox-d3d12 -p tuxbox-bvh: exit 0python -m unittest tests.test_check tests.test_verify tests.test_repository_hygiene tests.test_cli tests.test_d3d12_regressions tests.test_d3d12_status tests.test_package_binaries tests.test_build_msvc tests.test_inspect -v: 46 ran, 45 ok, 1 skipped (test_case_collisionon Windows case-insensitive filesystem)cl /W4 /WXonexamples/lanes/selftest.cpp: 0 warnings, exit 0AI-assisted implementation and verification.