Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit e8c9732

Browse files
committed
Avoid using R8 texture format on OSX with Metal.
This is a workaround for issue #896121 https://goo.gl/MgKqu6
1 parent 3ab71a1 commit e8c9732

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

PostProcessing/Runtime/Components/DepthOfFieldComponent.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ public void Prepare(RenderTexture source, Material uberMaterial, bool antialiasC
8484
var colorFormat = RenderTextureFormat.ARGBHalf;
8585
var cocFormat = SelectFormat(RenderTextureFormat.R8, RenderTextureFormat.RHalf);
8686

87+
// Avoid using R8 on OSX with Metal. #896121, https://goo.gl/MgKqu6
88+
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
89+
if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal)
90+
cocFormat = SelectFormat(RenderTextureFormat.RHalf, RenderTextureFormat.Default);
91+
#endif
92+
8793
// Material setup
8894
var f = CalculateFocalLength();
8995
var s1 = Mathf.Max(settings.focusDistance, f);

0 commit comments

Comments
 (0)