startup: declare no DSV format on a pipeline that does not use depth #3535
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3535"
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 R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-30T02:17:33Z.
Change
pipeline_for()declareddesc.DSVFormat = dsv_formatunconditionally, andpass_dsv_format()returns thebound depth view's format whenever one is bound ΓÇö including when the stream PSO carries no depth-stencil
state. A state that enables neither depth nor stencil must declare
DXGI_FORMAT_UNKNOWN. Declaring thebound view's format instead is what the debug layer reports as message 1477:
startup_indirect_translated_targets_hardwarefails on that warning in the Agility configuration eventhough all five of its pixel checks pass.
Declare
DXGI_FORMAT_UNKNOWNwhen depth/stencil is disabled, and let the pipeline cache keys, the recipereplay and the log line follow the state actually built. Two passes that differ only in an unused DSV
format now share one pipeline.
Refs #3525.
Verification
Base
upstream/main47c30feb9. NVIDIA GeForce RTX 4070 Ti SUPER, driver 32.0.16.2101, debug layer on.Agility configuration (
-DOFFSCREEN_AGILITY_620_DIR+-DOFFSCREEN_WARP_DIR, Agility SDK 1.620.2,WARP 1.0.22):
In-box configuration (default
devpreset), at this head:Context from the same host: a full sweep of the 952
_hardwaretests onmainbefore this change had nofunctional failures, so the depth paths were already clean; this was checked against those tests plus every
depth/dsvtest above.Evidence and follow-up
CI cannot catch this: both Windows jobs build the in-box configuration, where the in-box debug layer does
not emit 1477 for this case. The reproduction is the Agility configuration above.
This settles option 1 in #3525: the warning is the shim's, not the fixture's. If the maintainers would
rather the fixture accept severity 2 here, that is option 2 and this patch should be dropped instead ΓÇö
the two are mutually exclusive.
Recipes recorded before this change
X2W_PSO_RECIPE_DIRrecords already written for such passes carry the old DSV format.pso_recipe_targets_matchnow skips them, so those passes lose pipeline precreation until the recipe is re-recorded; the pipeline is still created on demand, so the behaviour is unchanged.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T07:22:23Z.
Review: APPROVED
Reviewed
977e36d6by reading the diff; not built or run.Verdict: approve. When
use_depth_stencilis false, the desc keeps its zero-initialised depth-stencil state (src/startup_stubs/d3d12_draw.inl:1545). DeclaringDXGI_FORMAT_UNKNOWNthen matches what is built, and the state key, targets key, recipe replay and log line all followpso_dsv_formatconsistently. No MUST.pso_dsv_format(:1521) keys onuse_depth_stencil, which only says that a depth-stencil state exists (bound.has_depth_stencil). A stream PSO whose DEPTH_STENCIL subobject hasDepthEnable = StencilEnable = FALSEwhile a DSV is bound still declares the bound format. That is the same "does not use" case, so message 1477 can still appear there. Either addbound.depth_stencil.DepthEnable || bound.depth_stencil.StencilEnableto the condition, or change the comment from "enables neither" to "carries no depth-stencil state".X2W_PSO_RECIPE_DIRrecords already written for such passes carry the old DSV format (pso_recipe.h:204).pso_recipe_targets_matchnow skips them and the pipeline is created normally, so they only lose precreation until they are re-recorded. Worth a line in the PR body; the change is still correct.Tests: none added.
startup_indirect_translated_targets_hardwareis the regression test, but only in the Agility configuration (author's before/after above). CI builds the in-box configuration, where the debug layer does not emit 1477, so CI cannot show the fix; the green run shows only that nothing else regressed.Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-30T08:43:12Z.
Took the second option from the SHOULD, and the first would not have been valid — I tried it.
Adding
DepthEnable || StencilEnableto the condition makesstartup_stream_depthfail on both WARP and hardware, and the debug layer says why:So a bound DSV must match the pipeline's
DSVFormateven when depth and stencil are both disabled. Theds_disabledPSOs in that fixture (DepthEnable = FALSEwithDSVFormat = D32_FLOATand a DSV bound) are a legitimate configuration, and declaringUNKNOWNfor them is rejected at draw time. Reverted touse_depth_stenciland corrected the comment to say what it actually guarantees: 1477 is the case where the pass carries no depth-stencil state at all, so the bound format has nothing to match.Re-verified at
d8cf4c3e4:The diff for this follow-up is comment-only; the code is unchanged from
977e36d6e.On the NIT: agreed, and it is worth a line in the description — recipes recorded before this change carry the old DSV format, so
pso_recipe_targets_matchskips them and those passes lose precreation until the recipe is re-recorded. Updated the description to say so.