Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sokol_gfx.h mtl: new attempt to fix swapchain lifetime issues #873

Merged
merged 5 commits into from
Aug 28, 2023

Conversation

floooh
Copy link
Owner

@floooh floooh commented Aug 25, 2023

See #872

This does away with the separate retained-reference command buffer for the present call, and instead uses the regular 'deferred release queue' for the default pass MTLRenderPassDescriptor. Since the render-pass-descriptor holds a strong-ref to swapchain surfaces this should make sure that those surfaces outlive their command buffer when they are released by MTKView because of a window resize. This means there's a memory spike during window resize, but I guess there's no way around that.

This also replaces the changes from #763 with a different approach.

See #872

This does away with the separate retained-reference command buffer
for the present call, and instead uses the regular 'deferred
release queue' for the default pass MTLRenderPassDescriptor.
Since the render-pass-descriptor holds a strong-ref to
swapchain surfaces this should make sure that those surfaces
outlive their command buffer when they are released by
MTKView because of a window resize. This means there's a memory
spike during window resize, but I guess there's no way around that.
@floooh floooh merged commit 32de1ef into master Aug 28, 2023
18 checks passed
@floooh floooh deleted the issue872-metal-validation-error branch August 28, 2023 12:00
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