Commit e889dc7e authored by Alexis Hetu's avatar Alexis Hetu Committed by Commit Bot

Default to SwiftShader as software GL implementation on MacOS with EGL

In order to enable SwiftShader as the default software GL implementation
on MacOS with EGL, a previous change had to be reverted where native
buffer formats were disabled for software GL. These formats are required
on MacOS with EGL, for IOSurface support, and SwiftShader supports the
same formats as Angle anyways, so only OSMesa needs this restriction.

Bug: chromium:726075
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: I20d9bb4083807ad9ae6d5f7092b912ea18ecb679
Reviewed-on: https://chromium-review.googlesource.com/1024500Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553511}
parent 6e04c725
...@@ -17,10 +17,9 @@ ...@@ -17,10 +17,9 @@
namespace gpu { namespace gpu {
bool AreNativeGpuMemoryBuffersEnabled() { bool AreNativeGpuMemoryBuffersEnabled() {
// Disable native buffers when using software GL. // Disable native buffers when using OSMesa.
if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kUseGL) == switches::kUseGL) == gl::kGLImplementationOSMesaName) {
gl::GetGLImplementationName(gl::GetSoftwareGLImplementation())) {
return false; return false;
} }
...@@ -70,11 +69,10 @@ GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations( ...@@ -70,11 +69,10 @@ GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations(
} }
} }
// Disable native buffers only when using software GL. // Disable native buffers only when using OSMesa.
bool force_native_gpu_read_write_formats = bool force_native_gpu_read_write_formats =
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kUseGL) != switches::kUseGL) != gl::kGLImplementationOSMesaName;
gl::GetGLImplementationName(gl::GetSoftwareGLImplementation());
if (force_native_gpu_read_write_formats) { if (force_native_gpu_read_write_formats) {
const gfx::BufferFormat kGPUReadWriteFormats[] = { const gfx::BufferFormat kGPUReadWriteFormats[] = {
gfx::BufferFormat::BGR_565, gfx::BufferFormat::RGBA_8888, gfx::BufferFormat::BGR_565, gfx::BufferFormat::RGBA_8888,
......
...@@ -122,7 +122,9 @@ GLImplementation GetNamedGLImplementation(const std::string& name) { ...@@ -122,7 +122,9 @@ GLImplementation GetNamedGLImplementation(const std::string& name) {
} }
GLImplementation GetSoftwareGLImplementation() { GLImplementation GetSoftwareGLImplementation() {
#if (defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(USE_OZONE))) #if (defined(OS_WIN) || \
(defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(USE_OZONE)) || \
(defined(OS_MACOSX) && defined(USE_EGL)))
return kGLImplementationSwiftShaderGL; return kGLImplementationSwiftShaderGL;
#else #else
return kGLImplementationOSMesaGL; return kGLImplementationOSMesaGL;
......
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