d3d12/gpu: a released target at a shared address leaves the older one found (D3D12-TARGETS-AT-RESTORE) #3054
Open
upipibi wants to merge 1 commit from
upstream-pr/3054 into main
pull from: upstream-pr/3054
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
ProjectLeonida/mandy!3054
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3054"
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 upipibi on 2026-12-02T06:16:57Z.
D3D12-TARGETS-AT-RESTORE, item 5 of @zmasi's finding (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7334060836). Claim: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7336489248
What was wrong
TARGETS_AT(resource.rs) maps an address to the texture the host writes (a target, depth, or unordered access) that was made there.alias_sourcelooks it up so that a view the title places in that memory, in another format, reads the host's texture rather than title memory. The table held one texture per address:targets.insert);targets.remove), although the first was still alive.From then on, a view over the first texture found nothing. It read title memory, which shaders never wrote.
What it changes
TARGETS_ATkeeps every live texture made at an address, newest last. The newest is the one found, as before, so nothing changes while both are alive.targets_put/targets_take: a release removes only that texture. If it was the newest, the one made before it is found again.levels_changed(at)runs only when the texture found atatchanges, as before.TARGETS_CHANGEDis raised before every release that touches the table: a raise with no change only makes the quick path (LEONIDA_ALIAS_QUICK) look again.One file, no new switch. The behaviour differs from
mainonly after the newer of two live textures at one address is released.When the older texture is the right answer. Once the newer texture is released, what it drew is in neither place: its host copy goes with it, and shader writes to a target reach title memory only for the kinds
texbackcopies back. The older texture is still alive, and whatever the title draws into it next lands in its host copy and nowhere else. A view placed there now sees those draws. Onmainit read title memory and never saw them. The texture found now depends only on which targets are alive, not on the order they were released.main's answer is better only when the memory is refilled by the CPU or by a copy after the release and the older target is not drawn into again.mainalready behaves that way whenever the older target is the only one at that address.How it was tested
RTX 3070 8 GB, driver 621.40, Windows 11 24H2. No game files.
resource::tests::releasing_the_newer_texture_at_an_address_finds_the_older_again(diagnostics, on the device), run with and without the quick path (ALIAS_QUICK_TEST): texture A, then B made at A's address, then a placed view there. The view finds B; after B is released, it must find A again; after A is released, nothing.main's release put back (the whole entry removed when the newest goes), this test fails at "the older texture is found again". It passes with the change.resource::tests::the_texture_found_at_an_address_gives_way_to_the_one_before_it: pure, no device. It covers the order of release, which releases report a change, unknown textures and addresses, and making the same texture twice.cargo test -p leonida-gpu --features diagnostics --lib --locked: 751 passed, 0 failed, 59 ignored.cargo test -p leonida-gpu --lib --locked: 667 passed, 2 failed (texture::alias_cast_tests::committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers,watch::tests::unmapped_blocks_are_reported_once_until_mapped). Both pass when run alone, onmainand on this branch, so they look like order-dependent flakes in files this change does not touch.cargo clippy -p leonida-gpu --all-targets --features diagnostics -- -D warnings: nothing inresource.rs; the 10 errors left are in other files and are onmainalready.python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/resource.rs: clean.The game: I have not run it. EdenBendheim's in-game batch run on an RTX 3090 included this head and passed (https://github.com/ProjectLeonida/mandy/pull/3054#issuecomment-7358705620). zmasi named this as a candidate for #2960, where the weapon shop's 3D preview blurs under dynamic resolution and is sharp at a fixed resolution. Dynamic resolution makes targets again, which could leave two at one address. TripyFox ran that menu with dynamic resolution and this change (https://github.com/ProjectLeonida/mandy/pull/3054#issuecomment-7342597771): still blurred, so this PR does not fix #2960.
AI-assisted: written with Claude Code (Claude Opus 5.5). A separate read-only reviewer agent (Claude Opus 5.5) audited the diff before this was opened.
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T07:40:05Z.
Windows 11, MSVC toolchain 1.98.1. Head
ff53fd8b9merged into currentmain229d352ee: the merge is clean. Unit tests only.cargo test -p leonida-gpu --features diagnostics --lib:LEONIDA_D3D12_WARP=1): 774 passed;LEONIDA_D3D12_DEBUG=1): 774 passed, with no message from the layer.cargo test -p leonida-gpu --libwithout diagnostics: 692 passed, 0 failed, run twice. The two failures in the description (alias_cast_tests::committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers,watch::tests::unmapped_blocks_are_reported_once_until_mapped) didn't come back here.Red/green, on the hardware device and on WARP. I put
main's release back intargets_take: the whole entry goes when the newest texture is released. Both new tests then fail. The device one isreleasing_the_newer_texture_at_an_address_finds_the_older_again. The pure one isthe_texture_found_at_an_address_gives_way_to_the_one_before_it, atresource.rs:5166, "the older one is found again",left: None. With the change both pass.Not checked: the game, so nothing on #2960.
GPUs tested: one NVIDIA desktop card + WARP.
AI-assisted: yes (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T10:02:28Z.
Verified locally on Windows 10 22H2 + NVIDIA GeForce RTX 5070 12 GB (driver
621.40), PR headff53fd8b9merged ontomaina917c54d6:cargo test -p leonida-gpu --locked --lib resource::-- 30 passed, 0 failed.python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/resource.rs-- exit0.diagbuilddiagnostics,dlss,mimalloc,-NoFrameGen -NoPrecompile, 65 s in-world, 214 s total):ERRORlines, 0 device removals, clean startup and shutdown.1,000+draws/frame, up to5,289draws): median 20.3 fps (49.2 ms/frame); preparing33.2 ms(copies13.2 ms, textures1.1 ms), GPU wait0.0 ms, copying back5.5 ms.Result: PASS.
AI-assisted: yes (Antigravity).
Imported from ubiquitarianism/leonida. Originally posted by TripyFox on 2026-12-02T10:31:34Z.
Tested this against #2960 in the game: only
ff53fd8b9on top of27613ab6b(resource.rsis identical there), Series X with the title's dynamic resolution (floor 0.5, 4K output), the same save and the same shop menu. The weapon preview is still blurred, so this doesn't fix #2960. The run itself was clean: no device removal or crash, and the onlyERRORlines are Streamline'sgetRefreshRate ... is not a valid window, whichmainwithout this PR logs the same way. Full results of the other checks are in https://github.com/ProjectLeonida/mandy/issues/2960#issuecomment-7342531668.AI-assisted (Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:18:39Z.
Verification of #3054 (third party, code review on Linux; not built: Windows-only
leonida-gpu)ff53fd8b9f56174b90f0dbb61c844f0a7597861f(1 file,d3d12/crates/leonida-gpu/src/resource.rs,+117/-7).
0ae5a2664.git merge-tree --write-tree origin/main pr/3054againstmain45dc41f95is clean(202 commits behind).
python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/resource.rs: exit 0.Review
TARGETS_ATheld one texture per address. Releasing the newer of two targets at one address removedthe entry, so the older live one was no longer found. Releasing the older first already left the newer in place,
because of the
== selfcheck onmain. AVecper address, newest last(
resource.rs:1615-1646), fixes the cause.targets_takereturnstrueonly when the found entry changes, andlevels_changedruns only then(
:3606-3609). That is right.targets_putdedups (retain) before pushing. The lists are tiny, so the linearscans cost nothing.
TARGETS_CHANGEDis now raised on every target release, not only when the entry matched (:3603-3606). Thecomment explains it. The cost is an extra re-look by
LEONIDA_ALIAS_QUICKcaches, which is cheap.:5153-5177) covers put, take, order, dedup and the missing cases. The device test(
:5179-5226) goes throughcreate_at_addressandalias_ofwith and without the quick path, and fails onmain's one-entry table. It isdiagnostics-only and returns silently with no host. Print a skip line, asother device tests do.
texture. Anything the newer target rendered to that memory is in neither the older texture nor title memory. Is
the older texture's content the better answer than title memory in that case? The body says #2960 was not fixed
by this (TripyFox's run), which fits. A line in the body or
findings.mdon when "older found again" is thecorrect picture would settle it.
Process
layer) and lixonik ran unit tests on native Windows.
Verdict: ready on review (not built here). It still needs CI approved and an answer to the question above.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-12-02T19:17:58Z.
Windows native unit verification (
VERIFY-3054-WIN) — PASS WITH NOTE on headff53fd8b9f56174b90f0dbb61c844f0a7597861f(merged cleanly onto80910637f, Ryzen 9 5900X / Windows 11 / MSVC):scripts/check_no_game_data.pyon changed files): PASS.80910637f):cargo test -p leonida-gpu --locked -- address --test-threads=1(and with--features diagnostics) exited101(E0425, missingtargets_putandtargets_takeintroduced by this PR).cargo test -p leonida-gpu --locked -- address --test-threads=1: 13 passed.cargo test -p leonida-gpu --locked --features diagnostics -- address --test-threads=1: 15 passed.(AI-assisted verification:
gemini-4-neon+gpt-6.2-astra.)Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-12-02T21:02:36Z.
RUN (in-game RTX 3090 300 s stress gate, 14-PR combined batch) — PASS covering exact head
ff53fd8b9f56174b90f0dbb61c844f0a7597861f(in addition to the Windows unit verification posted above).git merge --no-ffontomainb41763227(diagnostics,dlss,mimalloc,exe_sha16 = c47eeb717f761d9d; changed-file clean-room scan exit0).14PRs):#3200d1a91afd1,#319880a627bb1,#319193b47ac9d,#3189c182fc392,#3176ae0075d9a,#3168337388052,#31641065952da,#3146ebc0253ff,#312464600ef0c,#3069311d33a40,#30318df1bfce7,#3029e49404808,#3054ff53fd8b9,#3010d645712a3.610.88, Series X profile,2560x1440,-NoFrameGen,scripts/game-gate.ps1(301.3 sin world) with downtown street-level teleport + 8-leg dynamic sprint/turn/strafe stress mod (GATE CONTROL moved=2.51 m,max_from_ctrl=5,053.9 m).PASS(0device lost,0crashes,0warnings,0missed pipeline waits,20.10 FPSmedian vs19.13 FPSmainb41763227baseline, clean exit0x00000000).(AI-assisted verification:
gemini-4-neon+gpt-6.2-astra.)Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T22:27:38Z.
VERIFY-3054 — Windows nativo: las 32 pruebas de recursos pasan y el control muerde la pila de direcciones
(this PR)0ae5a2664(behindmainb41763227)main—merge-treeclean,git merge --no-ffcleanRan
Negative control (synthetic):
targets_takeremoves the texture it is given; I made it remove the oldest instead (here.remove(0)), rebuilt and ran:The test bites on the mechanism the change adds.
What the change is: the table of targets keeps a stack per address (
BTreeMap<u64, Vec<usize>>) instead of one texture, so two textures found at one address both stay: the newest answers a lookup, and releasing it gives way to the older one again — which is whattargets_take'snewestreturn and the three new tests pin. The scenario it models is a resource released and refound at the same address in a later place; before this, the older entry was lost.What I could not test
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by upipibi on 2026-12-03T16:29:56Z.
@MoonEyes, on your question: neither source has what the newer target drew once it is released. Its host copy goes with it. Shader writes to a target reach title memory only for the kinds
texbackcopies back (texback.rs:10-15, four water formats by default), and the release drops that texture's pending copies (resource.rs:3597,texback.rs:119-120). So the choice is between the older target's host copy and title memory that no draw reached (the comment atresource.rs:1873).The older copy is the right answer for whatever the title does next. The older target is still alive, and the title can draw into it again. Those draws land in its host copy and nowhere else, for the same reason. With this PR, a view placed there sees them. On
main, the view reads title memory and misses every one of them for as long as the older target lives.It is also what
mainalready gives in two other cases: when the newer target was never made, and when the two are released in the other order (older first, so the newer one stays found). With this change, which texture is found depends only on which targets are alive, not on the order they were released.main's answer is better in one case. Suppose that after the release the memory is refilled by the CPU, or by a copy into a texture the title fills there (LEONIDA_COPY_BACK), and the older target is not drawn into again. Then title memory has the new data and the older copy doesn't.mainalready behaves this way whenever the older target is the only one at that address, so this PR adds no new case of it.I've put this in the body, along with TripyFox's #2960 run: still blurred, so this PR does not fix #2960.
On the skip line: the other device tests in
resource.rsalso return without printing when there is no host (:4709,:4940,:5034onmain), and this one does the same. I've left the head atff53fd8b9so the runs above stay on the exact head. It still merges cleanly ontomain717b90233(git merge-tree).Answered with the help of Claude Code (Claude Opus 5.5).
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.