Repository navigation
Conversation
e252e87 to
b70e1c9
Compare
`Batch` kept, per copy, the union of the ranges it refreshed when they touched, and skipped a later refresh covered by it. Two partial refreshes of one 64 KiB page — `[p, p + 4 KiB)` then `[p + 4 KiB, p + 64 KiB)` — unioned to the whole page, so a later whole-page refresh was skipped and the page was never taken. `Tracked::take` had copied only parts of it, so it stayed changed; after the submission a marked page then found it changed with nothing saved, and `copy_back_marked` kept the title's bytes instead of the shaders' (Marvisak#2473). The set holds the pages one refresh took **whole**; a page counted in parts is not in it, so the rest of it is copied when it is asked for. Pages are the write watch's own unit, which is what decides whether a page is taken. `partial_refreshes_do_not_make_a_page_current` is the issue's scenario: two partial refreshes that together cover a page, then a title write, then a whole-page refresh — with the union it copied 0 bytes and the page was never taken; now it copies the page.
b70e1c9 to
67f4bb4
Compare
|
Automated triage for the maintainers. This fixes #2473: However, #2474 fixes the same issue in the same function and is the better candidate:
This PR also has two costs #2474 avoids:
Proposed for closing as a duplicate of #2474. The PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label. Generated by Claude Code |
|
Windows 11 / NVIDIA test run, head Setup: Windows 11 Home build 26300, RTX 5080, NVIDIA 621.40, rustc 1.98.1 MSVC, VS 2022 Build Tools, Windows SDK 10.0.26100 (
Not run: the retail title, clippy, and other crates. AI-assisted (Claude Code) |
Fixes #2473.
The failure
Batch::flushkept a copy's refreshed ranges as the union of the ones that touch, andBatch::addskipped a later refresh covered by it. Two partial refreshes of one 64 KiB page ÔÇö[p, p + 4 KiB)then[p + 4 KiB, p + 64 KiB)ÔÇö union to the whole page, so a later whole-page refresh was skipped.Tracked::takehad copied only parts of it, so the page stayed changed; after the submission a marked page then found it changed with nothing saved, andcopy_back_markedkept the title's bytes instead of the shaders' writes.What the change does
The set holds the pages a refresh took whole (
from.div_ceil(PAGE) .. to / PAGE), andaddskips a request only when every page it spans is in it. A page counted in parts is not there, so the rest of it is copied when it is asked for. Pages are the write watch's own unit, which is what decides whether a page is taken.Two things the old form got for free and this keeps: a copy's refresh in a submission is still done once per range (not once per draw), and a step that writes title memory still clears the set (
title_written).Verification
partial_refreshes_do_not_make_a_page_currentis the issue's scenario: two partial refreshes that together cover a page, then a title write, then a whole-page refresh. With the union the refresh copied 0 bytes (the page was never taken); now it copies the page. I did not keep a separate red run of the old code, but the two branches are one condition apart: with the union[p, p + PAGE)is incurrentandaddreturns beforeflush.cargo test -p victory-gpu --features diagnostics --libon Windows 10 19045 / RX 7800 XT after rebasing ontoda82e44: 198 passed, 1 ignored, plus the known placed-view failure on a runtime withoutID3D12Device10(GPU tests: placed R32_UINT -> R9G9B9E5 view does not share its host texture (Windows 10, RX 7800 XT) #1999, identical onmain); clippy-D warningsclean.