renderer: publish linear storage images before CPU access #537
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!537
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/537/head"
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?
@CheesyPoofs346 on GitHub · 2026-09-09 07:39 UTC · original
CheesyPoofs346:renderer-publish-linear-storage→main· +510 −16 · 13 files · 1 commits · closed without mergingProblem. A linear image the GPU has written is not visible to the guest CPU until its contents are downloaded to the backing. The page-fault path published GPU-modified buffers but not linear storage images, so a title that writes a linear storage image on the GPU and then reads it on the CPU observed whatever the backing happened to hold — stale bytes, or never-written ones.
Change. Track linear storage images the GPU has modified, and publish them to their backing before the CPU is allowed to observe the page, through the same fault path that already publishes buffers. The page manager learns to ask the resource manager for an image publication, and the texture cache performs the download.
Effect. CPU reads of a GPU-written linear storage image return the written contents. No performance change was measured, and none is claimed; the publication happens on the faulting path, so it costs a download only when the CPU actually touches such an image.
Verification. Device-backed coverage included and passing:
LinearImageCpuReadback— writes a linear image on the GPU, then reads it back on the CPU through the guest path and compares.PrivateBufferUpload— covers the buffer path that the same publication mechanism uses.HostImageAllocationand the existingPageManagerTestsstill pass.Full
ShaderRecompilerComputeTestsandPageManagerTestssuites pass.Limitations.
References
No external specification. Correctness argument only: a GPU write to a linear image lands in device memory, and the guest's view of that memory is the backing, so the CPU's first observation of the page must be preceded by a download — the same invariant the buffer path already maintains.
@copilot-pull-request-reviewer[bot] on GitHub · 2026-09-09 07:39 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
@chatgpt-codex-connector[bot] on GitHub · 2026-09-09 07:48 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
c72265ae13ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@ -1478,0 +1491,4 @@!info.IsDepth() && !info.IsBlock() && !info.HasMetadata() && !info.HasStencil() &&!info.IsVolume() && info.resources == ImageSubresources {1, 1} && info.data.Valid() &&info.data.size <= m_buffer_cache.GetUtilityBuffer(MemoryUsage::Download).Size() &&BuildDownload(image).valid) {@chatgpt-codex-connector[bot] on GitHub · 2026-09-09 07:48 UTC · original
When a linear storage image resides in committed code/runtime memory rather than direct or PRT-backed memory, this condition still installs a no-access CPU watcher. On the first CPU access,
TryDownloadImagerequiresTryReadBackingto initialize the download buffer (and later usesWriteBacking), but those backing APIs reject private committed ranges—as the new private-upload test itself demonstrates—soReadMemoryterminates the emulator instead of releasing the fault. Either support publishing into private committed mappings or exclude such images before installing the watcher.Useful? React with 👍 / 👎.
@Nmzik on GitHub · 2026-10-06 17:21 UTC · original
#423 duplicate
Pull request closed