Are compute shaders for Polyspatial/VisionOS only via Metal?
And is this still true?
“For technical, security, and privacy reasons, visionOS does not allow Metal-based shaders or other low level shading languages to run when using AR passthrough.”
In which case, does this mean compute shaders just don’t work on Unity Polyspatial in XR mode?
Technically, yes, in that HLSL shaders (.compute) in Unity are compiled to Metal shaders as part of the build process. That doesn’t mean that you can only use them when using Metal rendering mode (formerly VR/“fully immersive”), however. You can use compute shaders to, for example, update a RenderTexture and then use that RenderTexture in a material provided to PolySpatial.
First, that’s not true as of visionOS 2.0, because you can use passthrough with Metal-based (non-PolySpatial/RealityKit) rendering. However, it only ever applied to shaders used for rendering directly to the frame buffer (that is, CustomMaterial is not supported for RealityKit on visionOS). Compute shaders could always be used to update RenderTextures, and ShaderLab shaders could always be used to render scenes to RenderTextures using Unity.