Shaders: lower a single texture size dword read #69
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/69"
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 Zettrox/ztrx. Originally posted by Artking175 on 2026-11-25T08:10:54Z.
A shader can read dword 2 of an eight-dword 2D texture descriptor with a single
s_load_dword. The full-descriptor reload case already reconstructs this word from the host view's dimensions. A single-dword read used to miss that path.Match the read to a proven 2D image use at the same traced address, including its root and computed term. Recover the base of the view from the scalar load's own operands, even if the full descriptor is loaded later. The existing image path reconstructs the upper width bits and height. An unrelated heap entry still gets the original refusal.
The synthetic shader reproduced “a descriptor read only as data” before the change. With the change it emits identical DXIL to a full reload at heap slots 0 and 1. A second test keeps the refusal for an unrelated entry. The Windows dispatch test uses two textures of different sizes and checks both the packed dimensions and the texel from the selected view.
Related to the diagnostic in #38 and #55. The logs do not establish that the title's reported shaders use this specific read.
Verified on macOS with 172 shader tests and 43 tests in the supporting crates. The diagnostics application and tests cross-check for Windows x64, and Windows-target Clippy is clean for the shader crate with all targets and features. The Windows dispatch test was compiled but not run.
Imported from Zettrox/ztrx. Originally posted by Bullet18x on 2026-11-25T08:24:24Z.
Tested on an RTX 5090, stacked with #68, #36, #35 and #33. All three new
texture_size_word_*tests pass on the card.In game, these two pixel shaders still fail with the PR merged:
Four more from the same family on
main(2fd01fca16993001,8660e9822ebe4b62,abc6a80d46edc294,c8df7216c69cecbd) weren't reached in the shorter run, so they're untested either way.Imported from Zettrox/ztrx. Originally posted by iGoldenNinja on 2026-11-25T08:45:48Z.
I reproduced this on an RTX 5080 with driver 617.14, Windows 11 Pro 25H2 build 26200.9974. Clean head
0cad4faaaebe1b504d464aa9c7bcb269432cb53epassed all threetexture_size_wordtests, including the D3D12 readback with no adapter skips.With clean main
90b529fas the control, I translated the two exact pixel programs from Bullet18x's report on both revisions.6b6db9f1a526daeband7d0f14ce44746d7eboth reached I/O analysis and were refused during emission witha descriptor read only as dataon both revisions. I used offline translation for this comparison.The same two programs previously emitted, validated and created pipelines with the NVIDIA fork's broader PR 203 descriptor-data lowering. The report links the earlier comparison for anyone tracing these refusals. Pinned RTX 5080 report
Imported from Zettrox/ztrx. Originally posted by Artking175 on 2026-11-25T08:59:41Z.
@iGoldenNinja Thanks for the clean-head comparison on the RTX 5080 and the link to victory-fork #203. The update in
811d2cahandles the reported full eight-dword pixel descriptor load used for dimensions without an image access. It reuses the 2D size reconstruction when the load is traced to a resource heap or table and the metadata, when present, identifies an eight-dword SRV.Could you rerun the same offline comparison against this head for
6b6db9f1a526daeband7d0f14ce44746d7e? The useful result for each hash is whether it emits, validates, and creates a D3D12 pipeline, or the new error and offset.The combined retest branch also has
VICTORY_REFUSAL_CONTEXT=1for text-only notes about the source load if the refusal persists. No shader files are needed in the reply.Locally, the new synthetic case reproduced the old refusal on the previous PR head and emitted after the fix. The shader suite passed 174 tests with 2 ignored, and Windows x64 Clippy passed. The two title shaders still need your offline check.
Imported from Zettrox/ztrx. Originally posted by iGoldenNinja on 2026-11-25T09:08:31Z.
@Artking175 I reran the requested offline comparison on clean
811d2ca654a9f3b0f4947fd79a9ac185691cdf03. RTX 5080, driver 617.14, Windows 11 Pro 25H2 build 26200.9974. I used the same two shader inputs andtranslate --jobs 1 --validate --pipelines --list.6b6db9f1a526daeb7d0f14ce44746d7eBoth programs were refused during emission on the prior head
0cad4fa. All fivedescriptor_testspassed on the new head, including the hardware and WARP readback fixture with no skips. This retest reached offline pipeline creation. Updated pinned comparisonImported from Zettrox/ztrx. Originally posted by Artking175 on 2026-11-25T16:08:38Z.
Offline retest on RTX 2060 (driver 531.41), with app-local Agility SDK 1.608.2 and DXIL validator from DXC 1.8.2505.32. I ran
translate --jobs 1 --validate --pipelines --liston the same local 1.0.2.1 shader archive.All six
PS_PuddleDetectcontainers were refused at emission onmain(90b529f) witha descriptor read only as data. On the exact PR revision811d2ca, all six emitted DXIL, passed validation and created D3D12 PSOs.6b6db9f1a526daeb,7d0f14ce44746d7e.2fd01fca16993001,8660e9822ebe4b62,abc6a80d46edc294,c8df7216c69cecbd.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.