| 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 ec7cd536b8fc5b9a72eb08ffab5ddc508649e0ee..7b8cb8241e0607d0241367f700cfb1697d6a758e 100644
|
| --- a/content/browser/gpu/gpu_process_host.cc
|
| +++ b/content/browser/gpu/gpu_process_host.cc
|
| @@ -635,9 +635,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
|
| @@ -864,6 +864,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(
|
|
|