Commit 75471a03 authored by Kenneth Russell's avatar Kenneth Russell Committed by Commit Bot

Order alpha:false workarounds in terms of importance.

Previously the last one in the list would win; now the first one wins,
which is the order in which the code is read.

Improves performance for some WebGL content using the validating
command decoder on Intel GPUs on macOS.

Bug: 1045643
Change-Id: I99c1c874b4d323362f70a11aa6c7971cbdfdd1a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2288503Reviewed-by: default avatarccameron <ccameron@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786538}
parent 7462a8a6
......@@ -807,6 +807,9 @@ bool DrawingBuffer::Initialize(const IntSize& size, bool use_multisampling) {
} else {
allocate_alpha_channel_ = false;
have_alpha_channel_ = false;
// The following workarounds are used in order of importance; the
// first is a correctness issue, the second a major performance
// issue, and the third a minor performance issue.
if (ContextProvider()->GetGpuFeatureInfo().IsWorkaroundEnabled(
gpu::DISABLE_GL_RGB_FORMAT)) {
// This configuration will
......@@ -815,18 +818,17 @@ bool DrawingBuffer::Initialize(const IntSize& size, bool use_multisampling) {
// https://crbug.com/776269
allocate_alpha_channel_ = true;
have_alpha_channel_ = true;
}
if (WantExplicitResolve() &&
ContextProvider()->GetGpuFeatureInfo().IsWorkaroundEnabled(
gpu::DISABLE_WEBGL_RGB_MULTISAMPLING_USAGE)) {
} else if (WantExplicitResolve() &&
ContextProvider()->GetGpuFeatureInfo().IsWorkaroundEnabled(
gpu::DISABLE_WEBGL_RGB_MULTISAMPLING_USAGE)) {
// This configuration avoids the above issues because
// - CopyTexImage is invalid from multisample renderbuffers
// - FramebufferBlit is invalid to multisample renderbuffers
allocate_alpha_channel_ = true;
have_alpha_channel_ = true;
}
if (ShouldUseChromiumImage() &&
ContextProvider()->GetCapabilities().chromium_image_rgb_emulation) {
} else if (ShouldUseChromiumImage() && ContextProvider()
->GetCapabilities()
.chromium_image_rgb_emulation) {
// This configuration avoids the above issues by
// - extra command buffer validation for CopyTexImage
// - explicity re-binding as RGB for FramebufferBlit
......
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