Skip to content

metal: implement multisample resolve textures#638

Open
benface wants to merge 1 commit into
not-fl3:masterfrom
benface:metal-resolve-textures
Open

metal: implement multisample resolve textures#638
benface wants to merge 1 commit into
not-fl3:masterfrom
benface:metal-resolve-textures

Conversation

@benface

@benface benface commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Problem

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:

PanicHookInfo { ... location: Location { file: ".../graphics/metal.rs", line: 568 } }
thread caused non-unwinding panic. aborting.

Fix

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).

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.

`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`).
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