startup: declare no DSV format on a pipeline that does not use depth #3537
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3537
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@KelboLive on GitHub · 2026-11-30 02:17 UTC · original
KelboLive:fix/3525-dsv-format→main· +13 −5 · 1 files · 2 commits · merged 2026-11-30 08:58 UTCChange
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 #3527.
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 #3527: 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.A bound depth view supplies a format through pass_dsv_format() even when the stream PSO carries no depth-stencil state, and pipeline_for() declared it unconditionally. A state that enables neither depth nor stencil must declare DXGI_FORMAT_UNKNOWN; declaring the bound view's format is what the debug layer reports as message 1477 ("The DSV format is (D16_UNORM) but the graphics pipeline state does not use ..."), which fails startup_indirect_translated_targets_hardware in the Agility configuration although every pixel check passes. The pipeline cache keys, the recipe replay and the log line follow the state actually built, so two passes that differ only in an unused DSV format now share one pipeline.@lukaslw-lab on GitHub · 2026-11-30 07:22 UTC · original · approved these changes
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.@KelboLive on GitHub · 2026-11-30 08:43 UTC · original
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.github-bot referenced this pull request2026-11-30 14:37:50 +00:00
github-bot referenced this pull request2026-11-30 15:55:45 +00:00
github-bot referenced this pull request2026-11-30 22:10:21 +00:00