diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-26 13:57:00 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-11-02 11:31:01 +0000 |
commit | 1943b3c2a1dcee36c233724fc4ee7613d71b9cf6 (patch) | |
tree | 8c1b5f12357025c197da5427ae02cfdc2f3570d6 /chromium/gpu/ipc/service/gpu_init.cc | |
parent | 21ba0c5d4bf8fba15dddd97cd693bad2358b77fd (diff) | |
download | qtwebengine-chromium-1943b3c2a1dcee36c233724fc4ee7613d71b9cf6.tar.gz |
BASELINE: Update Chromium to 94.0.4606.111
Change-Id: I924781584def20fc800bedf6ff41fdb96c438193
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/gpu/ipc/service/gpu_init.cc')
-rw-r--r-- | chromium/gpu/ipc/service/gpu_init.cc | 53 |
1 files changed, 39 insertions, 14 deletions
diff --git a/chromium/gpu/ipc/service/gpu_init.cc b/chromium/gpu/ipc/service/gpu_init.cc index 3ffc982e5b3..0ea793136f1 100644 --- a/chromium/gpu/ipc/service/gpu_init.cc +++ b/chromium/gpu/ipc/service/gpu_init.cc @@ -241,10 +241,22 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, InitializeSwitchableGPUs( gpu_feature_info_.enabled_gpu_driver_bug_workarounds); } - } else if (gl::GetGLImplementation() == gl::kGLImplementationSwiftShaderGL && + // If SwiftShader/SwANGLE is in use, set the flag gl_use_swiftshader so GPU + // initialization will take a software rendering path. Do not do this if + // SwiftShader/SwANGLE are explicitly requested via flags, because the flags + // are meant to specify running SwiftShader/SwANGLE on the hardware GPU path. + } else if (gl::GetGLImplementationParts() == + gl::GetLegacySoftwareGLImplementation() && command_line->GetSwitchValueASCII(switches::kUseGL) != gl::kGLImplementationSwiftShaderName) { gl_use_swiftshader_ = true; + } else if (gl::GetGLImplementationParts() == + gl::GetSoftwareGLImplementation() && + (command_line->GetSwitchValueASCII(switches::kUseGL) != + gl::kGLImplementationANGLEName || + command_line->GetSwitchValueASCII(switches::kUseANGLE) != + gl::kANGLEImplementationSwiftShaderName)) { + gl_use_swiftshader_ = true; } bool enable_watchdog = !gpu_preferences_.disable_gpu_watchdog && @@ -290,7 +302,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, // consuming has completed, otherwise the process is liable to be aborted. if (enable_watchdog && !delayed_watchdog_enable) { watchdog_thread_ = GpuWatchdogThread::Create( - gpu_preferences_.watchdog_starts_backgrounded); + gpu_preferences_.watchdog_starts_backgrounded, "GpuWatchdog"); watchdog_init.SetGpuWatchdogPtr(watchdog_thread_.get()); #if defined(OS_WIN) @@ -359,7 +371,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, gpu_preferences_.disable_software_rasterizer, needs_more_info); } if (gl_initialized && gl_use_swiftshader_ && - gl::GetGLImplementation() != gl::kGLImplementationSwiftShaderGL) { + !gl::IsSoftwareGLImplementation(gl::GetGLImplementationParts())) { #if defined(OS_LINUX) || defined(OS_CHROMEOS) VLOG(1) << "Quit GPU process launch to fallback to SwiftShader cleanly " << "on Linux"; @@ -441,7 +453,9 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, LOG_IF(ERROR, !gpu_info_.passthrough_cmd_decoder) #endif << "Passthrough is not supported, GL is " - << gl::GetGLImplementationGLName(gl::GetGLImplementationParts()); + << gl::GetGLImplementationGLName(gl::GetGLImplementationParts()) + << ", ANGLE is " + << gl::GetGLImplementationANGLEName(gl::GetGLImplementationParts()); } else { gpu_info_.passthrough_cmd_decoder = false; } @@ -611,7 +625,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, watchdog_init.SetGpuWatchdogPtr(nullptr); } else if (enable_watchdog && delayed_watchdog_enable) { watchdog_thread_ = GpuWatchdogThread::Create( - gpu_preferences_.watchdog_starts_backgrounded); + gpu_preferences_.watchdog_starts_backgrounded, "GpuWatchdog"); watchdog_init.SetGpuWatchdogPtr(watchdog_thread_.get()); } @@ -717,6 +731,26 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line, } #endif // !BUILDFLAG(IS_CHROMECAST) + // On MacOS, the default texture target for native GpuMemoryBuffers is + // GL_TEXTURE_RECTANGLE_ARB. This is due to CGL's requirements for creating + // a GL surface. However, when ANGLE is used on top of SwiftShader or Metal, + // it's necessary to use GL_TEXTURE_2D instead. + // TODO(crbug.com/1056312): The proper behavior is to check the config + // parameter set by the EGL_ANGLE_iosurface_client_buffer extension +#if defined(OS_MAC) + if (command_line->HasSwitch(switches::kUseGL)) { + std::string use_gl = command_line->GetSwitchValueASCII(switches::kUseGL); + std::string use_angle = + command_line->GetSwitchValueASCII(switches::kUseANGLE); + if (use_gl == gl::kGLImplementationANGLEName && + (use_angle == gl::kANGLEImplementationSwiftShaderName || + use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName || + use_angle == gl::kANGLEImplementationMetalName)) { + SetMacOSSpecificTextureTarget(GL_TEXTURE_2D); + } + } +#endif // defined(OS_MAC) + gl_use_swiftshader_ = EnableSwiftShaderIfNeeded( command_line, gpu_feature_info_, gpu_preferences_.disable_software_rasterizer, needs_more_info); @@ -853,15 +887,6 @@ bool GpuInit::InitializeVulkan() { // Histogram GPU.SupportsVulkan and GPU.VulkanVersion were marked as expired. // TODO(magchen): Add back these two histograms here and re-enable them in // histograms.xml when we start Vulkan finch on Windows. - if (!vulkan_use_swiftshader) { - const bool supports_vulkan = !!vulkan_implementation_; - uint32_t vulkan_version = 0; - if (supports_vulkan) { - const auto& vulkan_info = - vulkan_implementation_->GetVulkanInstance()->vulkan_info(); - vulkan_version = vulkan_info.used_api_version; - } - } if (!vulkan_implementation_) return false; |