Skip to content

Metal: release held drawables when the swap chain resizes - #120

Closed
yorgunkral31 wants to merge 1 commit into
renderbag:mainfrom
yorgunkral31:metal-release-drawables-on-resize
Closed

yorgunkral31 wants to merge 1 commit into
renderbag:mainfrom
yorgunkral31:metal-release-drawables-on-resize

Conversation

@yorgunkral31

Copy link
Copy Markdown

acquireTexture retains each drawable and only releases it when the slot is reused, so references linger across resizes. On iOS this bites hard: a suspend invalidates the layer's drawables, and holding them across a resume is undefined. resize() already runs with the GPU idled, so it now releases the previous generation's references there. No behavior change beyond dropping stale references. (Companion to the app-side suspend/resume work in Markos-Th09/UnleashedRecomp-iOS#10.)

On iOS the layer's drawables are invalidated when the app is suspended;
holding or presenting them across a resume is undefined. resize() runs
with the GPU idled whenever the swap chain is invalidated, so it is the
natural point to release the previous generation's references (this also
fixes them lingering across ordinary resizes).

(cherry picked from commit a19f137)
@DarioSamo

Copy link
Copy Markdown
Contributor

Closing, as per the contribution guidelines that state, AI-generated pull requests are not allowed.

@DarioSamo DarioSamo closed this Sep 24, 2026
@renderbag renderbag locked as spam and limited conversation to collaborators Sep 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants