Repository navigation
GPU: fill pooled staging instead of zeroing it - #133
Merged
devin-ai-integration[bot] merged 4 commits intoNov 26, 2026
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
Devin Review found 4 findings. Devin automatically fixed all 4 findings.
Fixed by Devin (4)
- Redundant clears during texture streaming — Staging now tracks whether the initial allocation was already zero and whether it came from pool reuse, so failed first fills clear a reused buffer at most once and fresh buffers are not cleared redundantly.
- Earlier mips erased on detile error — A first detile error now zeroes only the failed and later subresources, preserving earlier successful subresources exactly as the old zero-initialized buffer did.
- Quadratic scans during texture refresh — Direct3D returns footprints in subresource order, so the length now uses the next footprint directly instead of scanning all offsets for every subresource.
- Out-of-bounds write after detile failure — Subresource writes are now bounded by the next footprint offset or the exact end returned by GetCopyableFootprints, and detile uses the same bounded length instead of assuming trailing row padding exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
memória/VRAM/frame-time: pooled texture staging buffers are no longer memset to zero every time they are reused. In streaming bursts this avoids writing tens to hundreds of MiB per frame on the recording thread before the real detile pass writes the same buffer again.
The zero content invariant is preserved explicitly: a first refresh either detiles every texel row before the already-recorded upload runs, or zeroes the buffer on the paths that cannot fill it (all-zero partly mapped input, an unlocked read failure, or a first detile error). Existing non-first textures keep their previous contents on those paths exactly as before.
Validated with the asset policy check plus Windows-target
cargo checkand clippy with warnings denied.Link to Devin session: https://app.devin.ai/sessions/75bbf6b4192940fea34014b13a016bee
Open in Devin Desktop: https://app.devin.ai/desktop/session/75bbf6b4192940fea34014b13a016bee?variant=devin
Requested by: @Personed
🟢 Devin fixed all 4 findings · Follow Devin's work