Commit 328e07a0 authored by Kai Ninomiya's avatar Kai Ninomiya Committed by Commit Bot

Add GpuPreferences entry for enable_webgpu

Doing this requires moving --enable-unsafe-webgpu
from content_switches to gpu_switches.

Bug: 868192
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I757bd228248b8cf733c381217fbb00e69e2482c0
Reviewed-on: https://chromium-review.googlesource.com/1184264Reviewed-by: default avatarCorentin Wallez <cwallez@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585349}
parent 88937c31
......@@ -15,6 +15,7 @@
#include "content/common/content_switches_internal.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "gpu/config/gpu_switches.h"
#include "media/base/media_switches.h"
#include "services/device/public/cpp/device_features.h"
#include "services/network/public/cpp/features.h"
......
......@@ -429,9 +429,6 @@ const char kEnableTracing[] = "enable-tracing";
// The filename to write the output of the test tracing to.
const char kEnableTracingOutput[] = "enable-tracing-output";
// Enables unsafe WebGPU support.
const char kEnableUnsafeWebGPU[] = "enable-unsafe-webgpu";
// Enable screen capturing support for MediaStream API.
const char kEnableUserMediaScreenCapturing[] =
"enable-usermedia-screen-capturing";
......
......@@ -135,7 +135,6 @@ CONTENT_EXPORT extern const char kEnableStrictPowerfulFeatureRestrictions[];
CONTENT_EXPORT extern const char kEnableThreadedCompositing[];
CONTENT_EXPORT extern const char kEnableTracing[];
CONTENT_EXPORT extern const char kEnableTracingOutput[];
CONTENT_EXPORT extern const char kEnableUnsafeWebGPU[];
CONTENT_EXPORT extern const char kEnableUserMediaScreenCapturing[];
CONTENT_EXPORT extern const char kEnableUseZoomForDSF[];
CONTENT_EXPORT extern const char kEnableViewport[];
......
......@@ -165,6 +165,8 @@ GpuPreferences ParseGpuPreferences(const base::CommandLine* command_line) {
command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds);
gpu_preferences.ignore_gpu_blacklist =
command_line->HasSwitch(switches::kIgnoreGpuBlacklist);
gpu_preferences.enable_webgpu =
command_line->HasSwitch(switches::kEnableUnsafeWebGPU);
return gpu_preferences;
}
......
......@@ -209,6 +209,9 @@ struct GPU_EXPORT GpuPreferences {
// Enable the GPU benchmarking extension; used by tests only.
bool enable_gpu_benchmarking_extension = false;
// Enable the WebGPU command buffer.
bool enable_webgpu = false;
// Please update gpu_preferences_unittest.cc when making additions or
// changes to this struct.
};
......
......@@ -76,6 +76,7 @@ void CheckGpuPreferencesEqual(GpuPreferences left, GpuPreferences right) {
EXPECT_EQ(left.enable_vulkan, right.enable_vulkan);
EXPECT_EQ(left.enable_gpu_benchmarking_extension,
right.enable_gpu_benchmarking_extension);
EXPECT_EQ(left.enable_webgpu, right.enable_webgpu);
}
} // namespace
......@@ -154,6 +155,7 @@ TEST(GpuPreferencesTest, EncodeDecode) {
GPU_PREFERENCES_FIELD(watchdog_starts_backgrounded, true)
GPU_PREFERENCES_FIELD(enable_vulkan, true)
GPU_PREFERENCES_FIELD(enable_gpu_benchmarking_extension, true)
GPU_PREFERENCES_FIELD(enable_webgpu, true)
input_prefs.texture_target_exception_list.emplace_back(
gfx::BufferUsage::SCANOUT, gfx::BufferFormat::RGBA_8888);
......
......@@ -53,4 +53,6 @@ const char kWebglMSAASampleCount[] = "webgl-msaa-sample-count";
const char kDisableGpuProcessForDX12VulkanInfoCollection[] =
"disable-gpu-process-for-dx12-vulkan-info-collection";
const char kEnableUnsafeWebGPU[] = "enable-unsafe-webgpu";
} // namespace switches
......@@ -21,6 +21,7 @@ GPU_EXPORT extern const char kShaderDiskCacheSizeKB[];
GPU_EXPORT extern const char kWebglAntialiasingMode[];
GPU_EXPORT extern const char kWebglMSAASampleCount[];
GPU_EXPORT extern const char kDisableGpuProcessForDX12VulkanInfoCollection[];
GPU_EXPORT extern const char kEnableUnsafeWebGPU[];
} // namespace switches
#endif // GPU_CONFIG_GPU_SWITCHES_H_
......@@ -65,4 +65,5 @@ struct GpuPreferences {
bool watchdog_starts_backgrounded;
bool enable_vulkan;
bool enable_gpu_benchmarking_extension;
bool enable_webgpu;
};
......@@ -122,6 +122,7 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> {
out->enable_vulkan = prefs.enable_vulkan();
out->enable_gpu_benchmarking_extension =
prefs.enable_gpu_benchmarking_extension();
out->enable_webgpu = prefs.enable_webgpu();
return true;
}
......@@ -265,6 +266,9 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> {
const gpu::GpuPreferences& prefs) {
return prefs.enable_gpu_benchmarking_extension;
}
static bool enable_webgpu(const gpu::GpuPreferences& prefs) {
return prefs.enable_webgpu;
}
};
} // namespace mojo
......
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