[Web GPU] Build fix for MTLStorageMode availability on different Cocoa platforms
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2019 21:39:20 +0000 (21:39 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2019 21:39:20 +0000 (21:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194443

Unreviewed build fix.

For MTLTextures, MTLStorageModeManaged is only available on macOS. Other platforms,
if not using MTLStorageModePrivate, must use MTLStorageModeShared.

Behavior unchanged.

Patch by Justin Fan <justin_fan@apple.com> on 2019-02-08

* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::storageModeForPixelFormatAndSampleCount):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241207 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gpu/cocoa/GPUTextureMetal.mm

index c4446fa..6999cc1 100644 (file)
@@ -1,3 +1,18 @@
+2019-02-08  Justin Fan  <justin_fan@apple.com>
+
+        [Web GPU] Build fix for MTLStorageMode availability on different Cocoa platforms
+        https://bugs.webkit.org/show_bug.cgi?id=194443
+
+        Unreviewed build fix.
+
+        For MTLTextures, MTLStorageModeManaged is only available on macOS. Other platforms,
+        if not using MTLStorageModePrivate, must use MTLStorageModeShared.
+
+        Behavior unchanged.
+
+        * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
+        (WebCore::storageModeForPixelFormatAndSampleCount):
+
 2019-02-08  Per Arne Vollan  <pvollan@apple.com>
 
         [WebVTT] Inline WebVTT styles should start with '::cue'
index d77f3f1..b793e02 100644 (file)
@@ -81,7 +81,11 @@ static MTLStorageMode storageModeForPixelFormatAndSampleCount(MTLPixelFormat for
     if (format == MTLPixelFormatDepth32Float_Stencil8 || samples > 1)
         return MTLStorageModePrivate;
 
+#if PLATFORM(MAC)
     return MTLStorageModeManaged;
+#else
+    return MTLStorageModeShared;
+#endif
 }
 
 static RetainPtr<MTLTextureDescriptor> tryCreateMtlTextureDescriptor(const char* const functionName, const GPUTextureDescriptor&& descriptor)