| author | |
| committer | |
| log | 5ea5a80a83c21c50f97f0851a8bd2cb9871f413a |
| tree | 0dfd977a01f4f212f9fd4f3864da97ca3ba3783c |
| parent | 324ddda3146d54cc7195a67ef5506e93674085ba |
| signature | Signed by PGP key B5690EEEBB952194 |
2 files changed, 7 insertions(+), 6 deletions(-)
apps/marketing/src/lib/macArch.test.ts+5-2| ... | ... | @@ -13,8 +13,11 @@ describe("macArchFromGpuRenderer", () => { |
| 13 | 13 | ); |
| 14 | 14 | }); |
| 15 | 15 | |
| 16 | it("uses x64 for ambiguous Safari and unavailable renderer values", () => { | |
| 17 | expect(macArchFromGpuRenderer("Apple GPU")).toBe("x64"); | |
| 16 | it("detects Safari's generic Apple Silicon renderer", () => { | |
| 17 | expect(macArchFromGpuRenderer("Apple GPU")).toBe("arm64"); | |
| 18 | }); | |
| 19 | ||
| 20 | it("uses x64 when the renderer is unavailable", () => { | |
| 18 | 21 | expect(macArchFromGpuRenderer("")).toBe("x64"); |
| 19 | 22 | }); |
| 20 | 23 | }); |
apps/marketing/src/lib/macArch.ts+2-4| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | const INTEL_GPU_PATTERN = /intel|amd|radeon|nvidia|geforce/i; |
| 2 | const APPLE_SILICON_GPU_PATTERN = /\bapple\s+m\d/i; | |
| 2 | const APPLE_SILICON_GPU_PATTERN = /\bapple\s+(?:m\d|gpu)\b/i; | |
| 3 | 3 | |
| 4 | 4 | export function macArchFromGpuRenderer(renderer: string): "arm64" | "x64" { |
| 5 | 5 | if (INTEL_GPU_PATTERN.test(renderer)) { |
| ... | ... | @@ -9,8 +9,6 @@ export function macArchFromGpuRenderer(renderer: string): "arm64" | "x64" { |
| 9 | 9 | return "arm64"; |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | // Generic "Apple GPU" renderers are ambiguous on Safari. x64 is the safe | |
| 13 | // fallback because Apple Silicon can run it through Rosetta, while Intel | |
| 14 | // Macs cannot run an arm64 build. | |
| 12 | // Keep the fallback compatible with Intel Macs when WebGL is unavailable. | |
| 15 | 13 | return "x64"; |
| 16 | 14 | } |