Commit 30e36bcc authored by Eric Karl's avatar Eric Karl Committed by Commit Bot

Bump WebGL stream to high-priority on Adreno 3xx.

WebGL has performance issues on Adreno 3xx when we switch contexts
from/to the WebGL context mid-frame.

To avoid this issue, we can bump scheduler priority for the WebGL stream
to high, avoiding most mid-frame interruptions. In local testing this
(in combination with a backpressure fix) addresses known issues.

Bug: 879649, 835353
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: I896456b29f3b80e3e443720b9ce444e6825c1c03
Reviewed-on: https://chromium-review.googlesource.com/1200242Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: Eric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588287}
parent 4c3fd1e2
...@@ -13,9 +13,11 @@ enum { ...@@ -13,9 +13,11 @@ enum {
kGpuStreamIdDefault, kGpuStreamIdDefault,
kGpuStreamIdWorker, kGpuStreamIdWorker,
kGpuStreamIdMedia, kGpuStreamIdMedia,
kGpuStreamIdHighPriorityWebGL,
}; };
// Used for renderer compositor thread context, WebGL, canvas, etc. // Used for renderer compositor thread context, WebGL (when high priority is
// not requested by workaround), canvas, etc.
const gpu::SchedulingPriority kGpuStreamPriorityDefault = const gpu::SchedulingPriority kGpuStreamPriorityDefault =
gpu::SchedulingPriority::kNormal; gpu::SchedulingPriority::kNormal;
...@@ -31,6 +33,11 @@ const gpu::SchedulingPriority kGpuStreamPriorityMedia = ...@@ -31,6 +33,11 @@ const gpu::SchedulingPriority kGpuStreamPriorityMedia =
const gpu::SchedulingPriority kGpuStreamPriorityWorker = const gpu::SchedulingPriority kGpuStreamPriorityWorker =
gpu::SchedulingPriority::kLow; gpu::SchedulingPriority::kLow;
// Used for WebGL on devices where a hgih priority context is requested by the
// |use_high_priority_for_webgl| workaround.
const gpu::SchedulingPriority kGpuStreamPriorityHighPriorityWebGL =
gpu::SchedulingPriority::kHigh;
} // namespace content } // namespace content
#endif // CONTENT_COMMON_GPU_STREAM_CONSTANTS_H_ #endif // CONTENT_COMMON_GPU_STREAM_CONSTANTS_H_
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
#include "content/renderer/worker_thread_registry.h" #include "content/renderer/worker_thread_registry.h"
#include "device/gamepad/public/cpp/gamepads.h" #include "device/gamepad/public/cpp/gamepads.h"
#include "gpu/command_buffer/client/gles2_interface.h" #include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "gpu/config/gpu_info.h" #include "gpu/config/gpu_info.h"
#include "gpu/ipc/client/gpu_channel_host.h" #include "gpu/ipc/client/gpu_channel_host.h"
#include "media/audio/audio_output_device.h" #include "media/audio/audio_output_device.h"
...@@ -1050,12 +1051,19 @@ RendererBlinkPlatformImpl::CreateOffscreenGraphicsContext3DProvider( ...@@ -1050,12 +1051,19 @@ RendererBlinkPlatformImpl::CreateOffscreenGraphicsContext3DProvider(
constexpr bool automatic_flushes = true; constexpr bool automatic_flushes = true;
constexpr bool support_locking = false; constexpr bool support_locking = false;
uint32_t stream_id = kGpuStreamIdDefault;
gpu::SchedulingPriority priority = kGpuStreamPriorityDefault;
if (gpu_channel_host->gpu_feature_info().IsWorkaroundEnabled(
gpu::USE_HIGH_PRIORITY_FOR_WEBGL)) {
stream_id = kGpuStreamIdHighPriorityWebGL;
priority = kGpuStreamPriorityHighPriorityWebGL;
}
scoped_refptr<ws::ContextProviderCommandBuffer> provider( scoped_refptr<ws::ContextProviderCommandBuffer> provider(
new ws::ContextProviderCommandBuffer( new ws::ContextProviderCommandBuffer(
std::move(gpu_channel_host), std::move(gpu_channel_host),
RenderThreadImpl::current()->GetGpuMemoryBufferManager(), RenderThreadImpl::current()->GetGpuMemoryBufferManager(), stream_id,
kGpuStreamIdDefault, kGpuStreamPriorityDefault, priority, gpu::kNullSurfaceHandle, GURL(top_document_web_url),
gpu::kNullSurfaceHandle, GURL(top_document_web_url),
automatic_flushes, support_locking, web_attributes.support_grcontext, automatic_flushes, support_locking, web_attributes.support_grcontext,
gpu::SharedMemoryLimits(), attributes, gpu::SharedMemoryLimits(), attributes,
ws::command_buffer_metrics::ContextType::WEBGL)); ws::command_buffer_metrics::ContextType::WEBGL));
......
...@@ -2964,6 +2964,18 @@ ...@@ -2964,6 +2964,18 @@
"features": [ "features": [
"disable_aimagereader" "disable_aimagereader"
] ]
},
{
"id":276,
"cr_bugs": [835353],
"description": "Adreno 3xx requires a high-priority WebGL context to avoid MSAA and performance issues",
"os": {
"type": "android"
},
"gl_renderer": "Adreno \\(TM\\) 3.*",
"features": [
"use_high_priority_for_webgl"
]
} }
] ]
} }
...@@ -98,6 +98,7 @@ unpack_overlapping_rows_separately_unpack_buffer ...@@ -98,6 +98,7 @@ unpack_overlapping_rows_separately_unpack_buffer
use_client_side_arrays_for_stream_buffers use_client_side_arrays_for_stream_buffers
use_es2_for_oopr use_es2_for_oopr
use_gpu_driver_workaround_for_testing use_gpu_driver_workaround_for_testing
use_high_priority_for_webgl
use_intermediary_for_copy_texture_image use_intermediary_for_copy_texture_image
use_non_zero_size_for_client_side_stream_buffers use_non_zero_size_for_client_side_stream_buffers
use_unused_standard_shared_blocks use_unused_standard_shared_blocks
......
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