Skip to content

metal: implement multisample resolve textures - #638

Merged
not-fl3 merged 1 commit into
not-fl3:masterfrom
benface:metal-resolve-textures
Jul 23, 2026
Merged

metal: implement multisample resolve textures#638
not-fl3 merged 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`).
@not-fl3

not-fl3 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Thanks for PR!

@benface

benface commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@not-fl3 – You're welcome. 😁 Did you mean to merge this? hehe

@not-fl3
not-fl3 merged commit abf15ec into not-fl3:master Jul 23, 2026
11 checks passed
@not-fl3

not-fl3 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

oh 😅

@benface

benface commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @not-fl3 <3 By the way, did you get my emails?

@not-fl3

not-fl3 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

@benface Hmm, no, I don't think so.

not.fl3@gmail.com / fedor@elvario.mx

@benface

benface commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

@not-fl3 – Weird!

CleanShot 2026-07-25 at 13 37 46@2x

@not-fl3

not-fl3 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Just triple checked, nothing in the inbox, nothing in spam - searched for anything with "miniquad" in the topic 😿
No idea whats up with the gmail, I wonder how many emails am I missing...

Could you please forward it to fedor@elvario.mx? Or just send it again, maybe it will go through

@benface

benface commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Just sent it to that address @not-fl3, thanks so much for your time.

@not-fl3

not-fl3 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Got it! 🫶

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.

2 participants