d3d12_xs: capture a pipeline stream that carries a VIEW_INSTANCING subobject #2399
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2399"
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?
Imported from ubiquitarianism/leonida. Originally posted by ERROR890 on 2026-11-26T19:30:09Z.
Claimed in the coordination issue as: PSO-STREAM-VIEW-INSTANCING
(https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7201353671)
Depends on: none.
Fixes: none.
What and why
The parser that decides creation models
D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING(
shims/d3d12_vulkan_device.cpp): it refuses a non-zeroViewInstanceCountand accepts the subobject with a count of0. The capture walker that keeps a stream for derivation (
layout_ofinshims/d3d12_xs_pso_stream.cpp) did not modelit, so that same stream created a PSO and was never captured. The PSO carried no
PsoStreamRecord, and everyCreateDerivedPipelineStateon it failed with E_FAIL ("base PSO has no kept stream") - a silent loss of the derivedstates the title asks for, with nothing in the trace to say why.
The two walkers should agree: a stream the parser accepts has to be capturable. This models the subobject's size and
alignment in the capture walker. Only the
ViewInstanceCount == 0shape reaches it (a non-zero count is refused beforea PSO is created), so the payload's
pViewInstanceLocationsis never read; the walk needs the entry's size andalignment to step over it, nothing more, and that is what the comment on the case says.
Testing
The new case is
test_view_instancing_is_capturedinruntime/test/pso_stream_test.cpp: a synthetic stream built thesame way as the existing cases, plus a zero-count
VIEW_INSTANCINGentry; it must be captured, keep the entry'spayload offset, and still derive a tag-1 record. No D3D12 device, no Vulkan device, no game files.
GPUs tested: n/a (CPU-only test).
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No translatorchange in this pull request.)
Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-26T19:48:21Z.
Confirmed through the D3D12 proxy and a GPU readback on Windows 11, RTX 4090, NVIDIA 616.64, with Vulkan validation enabled. I built base
2d43417d49and PR head3b5b36edd1with the same local extension tod3d12_mesh_test.cpp.E_FAILon the first derivation.E_FAILon the mesh derivation.E_FAILThe probe placed the entry first in the vertex stream and immediately before SAMPLE_MASK in the mesh stream. The base sample mask was zero. For the vertex draw I derived twice, restored the full mask on the second derivation and released both earlier PSOs before drawing. For the mesh draw I used the fixture's tag-3 mask override through slot 55. On the PR, all four combinations matched the fixture's expected RGBA values at all 4,096 pixels. Each run also matched the 4,096-pixel indirect mesh readback.
On the base, the failing cases logged
base PSO has no kept stream. A separate one-view vertex stream with a valid location still returnedE_NOTIMPLand a null PSO on both revisions. The four PR runs reported no Vulkan validation errors. All inputs were synthetic.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T20:43:10Z.
Review: COMMENTED
Built
pso_stream_testwith MSVC on Windows 11 and ran it through CTest. It passed, including capture of a stream with a zero-countVIEW_INSTANCING, its unchanged payload offset, and derivation from the captured stream. I checked the capture walker against the creation parser for that entry. This was a CPU-only check of the stream walker.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T09:50:12Z.
Red/green: the PR's test fails on main and passes with this PR (checked by OreoFR).
Runtime batch of 20 PRs tested by OreoFR (full build, ctest without the game, Python suite, translator): same results as main
09c153948, RTX 4070 Laptop / Windows 11.AI-assisted (Claude Code, Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T22:02:21Z.
Verified by OreoFR
09c153948+ PR head3b5b36edd; integration package 1 of 6 (20 PRs, merged without conflict)AI-assisted (Claude Code, Claude Opus 5.5).