summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-19 16:05:21 +0000
committerzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-19 16:05:21 +0000
commitf627c14aefbe84f9c59e9df857d586f0f6674385 (patch)
tree9683218efd49b5792219ceaf7984622a81304991
parent9167bc8a6939e84662bd5cae5792cc9dc081cfea (diff)
downloadchromium_src-f627c14aefbe84f9c59e9df857d586f0f6674385.zip
chromium_src-f627c14aefbe84f9c59e9df857d586f0f6674385.tar.gz
chromium_src-f627c14aefbe84f9c59e9df857d586f0f6674385.tar.bz2
Merge 288347 "Only switch draw buffers if the extension is suppo..."
> Only switch draw buffers if the extension is supported > > Otherwise it's possible to end up crashing when calling a null function > pointer, if a framebuffer does not have a color buffer attached. > > This bug applies to at least some GLES3 platforms, where DrawBuffers > function is not bound (which is reasonable, since core version of the > function behaves subtly differently than DrawBuffersEXT in relation to > GLSL ES 1.0 shaders, if the EXT_draw_buffers extension is missing). Also > possibly GLES2 platforms which implement OES_depth_texture but not > EXT_draw_buffers. > > BUG=401645 > TEST=gpu_unittests, WebGL conformance tests > > Review URL: https://codereview.chromium.org/448223002 TBR=oetuaho@nvidia.com Review URL: https://codereview.chromium.org/489533002 git-svn-id: svn://svn.chromium.org/chrome/branches/2062/src@290575 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 02ac2f6..5a829e9 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -5020,7 +5020,8 @@ void GLES2DecoderImpl::ClearUnclearedAttachments(
1.0f);
state_.SetDeviceColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
clear_bits |= GL_COLOR_BUFFER_BIT;
- framebuffer->PrepareDrawBuffersForClear();
+ if (feature_info_->feature_flags().ext_draw_buffers)
+ framebuffer->PrepareDrawBuffersForClear();
}
if (framebuffer->HasUnclearedAttachment(GL_STENCIL_ATTACHMENT) ||
@@ -5041,7 +5042,8 @@ void GLES2DecoderImpl::ClearUnclearedAttachments(
state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, false);
glClear(clear_bits);
- if ((clear_bits | GL_COLOR_BUFFER_BIT) != 0)
+ if ((clear_bits | GL_COLOR_BUFFER_BIT) != 0 &&
+ feature_info_->feature_flags().ext_draw_buffers)
framebuffer->RestoreDrawBuffersAfterClear();
framebuffer_manager()->MarkAttachmentsAsCleared(