metal: implement multisample resolve textures#638
Open
benface wants to merge 1 commit into
Open
Conversation
`new_render_pass_mrt` accepts an optional `resolve_img` slice (per-color-attachment resolve target) but unconditionally panics with `unimplemented!` when any caller passes one. macroquad's MSAA render targets do pass them, so any app with `sample_count > 1` aborts on the first render-target construction. Wire each `resolve_img[i]` to the matching color attachment's `resolveTexture` and flip the store action to `MultisampleResolve`. The non-resolve path is unchanged (`StoreAction = Store`).
This was referenced Jun 13, 2026
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.
Problem
new_render_pass_mrtaccepts an optionalresolve_imgslice (per-color-attachment resolve target) but unconditionally panics withunimplemented!when any caller passes one. macroquad's MSAA render targets do pass them, so any app withsample_count > 1aborts on the first render-target construction:Fix
Wire each
resolve_img[i]to the matching color attachment'sresolveTextureand flip the store action toMultisampleResolve. The non-resolve path is unchanged (StoreAction = Store).Asserts the resolve slice length matches the color slice — the per-index pairing is implicit in the API and a length mismatch would silently drop or out-of-bounds otherwise.
Tested on
iPhone 17 simulator on iOS 27 beta — a macroquad app with
sample_count: 4(creating MSAA render targets) no longer aborts on first construction.