Commit 193f427a authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

OOP-R: GrContext::flush and glFlush at every DoEndRasterCHROMIUM

Adding egregious glFlush calls fixed this issue when GPU Raster was
going through the command buffer (in issue 863817). Adding a flush
here to see if it will fix the issue.

If this does not fix the issue, then the next steps are to
* Flush in DoRasterCHROMIUM (far more frequent) to see if that fixes
  the issue.
* Add crash instrumentation to see which commands are being issued when
  we do crash.

Bug: 906453
Change-Id: I7d88ea2d74b52751f641faaf8b848e9a1358a770
Reviewed-on: https://chromium-review.googlesource.com/c/1352508
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612392}
parent 30f71753
...@@ -2516,6 +2516,19 @@ void RasterDecoderImpl::DoEndRasterCHROMIUM() { ...@@ -2516,6 +2516,19 @@ void RasterDecoderImpl::DoEndRasterCHROMIUM() {
// prepareForExternalIO above. Use kDeferLaterCommands to ensure we yield to // prepareForExternalIO above. Use kDeferLaterCommands to ensure we yield to
// the Scheduler before processing more commands. // the Scheduler before processing more commands.
current_decoder_error_ = error::kDeferLaterCommands; current_decoder_error_ = error::kDeferLaterCommands;
#if defined(OS_MACOSX)
// Aggressively call glFlush on macOS to determine if this is sufficient to
// avoid GL driver crashes.
// TODO(ccameron): If this is not sufficient, then add a flush to
// DoRasterCHROMIUM as well. Also add crash report data to indicate which
// sequence of commands result in the crash, and formalize this as a GPU
// bug workaround.
// https://crbug.com/906453
if (gr_context())
gr_context()->flush();
api()->glFlushFn();
#endif
} }
void RasterDecoderImpl::DoCreateTransferCacheEntryINTERNAL( void RasterDecoderImpl::DoCreateTransferCacheEntryINTERNAL(
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "build/build_config.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/raster_cmd_format.h" #include "gpu/command_buffer/common/raster_cmd_format.h"
...@@ -195,6 +196,9 @@ TEST_P(RasterDecoderManualInitTest, CopyTexSubImage2DValidateColorFormat) { ...@@ -195,6 +196,9 @@ TEST_P(RasterDecoderManualInitTest, CopyTexSubImage2DValidateColorFormat) {
} }
TEST_P(RasterDecoderTest, YieldAfterEndRasterCHROMIUM) { TEST_P(RasterDecoderTest, YieldAfterEndRasterCHROMIUM) {
#if defined(OS_MACOSX)
EXPECT_CALL(*gl_, Flush()).RetiresOnSaturation();
#endif
GetDecoder()->SetUpForRasterCHROMIUMForTest(); GetDecoder()->SetUpForRasterCHROMIUMForTest();
cmds::EndRasterCHROMIUM end_raster_cmd; cmds::EndRasterCHROMIUM end_raster_cmd;
end_raster_cmd.Init(); end_raster_cmd.Init();
......
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