| Index: content/browser/gpu/gpu_process_host.cc
|
| diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
|
| index 33dc88f7ca9cff248d0d8a66fa1fa49fb5db53f8..b915196971d5b23457f38a56dfd8bf1956254e91 100644
|
| --- a/content/browser/gpu/gpu_process_host.cc
|
| +++ b/content/browser/gpu/gpu_process_host.cc
|
| @@ -636,9 +636,9 @@ bool GpuProcessHost::Init() {
|
| ->GetAssociatedInterfaceSupport()
|
| ->GetRemoteAssociatedInterface(&gpu_main_ptr_);
|
| ui::mojom::GpuServiceRequest request(&gpu_service_ptr_);
|
| - gpu_main_ptr_->CreateGpuService(std::move(request),
|
| - gpu_host_binding_.CreateInterfacePtrAndBind(),
|
| - gpu_preferences);
|
| + gpu_main_ptr_->CreateGpuService(
|
| + std::move(request), gpu_host_binding_.CreateInterfacePtrAndBind(),
|
| + gpu_preferences, activity_flags_.CloneHandle());
|
|
|
| #if defined(USE_OZONE)
|
| // Ozone needs to send the primary DRM device to GPU process as early as
|
| @@ -865,6 +865,20 @@ void GpuProcessHost::OnProcessLaunchFailed(int error_code) {
|
| }
|
|
|
| void GpuProcessHost::OnProcessCrashed(int exit_code) {
|
| + // If the GPU process crashed while compiling a shader, we may have invalid
|
| + // cached binaries. Completely clear the shader cache to force shader binaries
|
| + // to be re-created.
|
| + if (activity_flags_.IsFlagSet(
|
| + gpu::ActivityFlagsBase::FLAG_LOADING_PROGRAM_BINARY)) {
|
| + for (auto cache_key : client_id_to_shader_cache_) {
|
| + // This call will temporarily extend the lifetime of the cache (kept
|
| + // alive in the factory), and may drop loads of cached shader binaries if
|
| + // it takes a while to complete. As we are intentionally dropping all
|
| + // binaries, this behavior is fine.
|
| + GetShaderCacheFactorySingleton()->ClearByClientId(
|
| + cache_key.first, base::Time(), base::Time::Max(), base::Bind([] {}));
|
| + }
|
| + }
|
| SendOutstandingReplies();
|
| RecordProcessCrash();
|
| GpuDataManagerImpl::GetInstance()->ProcessCrashed(
|
|
|