Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.19.6] - 2026-03-05

### Fixed

- **Metal: MSAA resolve store action** — when a render pass has a resolve target
(MSAA → single-sample), Metal requires `MTLStoreActionMultisampleResolve` or
`MTLStoreActionStoreAndMultisampleResolve`. We were setting `MTLStoreActionStore`,
causing Metal to silently skip the resolve. The surface texture stayed
uninitialized (purple/magenta screen).
([ui#23](https://github.com/gogpu/ui/issues/23))

## [0.19.5] - 2026-03-05

### Fixed
Expand Down
11 changes: 10 additions & 1 deletion hal/metal/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,21 @@ func (e *CommandEncoder) BeginRenderPass(desc *hal.RenderPassDescriptor) hal.Ren
clearColor := MTLClearColor{Red: ca.ClearValue.R, Green: ca.ClearValue.G, Blue: ca.ClearValue.B, Alpha: ca.ClearValue.A}
msgSendClearColor(attachment, Sel("setClearColor:"), clearColor)
}
_ = MsgSend(attachment, Sel("setStoreAction:"), uintptr(storeOpToMTL(ca.StoreOp)))
storeAction := storeOpToMTL(ca.StoreOp)
if ca.ResolveTarget != nil {
if rtv, ok := ca.ResolveTarget.(*TextureView); ok && rtv != nil {
_ = MsgSend(attachment, Sel("setResolveTexture:"), uintptr(rtv.raw))
// Metal requires MultisampleResolve store action when a resolve
// texture is set. Without this, Metal silently skips the MSAA
// resolve and the surface stays uninitialized (purple screen).
if storeAction == MTLStoreActionStore {
storeAction = MTLStoreActionStoreAndMultisampleResolve
} else {
storeAction = MTLStoreActionMultisampleResolve
}
}
}
_ = MsgSend(attachment, Sel("setStoreAction:"), uintptr(storeAction))
}
if desc.DepthStencilAttachment != nil {
dsa := desc.DepthStencilAttachment
Expand Down