d3d12: log placed texture drops with their time on the performance counter #639
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/639"
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 brcly/TuxBox. Originally posted by Kayotic1337 on 2026-12-01T21:34:07Z.
TUXBOX_LOG_TEXTURE_DROPS=1logs each placed texture as it is released:The time is in seconds on the performance counter, which is the clock vkd3d-proton's
VKD3D_CONFIG=faultaddress history uses. A GPU read of a destroyed image can then be matched to the texture whose release unbound it. In every #603 fault I could attribute, the drop line came 10–15 µs before vkd3d'sUNBINDof the same image.This PR is optional. It doesn't fix anything. Several of us are chasing the same fault on different cards (#603). vkd3d's address history and RADV's binding history name the Vulkan image and its VA range, not the title's texture. With this log, everyone can tie a fault to a texture (its guest address, size and format) the same way. @NickStallman already carried an earlier copy of this commit in his integration build.
Change
diagnostics::placed_texture_dropped, called fromTexture::drop. It is off by default; when off, each drop costs one cached flag check.diagnostics.rsbecausedevice/placement.rswas at 1,199 lines; the call adds one line there, to 1,200.docs/ENVIRONMENT.md.Tests
python tuxbox.py check --no-gpu: 13 passed, 0 failed.runtime/d3d12/(python tuxbox.py check --changed) on RX 9070 XT (1002:7550), Mesa 26.3.1 RADV, GE-Proton11-15: The one failure islanes-selftest-texture-publication. It fails the same way onmain(2a850114) without this change, on the same card; that's #625. All other Lanes scenarios and the D3D12 regression controls pass.Game
ProjectScarlett on the RX 9070 XT: an earlier copy of this commit, identical except that the code sat in
placement.rsand any value of the variable turned it on, was on in all seven of my runs today, six of which I reported on #634 and #603. Those runs logged up to 75,823 drops each. The one use-after-free among them was matched to its texture this way (run 1 in my comment on #603).I also ran this exact commit in the game, cherry-picked onto that earlier build (main
712fb960+ #630) rather than this PR's base. The PR's base changes the translator, so a run on it would have meant recompiling every shader first, and the commit is the same on both. WithTUXBOX_LOG_TEXTURE_DROPS=1 TUXBOX_LAZY_PUBLICATION=0(#634), it ran 400 s into the world, which I ended myself. It logged 50,863 drop lines, all in the format above. No GPU fault occurred in that run.🤖 Generated with Claude Code