[dawn] Pre-include vulkan_platform.h in some tests
This prevents some macros defined by X11 from clashing with certain
gtest identifiers.
Fixed: 403011483
Change-Id: I5c71d5bf7a11d5bc76444a4d172d0b04c8a29adc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/230594
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/src/dawn/tests/end2end/AdapterEnumerationTests.cpp b/src/dawn/tests/end2end/AdapterEnumerationTests.cpp
index 5107759..f9d78aa 100644
--- a/src/dawn/tests/end2end/AdapterEnumerationTests.cpp
+++ b/src/dawn/tests/end2end/AdapterEnumerationTests.cpp
@@ -36,6 +36,9 @@
#include "dawn/native/DawnNative.h"
#if defined(DAWN_ENABLE_BACKEND_VULKAN)
+// This must be above VulkanBackend.h otherwise vulkan.h will be included before we can wrap it with
+// vulkan_platform.h.
+#include "dawn/common/vulkan_platform.h"
#include "dawn/native/VulkanBackend.h"
#endif // defined(DAWN_ENABLE_BACKEND_VULKAN)
diff --git a/src/dawn/tests/end2end/YCbCrInfoTests.cpp b/src/dawn/tests/end2end/YCbCrInfoTests.cpp
index f71143a..4fa75e8 100644
--- a/src/dawn/tests/end2end/YCbCrInfoTests.cpp
+++ b/src/dawn/tests/end2end/YCbCrInfoTests.cpp
@@ -27,6 +27,10 @@
#include <vector>
+// This must be above VulkanBackend.h otherwise vulkan.h will be included before we can wrap it with
+// vulkan_platform.h.
+#include "dawn/common/vulkan_platform.h"
+
#include "dawn/native/VulkanBackend.h"
#include "dawn/tests/DawnTest.h"
#include "dawn/utils/WGPUHelpers.h"
diff --git a/src/dawn/tests/white_box/SharedTextureMemoryTests_dmabuf.cpp b/src/dawn/tests/white_box/SharedTextureMemoryTests_dmabuf.cpp
index 1c2d1ab..576d2e8 100644
--- a/src/dawn/tests/white_box/SharedTextureMemoryTests_dmabuf.cpp
+++ b/src/dawn/tests/white_box/SharedTextureMemoryTests_dmabuf.cpp
@@ -28,7 +28,6 @@
#include <fcntl.h>
#include <gbm.h>
#include <unistd.h>
-#include <vulkan/vulkan.h>
#include <webgpu/webgpu_cpp.h>
#include <memory>
@@ -36,6 +35,9 @@
#include <utility>
#include <vector>
+// This must be included instead of vulkan.h so that we can wrap it with vulkan_platform.h.
+#include "dawn/common/vulkan_platform.h"
+
#include "dawn/tests/white_box/SharedTextureMemoryTests.h"
namespace dawn {