Revise architecture name of Intel GPU in gpu_info.json

We have always used GenXX to name Intel GPU architecture, but
according to the official bspec, after the Gen 11, the architecture
started using Xe/Xe2/Xe3/Xe4, but we still use the GenXX format in
gpu_info.json.

The Xe architecture is also called Gen 12, because many architectures
are classified into it, such as Gen 12LP, Gen 12HP, Gen 12.7 and Xe.
This does not happen with Xe2/3/4 architectures. In order to match the
official architecture naming, we'd like to do the following updates:
Gen12LP(Meteorlake_0x07D00, Arrowlake_0x07D00/0xB600) -> XeLPG
Gen13LP(Lunarlake_0x6400)  -> Xe2LPG
Gen13HP(Battlemage_0xE200) -> Xe2HPG
Gen14(Pantherlake_0xB000)  -> Xe3LPG

Bug: 368085621

Change-Id: I8ac7c280ad4f6add32fc3885d31314caa8172a10
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/220754
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn/common/GPUInfo.cpp b/src/dawn/common/GPUInfo.cpp
index 3b97b3a..8900109 100644
--- a/src/dawn/common/GPUInfo.cpp
+++ b/src/dawn/common/GPUInfo.cpp
@@ -115,14 +115,6 @@
     return (deviceId & 0xFF00) == 0x1900;
 }
 
-bool IsAlchemist(PCIDeviceID deviceId) {
-    return (deviceId & 0xFF00) == 0x5600;
-}
-
-bool IsMeteorlakeOrArrowlake(PCIDeviceID deviceId) {
-    return (deviceId & 0xFF00) == 0x7D00;
-}
-
 bool IsIrisPlus655(PCIDeviceID deviceId) {
     return std::find(IrisPlus655.cbegin(), IrisPlus655.cend(), deviceId) != IrisPlus655.cend();
 }
diff --git a/src/dawn/common/GPUInfo.h b/src/dawn/common/GPUInfo.h
index e2f7e92..7eed4b7 100644
--- a/src/dawn/common/GPUInfo.h
+++ b/src/dawn/common/GPUInfo.h
@@ -73,8 +73,6 @@
 
 // Intel architectures
 bool IsSkylake(PCIDeviceID deviceId);
-bool IsAlchemist(PCIDeviceID deviceId);
-bool IsMeteorlakeOrArrowlake(PCIDeviceID deviceId);
 bool IsIrisPlus655(PCIDeviceID deviceId);
 
 bool IsIntelGen11OrOlder(PCIVendorID venderId, PCIDeviceID deviceId);
diff --git a/src/dawn/gpu_info.json b/src/dawn/gpu_info.json
index 83aacd6..13deeff 100644
--- a/src/dawn/gpu_info.json
+++ b/src/dawn/gpu_info.json
@@ -190,11 +190,12 @@
           "Gen 8": ["0x1600", "0x2200"],
           "Gen 9": ["0x1900", "0x3100", "0x3E00", "0x5A00", "0x5900", "0x8700", "0x9B00"],
           "Gen 11": ["0x8A00", "0x4E00", "0x9800"],
-          "Gen 12 LP": ["0x4600", "0x4C00", "0x4900", "0x9A00", "0xA700", "0x7D00"],
+          "Gen 12 LP": ["0x4600", "0x4C00", "0x4900", "0x9A00", "0xA700"],
           "Gen 12 HP": ["0x4F00", "0x5600"],
-          "Gen 13 LP": ["0x6400"],
-          "Gen 13 HP": ["0xE200"],
-          "Gen 14 LP": ["0xB000"]
+          "Xe LPG": ["0x7D00", "0xB600"],
+          "Xe 2 LPG": ["0x6400"],
+          "Xe 2 HPG": ["0xE200"],
+          "Xe 3 LPG": ["0xB000"]
         }
       }]
     },
diff --git a/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp b/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
index 7774889..d422ab8 100644
--- a/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
+++ b/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
@@ -689,17 +689,19 @@
         }
     }
 
-    // Currently this workaround is only needed on Intel Gen9, Gen9.5 and Gen12 GPUs.
+    // Currently this workaround is only needed on Intel Gen9, Gen9.5, Gen12 and Xe GPUs.
     // See http://crbug.com/dawn/1487 for more information.
     if (gpu_info::IsIntelGen9(vendorId, deviceId) || gpu_info::IsIntelGen12LP(vendorId, deviceId) ||
-        gpu_info::IsIntelGen12HP(vendorId, deviceId)) {
+        gpu_info::IsIntelGen12HP(vendorId, deviceId) ||
+        gpu_info::IsIntelXeLPG(vendorId, deviceId)) {
         deviceToggles->Default(Toggle::D3D12ForceClearCopyableDepthStencilTextureOnCreation, true);
     }
 
-    // Currently this workaround is only needed on Intel Gen12 GPUs.
+    // Currently this workaround is only needed on Intel Gen12 and Xe GPUs.
     // See http://crbug.com/dawn/1487 for more information.
     if (gpu_info::IsIntelGen12LP(vendorId, deviceId) ||
-        gpu_info::IsIntelGen12HP(vendorId, deviceId)) {
+        gpu_info::IsIntelGen12HP(vendorId, deviceId) ||
+        gpu_info::IsIntelXeLPG(vendorId, deviceId)) {
         deviceToggles->Default(Toggle::D3D12DontSetClearValueOnDepthTextureCreation, true);
     }
 
@@ -742,7 +744,8 @@
 
     // B2T copy failed with stencil8 format on Intel ACM/MTL/ARL GPUs. See
     // https://issues.chromium.org/issues/368085621 for more information.
-    if (gpu_info::IsAlchemist(deviceId) || gpu_info::IsMeteorlakeOrArrowlake(deviceId)) {
+    if (gpu_info::IsIntelGen12HP(vendorId, deviceId) ||
+        gpu_info::IsIntelXeLPG(vendorId, deviceId)) {
         deviceToggles->Default(Toggle::UseBlitForBufferToStencilTextureCopy, true);
     }
 
diff --git a/src/dawn/tests/DawnTest.cpp b/src/dawn/tests/DawnTest.cpp
index 3f05287..f1cf502 100644
--- a/src/dawn/tests/DawnTest.cpp
+++ b/src/dawn/tests/DawnTest.cpp
@@ -926,6 +926,19 @@
                                     mParam.adapterProperties.deviceID);
 }
 
+bool DawnTestBase::IsIntelGen12OrLater() const {
+    return gpu_info::IsIntelGen12LP(mParam.adapterProperties.vendorID,
+                                    mParam.adapterProperties.deviceID) ||
+           gpu_info::IsIntelGen12HP(mParam.adapterProperties.vendorID,
+                                    mParam.adapterProperties.deviceID) ||
+           gpu_info::IsIntelXeLPG(mParam.adapterProperties.vendorID,
+                                  mParam.adapterProperties.deviceID) ||
+           gpu_info::IsIntelXe2LPG(mParam.adapterProperties.vendorID,
+                                   mParam.adapterProperties.deviceID) ||
+           gpu_info::IsIntelXe2HPG(mParam.adapterProperties.vendorID,
+                                   mParam.adapterProperties.deviceID);
+}
+
 bool DawnTestBase::IsWindows() const {
 #if DAWN_PLATFORM_IS(WINDOWS)
     return true;
diff --git a/src/dawn/tests/DawnTest.h b/src/dawn/tests/DawnTest.h
index d964f82..b1b69f1 100644
--- a/src/dawn/tests/DawnTest.h
+++ b/src/dawn/tests/DawnTest.h
@@ -273,6 +273,7 @@
 
     bool IsIntelGen9() const;
     bool IsIntelGen12() const;
+    bool IsIntelGen12OrLater() const;
 
     bool IsWindows() const;
     bool IsLinux() const;
diff --git a/src/dawn/tests/end2end/QueryTests.cpp b/src/dawn/tests/end2end/QueryTests.cpp
index ca26430..75ebae3 100644
--- a/src/dawn/tests/end2end/QueryTests.cpp
+++ b/src/dawn/tests/end2end/QueryTests.cpp
@@ -431,8 +431,8 @@
 // Test setting an occlusion query to non-zero, then rewriting it without drawing, resolves to 0.
 // Do the two queries+resolves in separate submits.
 TEST_P(OcclusionQueryTests, RewriteNoDrawToZeroSeparateSubmit) {
-    // TODO(dawn:1870): D3D11_QUERY_OCCLUSION_PREDICATE doesn't work on Intel Gen12.
-    DAWN_SUPPRESS_TEST_IF(IsD3D11() && IsIntelGen12());
+    // TODO(dawn:1870): D3D11_QUERY_OCCLUSION_PREDICATE doesn't work on Intel Gen12 and Xe GPUs.
+    DAWN_SUPPRESS_TEST_IF(IsD3D11() && IsIntelGen12OrLater());
 
     constexpr uint32_t kQueryCount = 1;