Skip to content

Commit 122750a

Browse files
brendan-duncanEvergreen
authored andcommitted
[WebGPU] Disable URP Depth Priming for WebGPU
https://jira.unity3d.com/browse/PLATGRAPH-3470 On Apple Arm64 (M1+) GPUs, depth priming causes significant rendering artifacts for web builds. WebGL had this same issue and disabled Depth Priming support. We should disable Depth Priming support for WebGPU as well. Depth Priming can actually hurt performance on tile based GPUs like mobile, and we don't know what type of GPU you're running on with the web player. It seems reasonable to just disable support all-together for the web.
1 parent 6acf80f commit 122750a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ bool IsDepthPrimingEnabled(UniversalCameraData cameraData)
571571
if (!CanCopyDepth(cameraData))
572572
return false;
573573

574-
// Depth Priming causes rendering errors with WebGL on Apple Arm64 GPUs.
574+
// Depth Priming causes rendering errors with WebGL and WebGPU on Apple Arm64 GPUs.
575575
bool isNotWebGL = !IsWebGL();
576576
bool depthPrimingRequested = (m_DepthPrimingRecommended && m_DepthPrimingMode == DepthPrimingMode.Auto) || m_DepthPrimingMode == DepthPrimingMode.Forced;
577577
bool isForwardRenderingMode = m_RenderingMode == RenderingMode.Forward || m_RenderingMode == RenderingMode.ForwardPlus;
@@ -586,8 +586,9 @@ bool IsDepthPrimingEnabled(UniversalCameraData cameraData)
586586

587587
bool IsWebGL()
588588
{
589+
// Both WebGL and WebGPU have issues with depth priming on Apple Arm64
589590
#if PLATFORM_WEBGL
590-
return IsGLESDevice();
591+
return true;
591592
#else
592593
return false;
593594
#endif

0 commit comments

Comments
 (0)