Summary
Spark-generated WebGL2 shaders fail to link in Safari specifically on macOS 27.0 Beta 4 (26A5388g).
This is a regression in the Safari ANGLE/Metal shader translator on that beta. It is not a general Spark failure across currently released macOS versions.
Upstream tracking and discussion:
Please use the WebKit issue above for the shared upstream discussion.
Affected environment
- macOS: 27.0 Beta 4 (26A5388g)
- Safari:
27.0 (22625.1.24.11.2)
- Architecture: Apple Silicon / arm64
- Spark:
2.1.0
- Three.js:
r180
- WebGL: WebGL2
Scope
The issue is currently only reproducible in Safari on macOS 27.0 Beta 4.
Chrome 150.0.7871.129 on the same machine successfully links and validates the standalone shader while using ANGLE/Metal.
Actual result
Three.js reports:
THREE.WebGLProgram: Shader Error 1282 - VALIDATE_STATUS false
Safari's underlying Metal compiler reports:
Internal error while linking shader. MSL compilation error:
error: reference to type 'thread float3' could not bind to an lvalue of type '__metal_generic float3'
operator thread T &() { return mTemp; }
^~~~~
Trigger
The failure occurs when multiple GLSL out parameters target members of a struct passed through an inout parameter. Spark generates this pattern while decoding packed splat data:
unpackSplatEncoding(
packed,
gsplat.center,
gsplat.scales,
gsplat.quaternion,
gsplat.rgba
);
Relevant locations:
src/dyno/splats.ts:194
src/SplatPager.ts:700
ANGLE's translated Metal has this form:
_unpack(
ANGLE_out(splat.center),
ANGLE_out(splat.rgba)
);
The ANGLE_Out<T> temporary receives the Metal generic address space, which then cannot bind to the generated thread T& conversion.
Standalone reproduction
A minimal standalone WebGL2 reproduction is attached to the WebKit report:
https://bugs.webkit.org/attachment.cgi?id=480713
It fails in Safari on macOS 27.0 Beta 4 and succeeds in Chrome on the same machine.
Expected result
The valid GLSL ES 3.00 shader should link and validate.
Possible temporary workaround
Decode into local variables first, then assign the results to the struct fields:
vec3 center;
vec3 scales;
vec4 quaternion;
vec4 rgba;
unpackSplatEncoding(packed, center, scales, quaternion, rgba);
gsplat.center = center;
gsplat.scales = scales;
gsplat.quaternion = quaternion;
gsplat.rgba = rgba;
This avoids passing struct members directly through multiple out parameters while the macOS 27.0 Beta 4 regression is being tracked upstream.
Summary
Spark-generated WebGL2 shaders fail to link in Safari specifically on macOS 27.0 Beta 4 (26A5388g).
This is a regression in the Safari ANGLE/Metal shader translator on that beta. It is not a general Spark failure across currently released macOS versions.
Upstream tracking and discussion:
FB23913547Please use the WebKit issue above for the shared upstream discussion.
Affected environment
27.0 (22625.1.24.11.2)2.1.0r180Scope
The issue is currently only reproducible in Safari on macOS 27.0 Beta 4.
Chrome
150.0.7871.129on the same machine successfully links and validates the standalone shader while using ANGLE/Metal.Actual result
Three.js reports:
Safari's underlying Metal compiler reports:
Trigger
The failure occurs when multiple GLSL
outparameters target members of a struct passed through aninoutparameter. Spark generates this pattern while decoding packed splat data:unpackSplatEncoding( packed, gsplat.center, gsplat.scales, gsplat.quaternion, gsplat.rgba );Relevant locations:
src/dyno/splats.ts:194src/SplatPager.ts:700ANGLE's translated Metal has this form:
The
ANGLE_Out<T>temporary receives the Metal generic address space, which then cannot bind to the generatedthread T&conversion.Standalone reproduction
A minimal standalone WebGL2 reproduction is attached to the WebKit report:
https://bugs.webkit.org/attachment.cgi?id=480713
It fails in Safari on macOS 27.0 Beta 4 and succeeds in Chrome on the same machine.
Expected result
The valid GLSL ES 3.00 shader should link and validate.
Possible temporary workaround
Decode into local variables first, then assign the results to the struct fields:
This avoids passing struct members directly through multiple
outparameters while the macOS 27.0 Beta 4 regression is being tracked upstream.