Repository navigation
Conversation
52fa5f9 to
291e80a
Compare
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge, with only the earlier non-blocking request for sampler lifetime tests remaining. Findings
SummarySupplied GPU geometry and buffers are now borrowed by default.
No new actionable issues were found.
|
| this.texture.setSampler(prev.sampler); | ||
| if (prev.sampler.owner === prev) this.texture.takeOwnershipOf(prev.sampler); |
There was a problem hiding this comment.
DynamicTexture now delegates sampler cleanup to the underlying texture and keeps the current sampler across resize(). The existing resize test only checks timestamps and generation, so it would miss early destruction or a leak. Add assertions that replacement destroys an owned sampler, resize keeps the current sampler alive, final cleanup destroys it, and borrowed samplers survive. This is non-blocking test coverage feedback.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
291e80a to
b43c093
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b43c093. Configure here.
| if (prev.sampler.owner === prev) this.texture.takeOwnershipOf(prev.sampler); | ||
| } | ||
| this.texture.setSampler(prev.sampler); | ||
| if (prev.sampler.owner === prev) this.texture.takeOwnershipOf(prev.sampler); |
There was a problem hiding this comment.
Resize claims borrowed first-parent samplers
Medium Severity
DynamicTexture.resize() now calls setSampler with a bare prev.sampler. A bare sampler attachment claims a still-pending first-parent sampler, so a sampler that was only borrowed is taken over by the replacement texture. Destroying the dynamic texture then releases a sampler the caller still expected to own or offer to another texture.
Reviewed by Cursor Bugbot for commit b43c093. Configure here.


Goals
Switch bare GPU geometry and buffer inputs to borrowing after applications have access to explicit ownership descriptors. This is the breaking follow-up to #4193. Review and land #4193 first.
Changes
Note
Medium Risk
Breaking change to resource ownership lifetimes that may cause GPU memory leaks in caller code that previously relied on models or GPU geometries automatically destroying bare resources.
Overview
Changes default resource ownership so bare
GPUGeometryandBufferinputs are borrowed rather than destroyed by their recipients.Modelnow borrows bareGPUGeometryinputs on construction and replacement, whileGPUGeometryandGPUTableGeometryborrow bare vertex and index buffers. CPU geometry uploaded by a model continues to be owned by that model.Explicit
{own: resource}descriptors can be used when the receiver should take ownership and manage cleanup. Additionally,DynamicTextureand the null backend are aligned to handle bare sampler borrowing without custom legacy branches. Documentation, examples, and test suites are updated to reflect the new borrowing defaults.Reviewed by Cursor Bugbot for commit b43c093. Bugbot is set up for automated code reviews on this repo. Configure here.