Skip to content

Fix: restrict Metal foveated rendering to VisionOS (#867) - #868

Open
sindharta-tanuwijaya wants to merge 5 commits into
masterfrom
visionos
Open

Fix: restrict Metal foveated rendering to VisionOS (#867)#868
sindharta-tanuwijaya wants to merge 5 commits into
masterfrom
visionos

Conversation

@sindharta-tanuwijaya

Copy link
Copy Markdown
Contributor
  • fix: restrict Metal foveated rendering to visionOS target platforms

  • fix: restrict Metal foveated rendering to visionOS (Tessellation)

* fix: restrict Metal foveated rendering to visionOS target platforms

* fix: restrict Metal foveated rendering to visionOS (Tessellation)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restricts the SUPPORTS_FOVEATED_RENDERING_NON_UNIFORM_RASTER path so that Metal-only foveated rendering is no longer enabled broadly on Apple Metal targets, and is instead gated to visionOS (while keeping PS5 enabled). This aligns the shader feature with the PR’s stated intent of limiting Metal foveated rendering to visionOS.

Changes:

  • Updated #if guards so SHADER_API_METAL only enables the foveated rendering non-uniform raster path when UNITY_VISIONOS is also defined.
  • Applied the same platform restriction in both the standard Toon shader and the tessellation variant.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
com.unity.toonshader/Runtime/Shaders/UnityToon.shader Gates Metal foveated rendering support behind UNITY_VISIONOS (PS5 unchanged).
com.unity.toonshader/Runtime/Shaders/UnityToonTessellation.shader Mirrors the same Metal+visionOS restriction for the tessellation shader.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 1103 to 1107
#if (!defined(UNITY_COMPILER_DXC) && (defined(UNITY_PLATFORM_OSX) || defined(UNITY_PLATFORM_IOS))) || defined(SHADER_API_PS5)

#if defined(SHADER_API_PS5) || defined(SHADER_API_METAL)
#if defined(SHADER_API_PS5) || (defined(SHADER_API_METAL) && defined(UNITY_VISIONOS))

#define SUPPORTS_FOVEATED_RENDERING_NON_UNIFORM_RASTER 1
Comment on lines 1242 to 1246
#if (!defined(UNITY_COMPILER_DXC) && (defined(UNITY_PLATFORM_OSX) || defined(UNITY_PLATFORM_IOS))) || defined(SHADER_API_PS5)

#if defined(SHADER_API_PS5) || defined(SHADER_API_METAL)
#if defined(SHADER_API_PS5) || (defined(SHADER_API_METAL) && defined(UNITY_VISIONOS))

#define SUPPORTS_FOVEATED_RENDERING_NON_UNIFORM_RASTER 1
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.

4 participants