Skip to content

Commit be65be3

Browse files
taublastmattleibow
authored andcommitted
Hotfix metal for ios 15 and lower
1 parent 93817bb commit be65be3

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

source/SkiaSharp.Views/SkiaSharp.Views/Platform/Apple/SKMetalView.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,20 @@ private void Initialize()
9292

9393
ColorPixelFormat = MTLPixelFormat.BGRA8Unorm;
9494
DepthStencilPixelFormat = MTLPixelFormat.Depth32Float_Stencil8;
95-
if (DepthStencilModePrivate)
95+
nuint sampling = 1;
96+
if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(16, 0))
9697
{
97-
DepthStencilStorageMode = MTLStorageMode.Private;
98-
SampleCount = 4;
99-
}
100-
else
101-
{
102-
DepthStencilStorageMode = MTLStorageMode.Shared;
103-
SampleCount = 2;
98+
if (DepthStencilModePrivate)
99+
{
100+
DepthStencilStorageMode = MTLStorageMode.Private;
101+
sampling = 4;
102+
}
103+
else
104+
{
105+
DepthStencilStorageMode = MTLStorageMode.Shared;
106+
}
104107
}
108+
SampleCount = sampling;
105109
FramebufferOnly = false;
106110
Device = device;
107111
backendContext = new GRMtlBackendContext

0 commit comments

Comments
 (0)