Commit f4f0d5b4 authored by Vikas Soni's avatar Vikas Soni Committed by Commit Bot

Limit GL version to 2.0 for OOPR on android via finch flag.

1. Remove existing gpu driver bug workaround.
2. Add a finch feature flag to enable this workaround instead.

Bug: 1031383
Change-Id: I0934bd8934bd12b5dfe5cf565b5173b68851a099
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2152893
Commit-Queue: Khushal <khushalsagar@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766522}
parent 7efe05e3
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/system/sys_info.h" #include "base/system/sys_info.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/memory_dump_manager.h" #include "base/trace_event/memory_dump_manager.h"
#include "build/build_config.h"
#include "components/crash/core/common/crash_key.h" #include "components/crash/core/common/crash_key.h"
#include "gpu/command_buffer/common/activity_flags.h" #include "gpu/command_buffer/common/activity_flags.h"
#include "gpu/command_buffer/service/context_state.h" #include "gpu/command_buffer/service/context_state.h"
...@@ -31,6 +32,10 @@ ...@@ -31,6 +32,10 @@
#include "gpu/vulkan/vulkan_device_queue.h" #include "gpu/vulkan/vulkan_device_queue.h"
#endif #endif
#if defined(OS_ANDROID)
#include "gpu/config/gpu_finch_features.h"
#endif
#if defined(OS_FUCHSIA) #if defined(OS_FUCHSIA)
#include "gpu/vulkan/fuchsia/vulkan_fuchsia_ext.h" #include "gpu/vulkan/fuchsia/vulkan_fuchsia_ext.h"
#endif #endif
...@@ -206,9 +211,12 @@ void SharedContextState::InitializeGrContext( ...@@ -206,9 +211,12 @@ void SharedContextState::InitializeGrContext(
if (GrContextIsGL()) { if (GrContextIsGL()) {
DCHECK(context_->IsCurrent(nullptr)); DCHECK(context_->IsCurrent(nullptr));
bool use_version_es2 = false;
#if defined(OS_ANDROID)
use_version_es2 = base::FeatureList::IsEnabled(features::kUseGles2ForOopR);
#endif
sk_sp<GrGLInterface> interface(gl::init::CreateGrGLInterface( sk_sp<GrGLInterface> interface(gl::init::CreateGrGLInterface(
*context_->GetVersionInfo(), workarounds.use_es2_for_oopr, *context_->GetVersionInfo(), use_version_es2, progress_reporter));
progress_reporter));
if (!interface) { if (!interface) {
LOG(ERROR) << "OOP raster support disabled: GrGLInterface creation " LOG(ERROR) << "OOP raster support disabled: GrGLInterface creation "
"failed."; "failed.";
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "gpu/command_buffer/service/skia_utils.h" #include "gpu/command_buffer/service/skia_utils.h"
#include "base/logging.h" #include "base/logging.h"
#include "build/build_config.h"
#include "components/viz/common/gpu/vulkan_context_provider.h" #include "components/viz/common/gpu/vulkan_context_provider.h"
#include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/resource_format_utils.h"
#include "gpu/command_buffer/service/feature_info.h" #include "gpu/command_buffer/service/feature_info.h"
...@@ -17,6 +18,10 @@ ...@@ -17,6 +18,10 @@
#include "ui/gl/gl_gl_api_implementation.h" #include "ui/gl/gl_gl_api_implementation.h"
#include "ui/gl/gl_version_info.h" #include "ui/gl/gl_version_info.h"
#if defined(OS_ANDROID)
#include "gpu/config/gpu_finch_features.h"
#endif
#if BUILDFLAG(ENABLE_VULKAN) #if BUILDFLAG(ENABLE_VULKAN)
#include "gpu/vulkan/vulkan_device_queue.h" #include "gpu/vulkan/vulkan_device_queue.h"
#include "gpu/vulkan/vulkan_fence_helper.h" #include "gpu/vulkan/vulkan_fence_helper.h"
...@@ -90,9 +95,13 @@ GLuint GetGrGLBackendTextureFormat(const gles2::FeatureInfo* feature_info, ...@@ -90,9 +95,13 @@ GLuint GetGrGLBackendTextureFormat(const gles2::FeatureInfo* feature_info,
GLuint internal_format = gl::GetInternalFormat( GLuint internal_format = gl::GetInternalFormat(
version_info, viz::TextureStorageFormat(resource_format)); version_info, viz::TextureStorageFormat(resource_format));
bool use_version_es2 = false;
#if defined(OS_ANDROID)
use_version_es2 = base::FeatureList::IsEnabled(features::kUseGles2ForOopR);
#endif
// We tell Skia to use es2 which does not have GL_R8_EXT // We tell Skia to use es2 which does not have GL_R8_EXT
if (feature_info->gl_version_info().is_es3 && if (feature_info->gl_version_info().is_es3 && use_version_es2) {
feature_info->workarounds().use_es2_for_oopr) {
if (internal_format == GL_R8_EXT) if (internal_format == GL_R8_EXT)
internal_format = GL_LUMINANCE8; internal_format = GL_LUMINANCE8;
} }
......
...@@ -2867,17 +2867,6 @@ ...@@ -2867,17 +2867,6 @@
"disable_timestamp_queries" "disable_timestamp_queries"
] ]
}, },
{
"id":273,
"cr_bugs": [866613, 860021],
"description": "Frequent crashes on Adreno (TM) on L and below",
"os": {
"type": "android"
},
"features": [
"use_es2_for_oopr"
]
},
{ {
"id": 274, "id": 274,
"description": "glTexStorage* are buggy when base mipmap level is not 0", "description": "glTexStorage* are buggy when base mipmap level is not 0",
......
...@@ -16,6 +16,10 @@ namespace features { ...@@ -16,6 +16,10 @@ namespace features {
// Used only by webview to disable SurfaceControl. // Used only by webview to disable SurfaceControl.
const base::Feature kDisableSurfaceControlForWebview{ const base::Feature kDisableSurfaceControlForWebview{
"DisableSurfaceControlForWebview", base::FEATURE_DISABLED_BY_DEFAULT}; "DisableSurfaceControlForWebview", base::FEATURE_DISABLED_BY_DEFAULT};
// Used to limit GL version to 2.0 for skia raster on Android.
const base::Feature kUseGles2ForOopR{"UseGles2ForOopR",
base::FEATURE_ENABLED_BY_DEFAULT};
#endif #endif
// Enable GPU Rasterization by default. This can still be overridden by // Enable GPU Rasterization by default. This can still be overridden by
......
...@@ -18,6 +18,8 @@ namespace features { ...@@ -18,6 +18,8 @@ namespace features {
// alongside the definition of their values in the .cc file. // alongside the definition of their values in the .cc file.
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
GPU_EXPORT extern const base::Feature kDisableSurfaceControlForWebview; GPU_EXPORT extern const base::Feature kDisableSurfaceControlForWebview;
GPU_EXPORT extern const base::Feature kUseGles2ForOopR;
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
GPU_EXPORT extern const base::Feature kDefaultEnableGpuRasterization; GPU_EXPORT extern const base::Feature kDefaultEnableGpuRasterization;
......
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