Commit 515e03a0 authored by Austin Eng's avatar Austin Eng Committed by Commit Bot

Skip WebGPU and Dawn tests on AMD R7 240

This bot's Vulkan driver is unreliable.
See crbug.com/941685, crbug.com/915430

Bug: 1139366
Change-Id: I5cfab5c09efc7494c7c144a6f6dcb3d3d775aa0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2480584
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: default avatarAustin Eng <enga@chromium.org>
Reviewed-by: default avatarKramer Ge <fangzhoug@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818010}
parent b8186674
......@@ -41,7 +41,15 @@ namespace {
class ExternalVkImageFactoryTest : public testing::Test {
protected:
bool VulkanSupported() const {
// crbug.com(941685, 1139366): Vulkan driver crashes on Linux FYI Release
// (AMD R7 240).
return !GPUTestBotConfig::CurrentConfigMatches("Linux AMD");
}
void SetUp() override {
if (!VulkanSupported()) {
return;
}
// Set up the Vulkan implementation and context provider.
vulkan_implementation_ = gpu::CreateVulkanImplementation();
DCHECK(vulkan_implementation_) << "Failed to create Vulkan implementation";
......@@ -129,6 +137,10 @@ class ExternalVkImageFactoryTest : public testing::Test {
#if BUILDFLAG(USE_DAWN)
TEST_F(ExternalVkImageFactoryTest, DawnWrite_SkiaVulkanRead) {
if (!VulkanSupported()) {
DLOG(ERROR) << "Test skipped because Vulkan isn't supported.";
return;
}
// Create a backing using mailbox.
auto mailbox = Mailbox::GenerateForSharedImage();
const auto format = viz::ResourceFormat::RGBA_8888;
......@@ -242,6 +254,10 @@ TEST_F(ExternalVkImageFactoryTest, DawnWrite_SkiaVulkanRead) {
}
TEST_F(ExternalVkImageFactoryTest, SkiaVulkanWrite_DawnRead) {
if (!VulkanSupported()) {
DLOG(ERROR) << "Test skipped because Vulkan isn't supported.";
return;
}
// Create a backing using mailbox.
auto mailbox = Mailbox::GenerateForSharedImage();
const auto format = viz::ResourceFormat::RGBA_8888;
......
......@@ -40,6 +40,10 @@ class SharedImageGLBackingProduceDawnTest : public WebGPUTest {
WebGPUTest::Options option;
Initialize(option);
if (ShouldSkipTest()) {
return;
}
gpu::ContextCreationAttribs attributes;
attributes.alpha_size = 8;
attributes.depth_size = 24;
......
......@@ -39,8 +39,6 @@ WebGPUTest::WebGPUTest() = default;
WebGPUTest::~WebGPUTest() = default;
bool WebGPUTest::WebGPUSupported() const {
DCHECK(is_initialized_); // Did you call WebGPUTest::Initialize?
// crbug.com(941685): Vulkan driver crashes on Linux FYI Release (AMD R7 240).
// Win7 does not support WebGPU
if (GPUTestBotConfig::CurrentConfigMatches("Linux AMD") ||
......@@ -63,6 +61,10 @@ bool WebGPUTest::WebGPUSharedImageSupported() const {
}
void WebGPUTest::SetUp() {
if (!WebGPUSupported()) {
return;
}
gpu::GpuPreferences gpu_preferences;
gpu_preferences.enable_webgpu = true;
#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && BUILDFLAG(USE_DAWN)
......@@ -81,8 +83,6 @@ void WebGPUTest::TearDown() {
}
void WebGPUTest::Initialize(const Options& options) {
is_initialized_ = true;
if (!WebGPUSupported()) {
return;
}
......@@ -175,25 +175,25 @@ WebGPUTest::DeviceAndClientID WebGPUTest::GetNewDeviceAndClientID() {
}
TEST_F(WebGPUTest, FlushNoCommands) {
Initialize(WebGPUTest::Options());
if (!WebGPUSupported()) {
LOG(ERROR) << "Test skipped because WebGPU isn't supported";
return;
}
Initialize(WebGPUTest::Options());
webgpu()->FlushCommands();
}
// Referred from GLES2ImplementationTest/ReportLoss
TEST_F(WebGPUTest, ReportLoss) {
Initialize(WebGPUTest::Options());
if (!WebGPUSupported()) {
LOG(ERROR) << "Test skipped because WebGPU isn't supported";
return;
}
Initialize(WebGPUTest::Options());
GpuControlClient* webgpu_as_client = webgpu();
int lost_count = 0;
webgpu()->SetLostContextCallback(base::BindOnce(&CountCallback, &lost_count));
......@@ -207,13 +207,13 @@ TEST_F(WebGPUTest, ReportLoss) {
// Referred from GLES2ImplementationTest/ReportLossReentrant
TEST_F(WebGPUTest, ReportLossReentrant) {
Initialize(WebGPUTest::Options());
if (!WebGPUSupported()) {
LOG(ERROR) << "Test skipped because WebGPU isn't supported";
return;
}
Initialize(WebGPUTest::Options());
GpuControlClient* webgpu_as_client = webgpu();
int lost_count = 0;
webgpu()->SetLostContextCallback(base::BindOnce(&CountCallback, &lost_count));
......@@ -226,13 +226,13 @@ TEST_F(WebGPUTest, ReportLossReentrant) {
}
TEST_F(WebGPUTest, RequestAdapterAfterContextLost) {
Initialize(WebGPUTest::Options());
if (!WebGPUSupported()) {
LOG(ERROR) << "Test skipped because WebGPU isn't supported";
return;
}
Initialize(WebGPUTest::Options());
webgpu()->OnGpuControlLostContext();
ASSERT_FALSE(
webgpu()->RequestAdapterAsync(webgpu::PowerPreference::kDefault,
......@@ -240,13 +240,13 @@ TEST_F(WebGPUTest, RequestAdapterAfterContextLost) {
}
TEST_F(WebGPUTest, RequestDeviceAfterContextLost) {
Initialize(WebGPUTest::Options());
if (!WebGPUSupported()) {
LOG(ERROR) << "Test skipped because WebGPU isn't supported";
return;
}
Initialize(WebGPUTest::Options());
webgpu()->OnGpuControlLostContext();
ASSERT_FALSE(webgpu()->RequestDeviceAsync(
kAdapterServiceID, {},
......
......@@ -86,7 +86,6 @@ class WebGPUTest : public testing::Test {
// SharedImages on macOS require a valid image factory.
GpuMemoryBufferFactoryIOSurface image_factory_;
#endif
bool is_initialized_ = false;
webgpu::DawnDeviceClientID next_device_client_id_ = 1;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment