Skip to content

fix: Metal MSAA resolve store action for surface rendering#94

Merged
kolkov merged 2 commits intomainfrom
fix/metal-msaa-resolve
Mar 5, 2026
Merged

fix: Metal MSAA resolve store action for surface rendering#94
kolkov merged 2 commits intomainfrom
fix/metal-msaa-resolve

Conversation

@kolkov
Copy link
Contributor

@kolkov kolkov commented Mar 5, 2026

Summary

  • Fix Metal MSAA resolve: use MTLStoreActionStoreAndMultisampleResolve when render pass has a resolve target
  • Without this, Metal silently skips the resolve and the surface stays uninitialized (purple screen)
  • Root cause of purple screen on M3 Mac after all crash fixes landed (ui#23)

Changes

  • hal/metal/encoder.go: move setStoreAction after ResolveTarget check, auto-upgrade to resolve action
  • CHANGELOG.md: add v0.19.6 entry

Test plan

  • go build passes
  • go test ./hal/... passes
  • CI green
  • rcarlier confirms rendering works on M3 Mac

kolkov added 2 commits March 5, 2026 20:19
Metal requires MTLStoreActionMultisampleResolve (or StoreAndMultisampleResolve)
when a render pass color attachment has a resolve target. We were using
MTLStoreActionStore, causing Metal to silently skip the MSAA resolve.
The surface texture stayed uninitialized (purple screen on M3 Mac).

Now setStoreAction is called AFTER checking ResolveTarget, and automatically
upgraded to the correct resolve action when a resolve texture is present.
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit 543ecd5 into main Mar 5, 2026
11 checks passed
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