Avoid clearing texture read buffers before a checked read #4057
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4057
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4057"
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?
@ghptc on GitHub · 2026-11-30 15:18 UTC · original
ghptc:perf/read-there-single-initialization→main· +2 −1 · 1 files · 1 commits · openA texture comparison calls
host::read_thereto read the current contents of title memory. The reader first clears the destination slice. On a fully readable range, the checked read immediately overwrites every byte.This change removes that initial write. Since FIocker’s #2062, the reader visits both the registered physical views and every gap, including ordinary committed memory before, between or after the views. A successful read writes its complete extent. A failed read may have copied a prefix, so the existing fallback clears the piece before retrying at 64 KiB and 4 KiB granularity. Each permanently unreadable leaf ends up zero. The readable-byte count follows the same checked reads.
This applies to the common
read_therehelper. Texture digests, upload and residency decisions, synchronization and the alias lookup use their existing paths. #4031 is a separate caller-side fix for retaining staged pixels and their digest across unreadable memory.Validation
An MSVC build of the equivalent integration change passed eight selected Proton tests, including the #2062 regression for committed pages around registered views. The patched function body on this PR head matches the tested function byte for byte.
A CPU-only Proton fixture compared the post-#2062 baseline and this change in the same binary. It used independently populated Win32 reservations and the production read and digest functions. Both readers produced the expected bytes and readable-byte counts. The sparse case included a decommitted 4 KiB page in each region’s first 64 KiB block and in each subsequent MiB. Each scenario ran six pairs in alternating AB/BA order. The last two columns are median wall times for the listed number of calls, including the digest and its equality check.
All six pairs per scenario improved on this machine. End-to-end frame-time impact remains unmeasured.
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.