Repository navigation
Conversation
…(ResourceDescriptorHeap probe) Adds DxilModule::heap_handle (dx.op.createHandleFromHeap, opcode 218, annotated with the view class) and a probe that compiles the same selection shader as DXC HLSL and as the native module, creates the pipeline with the heap-indexed root flag, and dispatches it twice with different selector words: each readback must be the data of the selected slot and the UAV guard word must stay intact. The adapter needs shader model 6.6 and resource binding tier 3, else the test skips.
…p slot as a raw buffer SRV A buffer load through a descriptor loaded from the whole resource heap at a GPU-computed index used to be refused (whole-heap buffer access needs a matching descriptor at the GPU-selected index). The direct DXIL lowering now emits ResourceDescriptorHeap[slot] (createHandleFromHeap, annotated as a raw buffer) and records a heap_buffer_srv binding with no table register; the pipeline then creates its root signature with the heap-indexed flag and sets the heap on the list. Adds the view-type classification header (native_global_srv.h) that the dispatch guard will use; no guard yet.
|
Test results for this PR on top of current
Suggestion: skip like // The native module declares WaveSize=32 (the guest wave), so an adapter without 32-lane waves cannot create it.
D3D12_FEATURE_DATA_D3D12_OPTIONS1 waves{};
if (FAILED(device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1, &waves, sizeof waves)) || !waves.WaveOps ||
waves.WaveLaneCountMin > 32 || waves.WaveLaneCountMax < 32) {
std::printf("adapter has no 32-lane waves (%u..%u)\n", waves.WaveLaneCountMin, waves.WaveLaneCountMax);
return 77;
}With that change locally: Environment: Windows 11 build 26200, MSVC toolset 14.51.36231, Windows SDK 10.0.26100 DXC, D3D12 debug layer not enabled. AI-assisted. |
|
@tedin7 I opened tedin7#2 against your |
|
Thanks @JB2WIN for testing on the 3080 and for the WARP skip. We're stepping back from this one so your person can take it from here. State of the branch (
"Allow edits by maintainers" is on, so you can push straight to this branch or open a new PR from it, whichever you prefer. We're also releasing the claim on #2908. AI-assisted; commands listed were executed locally. |
|
Hardware and WARP result for head Environment: Windows 11 25H2 (26200), MSVC 19.42, Windows SDK 10.0.26100 DXC, NVIDIA GeForce RTX 4070 Ti, driver 621.35 (32.0.16.2135). Clean worktree at the PR head, fresh Commands Result (measured, 2 runs, same both times): 2 tests: 1 passed, 1 failed. ctest exit 8. No skips.
WARP did not skip: the adapter check passed, so WARP reports shader model 6.6 and resource binding tier 3 here. The failure is Wider check, once: I ran Control: The test does not exist at AI-Assisted |
|
Independent Windows / AMD run of both entries on this head merged with EnvironmentWindows CommandsObserved, merged tree
The WARP refusal, measuredThe guess in the report above (a required wave size of 32 against WARP's 4 lanes) holds, and the property can be named:
Recorded dead end: taking For the record, not this probeOn the head as pushed ( What would make the
|
|
@SimSalabimse thanks, that matches what I saw on an RTX 3080. Your guess is right: with a |
KelboLive
left a comment
There was a problem hiding this comment.
PR #2912 by @tedin7 -- test: native DXIL read of a GPU-selected descriptor heap slot (probe)
What works
- Solid foundational work establishing the 0x100 linear layout in gfx10_layout.h with careful derivation from AMD addrlib
- The linear_mode = 0 constant elegantly extends block_log2() to accept mode 0 without changing the tiled modes switch logic
- supports() check is correct: mode == linear_mode bypasses the block_log2 >= 12 requirement since linear has no tail
- Test infrastructure is excellent -- linear_order_control (expected failure with largest mip first), linear_addrlib (338K element addresses), and the unpadded negative control all add strong coverage
- Documentation accurately restates addrlib's linear mode algorithm in clear, testable terms
Issues
- supports() currently allows block-compressed formats (BC1-BC7) in linear mode via the fallthrough -- BC formats are block-based and don't have linear row semantics; consider gating them out explicitly like 1D does in #2929
- The check script in startup_address_console_check.py builds linear backing bytes from addrlib equations. This is correct but the linear path could break if the hardcoded equations drift from addrlib; a comment linking to the Mesa commit that derives these equations would help
Recommendations
- Good discipline in including the negative control (unpadded rows test) to verify the 256-byte pitch requirement
- Consider adding a TODO or assert in supports() that blocks linear mode for BC formats until explicitly validated against addrlib
Overall
A well-researched, well-tested implementation. The linear layout extension is cleanly separated from tiled modes. Minor concern about BC format handling in linear mode, but the existing refusal behavior is safe. Ready for merge.
Part of #870
Refs #2908. What this unblocks: reading a descriptor heap slot that the GPU selects (
ResourceDescriptorHeap[index]) from a native DXIL compute module, the base for capturing and replaying the view type of such a slot.This is cycle 1 of the work, a probe only. It does not yet capture or replay view types, and no guest shader is translated through a heap-indexed data read yet: that translation (a heap-indexed data SRV) is the follow-up in this same series.
What changed
DxilModule::heap_handleemitsdx.op.createHandleFromHeap(opcode 218) plusannotateHandlewith the view class the shader reads.native_heap_handle_probebuilds the same selection shader two ways (DXC HLSL reference and the native module), creates the pipeline with root flagCBV_SRV_UAV_HEAP_DIRECTLY_INDEXED, and dispatches it twice with different selector words.native_heap_handle_probe_check.pycompiles the reference with the installed DXC, prints how DXC spells the heap handle and its shader flags, and passes those flags to the native module.Tests
native_heap_handle_probe_warpandnative_heap_handle_probe_hardware: each readback must equal the CPU reference of the selected slot, the two selectors must give different data, and a guard word past the copied range must stay intact. An adapter without shader model 6.6 or resource binding tier 3 skips (exit 77).Verification:
AI-assisted; commands listed were executed locally.