diff options
author | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-27 04:59:30 +0000 |
---|---|---|
committer | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-27 04:59:30 +0000 |
commit | 706b69f5a4bdaf9a4204117a8bb9d3d61f7a4475 (patch) | |
tree | b12f93344422fdee94772c06065f5accf42bdbae /gpu | |
parent | bb0bdeb6cd05396316d1a026481e86997253f762 (diff) | |
download | chromium_src-706b69f5a4bdaf9a4204117a8bb9d3d61f7a4475.zip chromium_src-706b69f5a4bdaf9a4204117a8bb9d3d61f7a4475.tar.gz chromium_src-706b69f5a4bdaf9a4204117a8bb9d3d61f7a4475.tar.bz2 |
Use EXT_robustness where available on GLES2 platforms to detect and respond to resets of the graphics card.
BUG=138162
TEST=ran https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/conformance-suites/1.0.1/extra/slow-shader-example.html on Windows with ANGLE and verified that new code path was taken
Review URL: https://chromiumcodereview.appspot.com/10822029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148721 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index ec799ea..12b02d1 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -1542,7 +1542,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, int frame_number_; - bool has_arb_robustness_; + bool has_robustness_extension_; GLenum reset_status_; bool needs_mac_nvidia_driver_workaround_; @@ -1963,7 +1963,7 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group) feature_info_(group_->feature_info()), tex_image_2d_failed_(false), frame_number_(0), - has_arb_robustness_(false), + has_robustness_extension_(false), reset_status_(GL_NO_ERROR), needs_mac_nvidia_driver_workaround_(false), needs_glsl_built_in_function_emulation_(false), @@ -2250,7 +2250,9 @@ bool GLES2DecoderImpl::Initialize( glEnable(GL_POINT_SPRITE); } - has_arb_robustness_ = context->HasExtension("GL_ARB_robustness"); + has_robustness_extension_ = + context->HasExtension("GL_ARB_robustness") || + context->HasExtension("GL_EXT_robustness"); if (!feature_info_->feature_flags().disable_workarounds) { #if defined(OS_MACOSX) @@ -8532,13 +8534,15 @@ error::ContextLostReason GLES2DecoderImpl::GetContextLostReason() { } bool GLES2DecoderImpl::WasContextLost() { - if (context_->WasAllocatedUsingARBRobustness() && has_arb_robustness_) { - GLenum status = glGetGraphicsResetStatusARB(); + if (context_->WasAllocatedUsingRobustnessExtension()) { + GLenum status = GL_NO_ERROR; + if (has_robustness_extension_) + status = glGetGraphicsResetStatusARB(); if (status != GL_NO_ERROR) { // The graphics card was reset. Signal a lost context to the application. reset_status_ = status; LOG(ERROR) << (surface_->IsOffscreen() ? "Offscreen" : "Onscreen") - << " context lost via ARB_robustness. Reset status = 0x" + << " context lost via ARB/EXT_robustness. Reset status = 0x" << std::hex << status << std::dec; return true; } |