infra: only use Mac-11 bots for cmake-mac-* builders

CMake build runs Tint's e2e tests, which requires that texel fetch be
supported by the metal compiler (xcrun) for WGSL's
'chromium_experimental_framebuffer_fetch' feature.

Bug: dawn:2435
Change-Id: I9a6b6a38a754c3398b5ae70f0dd313f48d8be4d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/178900
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/infra/config/global/generated/cr-buildbucket.cfg b/infra/config/global/generated/cr-buildbucket.cfg
index 74f339e..51f77e7 100644
--- a/infra/config/global/generated/cr-buildbucket.cfg
+++ b/infra/config/global/generated/cr-buildbucket.cfg
@@ -128,7 +128,7 @@
       name: "cmake-mac-dbg"
       swarming_host: "chromium-swarm.appspot.com"
       dimensions: "cpu:x86-64"
-      dimensions: "os:Mac-10.15|Mac-11"
+      dimensions: "os:Mac-11"
       dimensions: "pool:luci.flex.ci"
       recipe {
         name: "dawn/cmake"
@@ -151,7 +151,7 @@
       name: "cmake-mac-rel"
       swarming_host: "chromium-swarm.appspot.com"
       dimensions: "cpu:x86-64"
-      dimensions: "os:Mac-10.15|Mac-11"
+      dimensions: "os:Mac-11"
       dimensions: "pool:luci.flex.ci"
       recipe {
         name: "dawn/cmake"
@@ -586,7 +586,7 @@
       name: "cmake-mac-dbg"
       swarming_host: "chromium-swarm.appspot.com"
       dimensions: "cpu:x86-64"
-      dimensions: "os:Mac-10.15|Mac-11"
+      dimensions: "os:Mac-11"
       dimensions: "pool:luci.flex.try"
       recipe {
         name: "dawn/cmake"
@@ -610,7 +610,7 @@
       name: "cmake-mac-rel"
       swarming_host: "chromium-swarm.appspot.com"
       dimensions: "cpu:x86-64"
-      dimensions: "os:Mac-10.15|Mac-11"
+      dimensions: "os:Mac-11"
       dimensions: "pool:luci.flex.try"
       recipe {
         name: "dawn/cmake"
diff --git a/infra/config/global/main.star b/infra/config/global/main.star
index cc666dc..3e5c5be 100755
--- a/infra/config/global/main.star
+++ b/infra/config/global/main.star
@@ -138,15 +138,31 @@
     WINDOWS = "Windows",
 )
 
-def os_enum(dimension, category, console_name):
-    return struct(dimension = dimension, category = category, console_name = console_name)
+def os_enum(category, console_name):
+    return struct(category = category, console_name = console_name)
 
 os = struct(
-    LINUX = os_enum("Ubuntu-18.04", os_category.LINUX, "linux"),
-    MAC = os_enum("Mac-10.15|Mac-11", os_category.MAC, "mac"),
-    WINDOWS = os_enum("Windows-10", os_category.WINDOWS, "win"),
+    LINUX = os_enum(os_category.LINUX, "linux"),
+    MAC = os_enum(os_category.MAC, "mac"),
+    WINDOWS = os_enum(os_category.WINDOWS, "win"),
 )
 
+def get_dimension(os, builder_name = None):
+    """Returns the dimension to use for the input os and optional builder name"""
+    if os.category == os_category.LINUX:
+        return "Ubuntu-18.04"
+    elif os.category == os_category.MAC:
+        if "cmake" in builder_name:
+            # CMake build runs Tint e2e tests, which must run on 11+ where the metal
+            # compiler (xcrun) supports texel fetch (chromium_experimental_framebuffer_fetch)
+            return "Mac-11"
+        else:
+            return "Mac-10.15|Mac-11"
+    elif os.category == os_category.WINDOWS:
+        return "Windows-10"
+
+    return "Invalid Dimension"
+
 reclient = struct(
     instance = struct(
         DEFAULT_TRUSTED = "rbe-chromium-trusted",
@@ -239,7 +255,7 @@
         caches.append(swarming.cache(name = "osx_sdk", path = "osx_sdk"))
     return caches
 
-def get_default_dimensions(os):
+def get_default_dimensions(os, builder_name):
     """Get dimensions for a builder that don't depend on being CI vs Try
 
     Args:
@@ -252,7 +268,7 @@
 
     # We have 32bit test configurations but some of our toolchain is 64bit (like CIPD)
     dimensions["cpu"] = "x86-64"
-    dimensions["os"] = os.dimension
+    dimensions["os"] = get_dimension(os, builder_name)
 
     return dimensions
 
@@ -290,7 +306,7 @@
     clang = properties["clang"]
     fuzzer = ("gen_fuzz_corpus" in properties) and properties["gen_fuzz_corpus"]
 
-    dimensions_ci = get_default_dimensions(os)
+    dimensions_ci = get_default_dimensions(os, name)
     dimensions_ci["pool"] = "luci.flex.ci"
     properties_ci = get_common_properties(
         os,
@@ -328,7 +344,7 @@
     """
     clang = properties["clang"]
 
-    dimensions_try = get_default_dimensions(os)
+    dimensions_try = get_default_dimensions(os, name)
     dimensions_try["pool"] = "luci.flex.try"
     properties_try = get_common_properties(
         os,
@@ -661,7 +677,7 @@
     executable = get_presubmit_executable(),
     dimensions = {
         "cpu": "x86-64",
-        "os": os.LINUX.dimension,
+        "os": get_dimension(os.LINUX),
         "pool": "luci.flex.try",
     },
     properties = {
@@ -687,7 +703,7 @@
     execution_timeout = 9 * time.hour,
     dimensions = {
         "cpu": "x86-64",
-        "os": os.LINUX.dimension,
+        "os": get_dimension(os.LINUX),
         "pool": "luci.flex.ci",
     },
     properties = {