You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
startup: bind default sampler heap for sampler-heap-indexed roots - #1685
Sets a default sampler heap on the desktop list before a title root signature that indexes the sampler heap is set (debug layer message ID 1419).
What and why
The desktop command list never receives the title's heaps (list slot 32 only records the sampler source). A title root signature created with D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED was set by slot 34 with no sampler heap bound.
CreateRootSignature now records the root signature flags. When slot 34 sets a flagged root signature on a list with no sampler heap bound, one shared one-entry shader-visible sampler heap per device is bound first (keeping the view heap a translated draw already bound). A sampler heap already bound is never replaced, and Reset() / Close() clear the per-list Pass state so subsequent frames re-bind cleanly. One rate-limited log line (at most 4).
Docs: docs/startup-runtime.md and docs/experiments.md.
Not covered
The translated root signature is created with no flags, so the 43 translated-draw and 2 pipeline-creation messages from the P0: main executable startup progress #870 reports are not explained by this change and are not claimed fixed.
Verification
Linux checks (at 5dbd2711ba5af3f592ce83e4f4456a61fc0c5e06):
ctest --preset dev -R '^(startup_root_sampler_heap_warp|startup_sampler_heap_warp|startup_sampler_heap_wrapped_warp|startup_sampler_x_warp|startup_inline_sampler_warp|startup_stream_draw_warp|startup_stubs|startup_translated_sampler_bindings|startup_translated_sampler_bindings_shared_axis_control)$' --parallel 4 --no-tests=error --output-on-failure: 8/9 passed, 1 skipped (startup_root_sampler_heap_warp, exit 77: no debug layer capability on this Windows Server 2025 host).
tedin7
changed the title
startup: bind a default sampler heap before a sampler-heap-indexed root signature
startup: bind default sampler heap for sampler-heap-indexed roots
Nov 24, 2026
@tedin7, R0Y00 asked us to keep this as one implementation (see the go-ahead on #870) and preferred a different shape from the default sampler heap:
Defer the bind. Don't set the native root signature at slot 34 for a directly indexed root signature. Bind it only when a real draw has the indexed heaps it needs.
Translated path unchanged. It keeps tracking guest parameters and uses its own root signature.
Specific refusal. A real draw that lacks a required heap records its own refusal, because a one-entry sampler heap can't stand in for another index or for the view heap.
Coverage. Both flags independently and together, the unflagged real path, the existing root-CBV controls, and the 1419 fail-first case.
I have a prototype of the deferral running on Windows: RX 9070 XT, X2W_D3D12_DEBUG=1, 75 s on the main executable, id 1419 went from 394 to 0 with unchanged draw counts. Your test's message-callback counter and plain-list control are exactly the fail-first case R0Y00 asked for.
Two options, whichever you prefer:
I open the PR. It combines the deferral with your startup_root_sampler_heap test, extended to the flag matrix and the real-path refusal. You're credited as co-author, and this draft closes.
You keep the PR. You switch it to the deferral, and I supply the Windows WARP and RX 9070 XT runs plus the main-executable before/after counts.
I'll start on option 1 locally, but I won't push until you've answered.
Sounds great, @MasterDomino — closing this draft so you have a clean runway for the single implementation @R0Y00 preferred on #870. Happy to review and run Windows Debug + Release /O2 verification as soon as your PR is open!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sets a default sampler heap on the desktop list before a title root signature that indexes the sampler heap is set (debug layer message ID 1419).
What and why
D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXEDwas set by slot 34 with no sampler heap bound.CreateRootSignaturenow records the root signature flags. When slot 34 sets a flagged root signature on a list with no sampler heap bound, one shared one-entry shader-visible sampler heap per device is bound first (keeping the view heap a translated draw already bound). A sampler heap already bound is never replaced, andReset()/Close()clear the per-listPassstate so subsequent frames re-bind cleanly. One rate-limited log line (at most 4).docs/startup-runtime.mdanddocs/experiments.md.Not covered
Verification
5dbd2711ba5af3f592ce83e4f4456a61fc0c5e06):git diff --check origin/main...HEAD: passpython -B tests/docs_links_check.py: pass (17 Markdown files, 364 links)python -B tests/bidi_controls_check.py: pass (1281 tracked files)5dbd2711ba5af3f592ce83e4f4456a61fc0c5e06:--preset dev):cmake --build --preset dev --target d3d12_xs_shim startup_root_sampler_heap offscreen_check startup_stream_consumer startup_stub_consumer startup_translated_sampler_bindings_check -- -j 6(28.79s)ctest --preset dev -R '^(startup_root_sampler_heap_warp|startup_sampler_heap_warp|startup_sampler_heap_wrapped_warp|startup_sampler_x_warp|startup_inline_sampler_warp|startup_stream_draw_warp|startup_stubs|startup_translated_sampler_bindings|startup_translated_sampler_bindings_shared_axis_control)$' --parallel 4 --no-tests=error --output-on-failure: 8/9 passed, 1 skipped (startup_root_sampler_heap_warp, exit 77: no debug layer capability on this Windows Server 2025 host)./O2(--preset release):cmake --build --preset release --target d3d12_xs_shim startup_root_sampler_heap offscreen_check startup_stream_consumer startup_stub_consumer startup_translated_sampler_bindings_check -- -j 6(53.72s)ctest --preset release -R '^(startup_root_sampler_heap_warp|startup_sampler_heap_warp|startup_sampler_heap_wrapped_warp|startup_sampler_x_warp|startup_inline_sampler_warp|startup_stream_draw_warp|startup_stubs|startup_translated_sampler_bindings|startup_translated_sampler_bindings_shared_axis_control)$' --parallel 4 --no-tests=error --output-on-failure: 8/9 passed, 1 skipped (startup_root_sampler_heap_warp, exit 77: no debug layer capability on this Windows Server 2025 host).Overlap
git merge-treeagainst startup: apply stream rasterizer state on translated draws #1567, startup: cache translated graphics pipelines #1641, fix: default viewport and scissor for translated draws #1657, startup: refresh a frame copy when the title rewrites its memory #1658 and startup: keep the heap-indexing root flags for shader translation on Windows 10 #1277: clean. startup-d3d12: run compute pipelines that are already desktop DXIL #1441 and startup: general GFX10 texture tiling and detiling runtime #1469 already conflict with main by themselves; with this branch their source files auto-merge and onlyCMakeLists.txtconflicts (adjacent test blocks).AI-assisted; commands listed were executed locally.