Skip to content

GPU: fill pooled staging instead of zeroing it - #133

Merged
devin-ai-integration[bot] merged 4 commits into
mainfrom
devin/1795674679-staging-zeroing
Nov 26, 2026
Merged

devin-ai-integration[bot] merged 4 commits into
mainfrom
devin/1795674679-staging-zeroing

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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 check and 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

Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Personed and others added 3 commits November 26, 2026 06:39
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>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

View findings in Devin Review · Follow Devin's work

Devin Review

@devin-ai-integration
devin-ai-integration Bot merged commit 55a8464 into main Nov 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant