Skip to content

Fix Xcode 26 C++ build + iPhone 17 Pro depth visualization corruption#57

Open
wonmor wants to merge 1 commit intoStandardCyborg:masterfrom
wonmor:master
Open

Fix Xcode 26 C++ build + iPhone 17 Pro depth visualization corruption#57
wonmor wants to merge 1 commit intoStandardCyborg:masterfrom
wonmor:master

Conversation

@wonmor
Copy link
Copy Markdown

@wonmor wonmor commented May 7, 2026

Summary

Two independent fixes that affect anyone shipping a TrueDepth scanning app on current Apple hardware/toolchains:

  1. C++ compat for Xcode 26 + static linking (671a57e) — addresses build failures in Xcode 26 with the modern C++ toolchain, and switches some targets to static linking to play nicer with downstream Swift apps.

  2. iPhone 17 Pro depth visualization corruption (416bcfa) — the depth CVPixelBuffer-backed MTLTexture in DepthColoringFilter._metalTexture(fromDepthBuffer:) was created with MTLTextureUsage.shaderWrite, but the texture is read (it's the source of an MPSImageGaussianBlur, never a destination). The A17 Pro (iPhone 15 Pro Max) silently tolerated the wrong flag; the A19 GPU on iPhone 17 Pro enforces it strictly and produces blocky purple/blue artifacts on the depth-coloring overlay during scanning. One-line fix: .shaderWrite.shaderRead.

Test plan

  • Builds cleanly in Xcode 26
  • Depth-coloring overlay renders correctly on iPhone 17 Pro front-facing TrueDepth scan
  • No regression on iPhone 15 Pro Max
  • Verify on iPhone 16 Pro / 14 Pro family (older A-series) — expected unaffected

🤖 Generated with Claude Code

Depth CVPixelBuffer-backed Metal texture was created with
MTLTextureUsage.shaderWrite but is actually used as the source of
an MPSImageGaussianBlur (read-only). The A19 GPU on iPhone 17 Pro
enforces this strictly, producing blocky purple/blue artifacts on
the depth-coloring overlay; the A17 Pro silently tolerated the
wrong flag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aaptho
Copy link
Copy Markdown
Collaborator

aaptho commented May 8, 2026

Thanks for the fix! I don’t see your first commit in here, does the build work for you without 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