Commit cc22d8ee authored by Rafael Cintron's avatar Rafael Cintron Committed by Commit Bot

Disable WebGPU tests on Win7 and move them to gpu_tests.exe

Skip WebGPU tests on Win7 as Win7 does not support D3D12.

Since WebGPU decoder tests require a GPU in order to run, they are
moved to gpu_tests from gpu_unittests. gpu_unittests.exe run on
"GPU less" machines. As a side effect of the move, the tests are
no longer skipped on Mac.

The change also disables the WebGPU tests on Linux since the shared
Vulkan shared image extension is not working or being initialized
properly on the bots.

Bug: 1017035
Change-Id: Ie5426bd0e1e0bb4b570a74b8a75c1f99c80d246d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879655
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711054}
parent 31aa2a0f
...@@ -181,6 +181,10 @@ jumbo_static_library("test_support") { ...@@ -181,6 +181,10 @@ jumbo_static_library("test_support") {
"command_buffer/service/error_state_mock.h", "command_buffer/service/error_state_mock.h",
"command_buffer/service/gles2_cmd_decoder_mock.cc", "command_buffer/service/gles2_cmd_decoder_mock.cc",
"command_buffer/service/gles2_cmd_decoder_mock.h", "command_buffer/service/gles2_cmd_decoder_mock.h",
"command_buffer/service/mocks.cc",
"command_buffer/service/mocks.h",
"command_buffer/service/test_helper.cc",
"command_buffer/service/test_helper.h",
"ipc/raster_in_process_context.cc", "ipc/raster_in_process_context.cc",
"ipc/raster_in_process_context.h", "ipc/raster_in_process_context.h",
"ipc/service/gpu_memory_buffer_factory_test_template.h", "ipc/service/gpu_memory_buffer_factory_test_template.h",
...@@ -206,6 +210,7 @@ jumbo_static_library("test_support") { ...@@ -206,6 +210,7 @@ jumbo_static_library("test_support") {
"//gpu/skia_bindings:skia_bindings", "//gpu/skia_bindings:skia_bindings",
"//testing/gmock", "//testing/gmock",
"//testing/gtest", "//testing/gtest",
"//third_party/angle:translator",
"//ui/gfx:test_support", "//ui/gfx:test_support",
"//ui/gl:gl_unittest_utils", "//ui/gl:gl_unittest_utils",
"//ui/gl:test_support", "//ui/gl:test_support",
...@@ -347,6 +352,7 @@ test("gl_tests") { ...@@ -347,6 +352,7 @@ test("gl_tests") {
if (use_dawn) { if (use_dawn) {
sources += [ sources += [
"command_buffer/service/webgpu_decoder_unittest.cc",
"command_buffer/tests/webgpu_fence_unittest.cc", "command_buffer/tests/webgpu_fence_unittest.cc",
"command_buffer/tests/webgpu_mailbox_unittest.cc", "command_buffer/tests/webgpu_mailbox_unittest.cc",
"command_buffer/tests/webgpu_test.cc", "command_buffer/tests/webgpu_test.cc",
...@@ -414,8 +420,8 @@ test("gl_tests") { ...@@ -414,8 +420,8 @@ test("gl_tests") {
if (use_dawn) { if (use_dawn) {
deps += [ deps += [
"//third_party/dawn:libdawn_native", "//third_party/dawn:libdawn_native",
"//third_party/dawn/src/dawn:libdawn_proc",
"//third_party/dawn/src/dawn:dawncpp", "//third_party/dawn/src/dawn:dawncpp",
"//third_party/dawn/src/dawn:libdawn_proc",
] ]
} }
} }
...@@ -507,8 +513,6 @@ test("gpu_unittests") { ...@@ -507,8 +513,6 @@ test("gpu_unittests") {
"command_buffer/service/indexed_buffer_binding_host_unittest.cc", "command_buffer/service/indexed_buffer_binding_host_unittest.cc",
"command_buffer/service/mailbox_manager_unittest.cc", "command_buffer/service/mailbox_manager_unittest.cc",
"command_buffer/service/memory_program_cache_unittest.cc", "command_buffer/service/memory_program_cache_unittest.cc",
"command_buffer/service/mocks.cc",
"command_buffer/service/mocks.h",
"command_buffer/service/multi_draw_manager_unittest.cc", "command_buffer/service/multi_draw_manager_unittest.cc",
"command_buffer/service/passthrough_program_cache_unittest.cc", "command_buffer/service/passthrough_program_cache_unittest.cc",
"command_buffer/service/path_manager_unittest.cc", "command_buffer/service/path_manager_unittest.cc",
...@@ -529,8 +533,6 @@ test("gpu_unittests") { ...@@ -529,8 +533,6 @@ test("gpu_unittests") {
"command_buffer/service/shader_translator_unittest.cc", "command_buffer/service/shader_translator_unittest.cc",
"command_buffer/service/shared_context_state_unittest.cc", "command_buffer/service/shared_context_state_unittest.cc",
"command_buffer/service/sync_point_manager_unittest.cc", "command_buffer/service/sync_point_manager_unittest.cc",
"command_buffer/service/test_helper.cc",
"command_buffer/service/test_helper.h",
"command_buffer/service/texture_manager_unittest.cc", "command_buffer/service/texture_manager_unittest.cc",
"command_buffer/service/transfer_buffer_manager_unittest.cc", "command_buffer/service/transfer_buffer_manager_unittest.cc",
"command_buffer/service/transform_feedback_manager_unittest.cc", "command_buffer/service/transform_feedback_manager_unittest.cc",
...@@ -571,10 +573,6 @@ test("gpu_unittests") { ...@@ -571,10 +573,6 @@ test("gpu_unittests") {
sources += [ "ipc/service/image_decode_accelerator_stub_unittest.cc" ] sources += [ "ipc/service/image_decode_accelerator_stub_unittest.cc" ]
} }
if (use_dawn) {
sources += [ "command_buffer/service/webgpu_decoder_unittest.cc" ]
}
if (is_mac) { if (is_mac) {
sources += [ sources += [
"ipc/common/gpu_memory_buffer_impl_io_surface_unittest.cc", "ipc/common/gpu_memory_buffer_impl_io_surface_unittest.cc",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "gpu/command_buffer/service/shared_image_factory.h" #include "gpu/command_buffer/service/shared_image_factory.h"
#include "gpu/command_buffer/service/shared_image_manager.h" #include "gpu/command_buffer/service/shared_image_manager.h"
#include "gpu/command_buffer/service/test_helper.h" #include "gpu/command_buffer/service/test_helper.h"
#include "gpu/config/gpu_test_config.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_context.h" #include "ui/gl/gl_context.h"
#include "ui/gl/gl_surface.h" #include "ui/gl/gl_surface.h"
...@@ -31,32 +32,33 @@ class WebGPUDecoderTest : public ::testing::Test { ...@@ -31,32 +32,33 @@ class WebGPUDecoderTest : public ::testing::Test {
WebGPUDecoderTest() {} WebGPUDecoderTest() {}
void SetUp() override { void SetUp() override {
if (!WebGPUSupported()) {
return;
}
// Shared image factories for some backends take a dependency on GL. // Shared image factories for some backends take a dependency on GL.
// Failure to create a test context with a surface and making it current // Failure to create a test context with a surface and making it current
// will result in a "NoContext" context being current that asserts on all // will result in a "NoContext" context being current that asserts on all
// GL calls. // GL calls.
gl::init::InitializeGLNoExtensionsOneOff();
gl_surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size(1, 1)); gl_surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size(1, 1));
ASSERT_NE(gl_surface_, nullptr);
gl_context_ = gl::init::CreateGLContext(nullptr, gl_surface_.get(), gl_context_ = gl::init::CreateGLContext(nullptr, gl_surface_.get(),
gl::GLContextAttribs()); gl::GLContextAttribs());
ASSERT_NE(gl_context_, nullptr);
gl_context_->MakeCurrent(gl_surface_.get()); gl_context_->MakeCurrent(gl_surface_.get());
command_buffer_service_.reset(new FakeCommandBufferServiceBase()); command_buffer_service_.reset(new FakeCommandBufferServiceBase());
decoder_.reset(WebGPUDecoder::Create(nullptr, command_buffer_service_.get(), decoder_.reset(WebGPUDecoder::Create(nullptr, command_buffer_service_.get(),
&shared_image_manager_, nullptr, &shared_image_manager_, nullptr,
&outputter_)); &outputter_));
if (decoder_->Initialize() != ContextResult::kSuccess) { ASSERT_EQ(decoder_->Initialize(), ContextResult::kSuccess);
decoder_ = nullptr;
} else { cmds::RequestAdapter requestAdapterCmd;
cmds::RequestAdapter requestAdapterCmd; requestAdapterCmd.Init(
requestAdapterCmd.Init( static_cast<uint32_t>(webgpu::PowerPreference::kHighPerformance));
static_cast<uint32_t>(webgpu::PowerPreference::kHighPerformance)); ASSERT_EQ(error::kNoError, ExecuteCmd(requestAdapterCmd));
if (ExecuteCmd(requestAdapterCmd) == error::kLostContext) {
decoder_ = nullptr;
} else {
ASSERT_EQ(error::kNoError, ExecuteCmd(requestAdapterCmd));
}
}
factory_ = std::make_unique<SharedImageFactory>( factory_ = std::make_unique<SharedImageFactory>(
GpuPreferences(), GpuDriverBugWorkarounds(), GpuFeatureInfo(), GpuPreferences(), GpuDriverBugWorkarounds(), GpuFeatureInfo(),
...@@ -66,15 +68,22 @@ class WebGPUDecoderTest : public ::testing::Test { ...@@ -66,15 +68,22 @@ class WebGPUDecoderTest : public ::testing::Test {
} }
void TearDown() override { void TearDown() override {
factory_->DestroyAllSharedImages(true); if (factory_) {
factory_.reset(); factory_->DestroyAllSharedImages(true);
factory_.reset();
}
gl_surface_.reset(); gl_surface_.reset();
gl_context_.reset(); gl_context_.reset();
gl::init::ShutdownGL(false);
} }
bool WebGPUSupported() const { return decoder_ != nullptr; } bool WebGPUSupported() const {
// WebGPU does not work on Win7 because there is no D3D12 on Win7
// Linux bots running Vulkan are not properly initializing the shared
// image extensions.
return !GPUTestBotConfig::CurrentConfigMatches("Win7") &&
!GPUTestBotConfig::CurrentConfigMatches("Linux");
}
template <typename T> template <typename T>
error::Error ExecuteCmd(const T& cmd) { error::Error ExecuteCmd(const T& cmd) {
......
...@@ -26,7 +26,15 @@ WebGPUTest::~WebGPUTest() = default; ...@@ -26,7 +26,15 @@ WebGPUTest::~WebGPUTest() = default;
bool WebGPUTest::WebGPUSupported() const { bool WebGPUTest::WebGPUSupported() const {
DCHECK(is_initialized_); // Did you call WebGPUTest::Initialize? DCHECK(is_initialized_); // Did you call WebGPUTest::Initialize?
return context_ != nullptr;
// crbug.com(941685): Vulkan driver crashes on Linux FYI Release (AMD R7 240).
// Win7 does not support WebGPU
if (GPUTestBotConfig::CurrentConfigMatches("Linux AMD") ||
GPUTestBotConfig::CurrentConfigMatches("Win7")) {
return false;
}
return true;
} }
bool WebGPUTest::WebGPUSharedImageSupported() const { bool WebGPUTest::WebGPUSharedImageSupported() const {
...@@ -57,8 +65,7 @@ void WebGPUTest::TearDown() { ...@@ -57,8 +65,7 @@ void WebGPUTest::TearDown() {
void WebGPUTest::Initialize(const Options& options) { void WebGPUTest::Initialize(const Options& options) {
is_initialized_ = true; is_initialized_ = true;
// crbug.com(941685): Vulkan driver crashes on Linux FYI Release (AMD R7 240). if (!WebGPUSupported()) {
if (GPUTestBotConfig::CurrentConfigMatches("Linux AMD")) {
return; return;
} }
...@@ -75,10 +82,7 @@ void WebGPUTest::Initialize(const Options& options) { ...@@ -75,10 +82,7 @@ void WebGPUTest::Initialize(const Options& options) {
context_->Initialize(gpu_service_holder_->task_executor(), attributes, context_->Initialize(gpu_service_holder_->task_executor(), attributes,
options.shared_memory_limits, memory_buffer_manager, options.shared_memory_limits, memory_buffer_manager,
image_factory, channel_manager); image_factory, channel_manager);
if (result != ContextResult::kSuccess) { ASSERT_EQ(result, ContextResult::kSuccess);
context_ = nullptr;
return;
}
webgpu()->RequestAdapter(webgpu::PowerPreference::kHighPerformance); webgpu()->RequestAdapter(webgpu::PowerPreference::kHighPerformance);
......
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