Skip to content

Conversation

@kolkov
Copy link
Contributor

@kolkov kolkov commented Dec 29, 2025

Summary

Fixes macOS ARM64 (Apple Silicon) rendering issues reported in gogpu/gogpu#24.

Changes

  • Metal Double Present Fix — Remove duplicate [drawable present] call in Queue.Present()

    • presentDrawable: is already scheduled in Submit() before command buffer commit
    • Duplicate present was causing synchronization issues on some Metal drivers
  • goffi v0.3.6 Update — ARM64 ABI fixes for Objective-C struct returns

    • HFA returns (NSRect 4×float64) now work correctly on Apple Silicon
    • Large struct returns (>16 bytes) properly use X8 register
    • GetSize() no longer returns (0,0) on M1/M2/M3/M4 Macs

Test Plan

  • Windows build: go build ./...
  • Linux build: GOOS=linux go build ./...
  • macOS build: GOOS=darwin go build ./...
  • macOS ARM64 runtime: Triangle example renders correctly

Closes

Resolves gogpu/gogpu#24

The presentDrawable: is already called in Submit() before commit.
Calling [drawable present] separately in Present() causes double
presentation which may result in visual artifacts or performance issues.

Now Present() only releases the drawable reference since presentation
was already scheduled during Submit().

Follow-up to aca8688 (Issue gogpu/gogpu#24)
Fixes ARM64 struct return issues on macOS Apple Silicon:
- HFA returns (NSRect 4×float64) now work correctly
- Large struct returns (>16 bytes) use X8 register properly
- GetSize() no longer returns (0,0) on M1/M2/M3/M4 Macs

Addresses: gogpu/gogpu#24
- Metal double present fix
- goffi v0.3.6 with ARM64 fixes
- Resolves gogpu/gogpu#24
kolkov added a commit to gogpu/gogpu that referenced this pull request Dec 29, 2025
Updates dependencies with ARM64 ABI fixes:
- webgpu v0.1.2 → v0.1.3
- goffi v0.3.5 → v0.3.6 (ARM64 struct returns)
- wgpu v0.8.5 → v0.8.6 (pending gogpu/wgpu#29)

Fixes #24
@kolkov kolkov merged commit 5d0d3fa into main Dec 29, 2025
20 checks passed
@kolkov kolkov deleted the fix/macos-arm64-v0.8.6 branch December 29, 2025 09:59
kolkov added a commit to gogpu/gogpu that referenced this pull request Dec 29, 2025
* fix(macos): ARM64 blank window fix (v0.8.7)

Updates dependencies with ARM64 ABI fixes:
- webgpu v0.1.2 → v0.1.3
- goffi v0.3.5 → v0.3.6 (ARM64 struct returns)
- wgpu v0.8.5 → v0.8.6 (pending gogpu/wgpu#29)

Fixes #24

* chore(deps): update wgpu v0.8.5 → v0.8.6
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.

Issues loading triangle example on MacOS Sequoia 15.3.1 (M1 Pro) round 2

2 participants