Unreviewed build fixes since MTLClampToBorderColor is only supported on macOS.
authorjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Mar 2019 00:18:59 +0000 (00:18 +0000)
committerjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Mar 2019 00:18:59 +0000 (00:18 +0000)
* Modules/webgpu/GPUSamplerDescriptor.idl:
* platform/graphics/gpu/GPUSamplerDescriptor.h:
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Forgot include.
* platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
(WebCore::mtlAddressModeForAddressMode):
(WebCore::tryCreateMtlSamplerState):
(WebCore::mtlBorderColorForBorderColor): Deleted.

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

Source/WebCore/ChangeLog
Source/WebCore/Modules/webgpu/GPUSamplerDescriptor.idl
Source/WebCore/platform/graphics/gpu/GPUSamplerDescriptor.h
Source/WebCore/platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm
Source/WebCore/platform/graphics/gpu/cocoa/GPUSamplerMetal.mm

index c313591..da2489c 100644 (file)
@@ -1,5 +1,17 @@
 2019-03-07  Justin Fan  <justin_fan@apple.com>
 
+        Unreviewed build fixes since MTLClampToBorderColor is only supported on macOS.
+
+        * Modules/webgpu/GPUSamplerDescriptor.idl:
+        * platform/graphics/gpu/GPUSamplerDescriptor.h:
+        * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Forgot include.
+        * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
+        (WebCore::mtlAddressModeForAddressMode):
+        (WebCore::tryCreateMtlSamplerState):
+        (WebCore::mtlBorderColorForBorderColor): Deleted.
+
+2019-03-07  Justin Fan  <justin_fan@apple.com>
+
         [Web GPU] GPUSampler implementation
         https://bugs.webkit.org/show_bug.cgi?id=195427
         <rdar://problem/48686011>
index 48bacd4..1d1b5bb 100644 (file)
@@ -29,8 +29,7 @@ typedef unsigned long u32;
 enum GPUAddressMode {
     "clamp-to-edge",
     "repeat",
-    "mirror-repeat",
-    "clamp-to-border-color"
+    "mirror-repeat"
 };
 
 enum GPUFilterMode {
@@ -38,12 +37,6 @@ enum GPUFilterMode {
     "linear"
 };
 
-enum GPUBorderColor {
-    "transparent-black",
-    "opaque-black",
-    "opaque-white"
-};
-
 [
     Conditional=WEBGPU,
     EnabledAtRuntime=WebGPU
@@ -58,5 +51,4 @@ enum GPUBorderColor {
     float lodMaxClamp = 0xffffffff; // TODO: What should this be? Was Number.MAX_VALUE.
     u32 maxAnisotropy = 1;
     GPUCompareFunction compareFunction = "never";
-    GPUBorderColor borderColor = "transparentBlack";
 };
index e70431d..79ce08b 100644 (file)
@@ -36,7 +36,6 @@ struct GPUSamplerDescriptor {
         ClampToEdge,
         Repeat,
         MirrorRepeat,
-        ClampToBorderColor,
     };
 
     enum class FilterMode {
@@ -44,12 +43,6 @@ struct GPUSamplerDescriptor {
         Linear,
     };
 
-    enum class BorderColor {
-        TransparentBlack,
-        OpaqueBlack,
-        OpaqueWhite,
-    };
-
     AddressMode addressModeU { AddressMode::ClampToEdge };
     AddressMode addressModeV { AddressMode::ClampToEdge };
     AddressMode addressModeW { AddressMode::ClampToEdge };
@@ -60,7 +53,6 @@ struct GPUSamplerDescriptor {
     float lodMaxClamp { 0xffffffff };
     unsigned maxAnisotropy { 1 };
     GPUCompareFunction compareFunction { GPUCompareFunction::Never };
-    BorderColor borderColor { BorderColor::TransparentBlack };
 };
 
 } // namespace WebCore
index 4500847..915ab62 100644 (file)
@@ -30,6 +30,7 @@
 
 #import "GPUBindGroup.h"
 #import "GPUBindGroupLayoutBinding.h"
+#import "GPUCommandBuffer.h"
 #import "Logging.h"
 #import <Metal/Metal.h>
 #import <wtf/BlockObjCExceptions.h>
index b412854..e6c6339 100644 (file)
@@ -46,22 +46,6 @@ static MTLSamplerAddressMode mtlAddressModeForAddressMode(GPUSamplerDescriptor::
         return MTLSamplerAddressModeRepeat;
     case GPUSamplerDescriptor::AddressMode::MirrorRepeat:
         return MTLSamplerAddressModeMirrorRepeat;
-    case GPUSamplerDescriptor::AddressMode::ClampToBorderColor:
-        return MTLSamplerAddressModeClampToBorderColor;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-static MTLSamplerBorderColor mtlBorderColorForBorderColor(GPUSamplerDescriptor::BorderColor color)
-{
-    switch (color) {
-    case GPUSamplerDescriptor::BorderColor::TransparentBlack:
-        return MTLSamplerBorderColorTransparentBlack;
-    case GPUSamplerDescriptor::BorderColor::OpaqueBlack:
-        return MTLSamplerBorderColorOpaqueBlack;
-    case GPUSamplerDescriptor::BorderColor::OpaqueWhite:
-        return MTLSamplerBorderColorOpaqueWhite;
     }
 
     ASSERT_NOT_REACHED();
@@ -115,7 +99,6 @@ static RetainPtr<MTLSamplerState> tryCreateMtlSamplerState(const GPUDevice& devi
     [mtlDescriptor setRAddressMode:mtlAddressModeForAddressMode(descriptor.addressModeU)];
     [mtlDescriptor setSAddressMode:mtlAddressModeForAddressMode(descriptor.addressModeV)];
     [mtlDescriptor setTAddressMode:mtlAddressModeForAddressMode(descriptor.addressModeW)];
-    [mtlDescriptor setBorderColor:mtlBorderColorForBorderColor(descriptor.borderColor)];
     [mtlDescriptor setMinFilter:mtlMinMagFilterForFilterMode(descriptor.minFilter)];
     [mtlDescriptor setMagFilter:mtlMinMagFilterForFilterMode(descriptor.magFilter)];
     [mtlDescriptor setMipFilter:mtlMipFilterForFilterMode(descriptor.mipmapFilter)];