| Index: gpu/command_buffer/service/framebuffer_manager.cc
|
| diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc
|
| index c353136440281758735d8c74fec7a33b9c84b9af..54a931cdcdc35dc07f3d6f3eb6b53071b90e0de2 100644
|
| --- a/gpu/command_buffer/service/framebuffer_manager.cc
|
| +++ b/gpu/command_buffer/service/framebuffer_manager.cc
|
| @@ -579,6 +579,11 @@ GLenum Framebuffer::IsPossiblyComplete(const FeatureInfo* feature_info) const {
|
| GLsizei width = -1;
|
| GLsizei height = -1;
|
| GLsizei samples = -1;
|
| + const bool kSamplesMustMatch =
|
| + feature_info->context_type() == CONTEXT_TYPE_WEBGL1 ||
|
| + feature_info->context_type() == CONTEXT_TYPE_WEBGL2 ||
|
| + !feature_info->feature_flags().chromium_framebuffer_mixed_samples;
|
| +
|
| for (AttachmentMap::const_iterator it = attachments_.begin();
|
| it != attachments_.end(); ++it) {
|
| GLenum attachment_type = it->first;
|
| @@ -603,13 +608,16 @@ GLenum Framebuffer::IsPossiblyComplete(const FeatureInfo* feature_info) const {
|
| // behaviors across platforms.
|
| return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT;
|
| }
|
| - if (samples < 0) {
|
| - samples = attachment->samples();
|
| - } else if (attachment->samples() != samples) {
|
| - // It's possible that the specified samples isn't the actual samples a
|
| - // GL implementation uses, but we always return INCOMPLETE_MULTISAMPLE
|
| - // here to ensure consistent behaviors across platforms.
|
| - return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
|
| +
|
| + if (kSamplesMustMatch) {
|
| + if (samples < 0) {
|
| + samples = attachment->samples();
|
| + } else if (attachment->samples() != samples) {
|
| + // It's possible that the specified samples isn't the actual samples a
|
| + // GL implementation uses, but we always return INCOMPLETE_MULTISAMPLE
|
| + // here to ensure consistent behaviors across platforms.
|
| + return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
|
| + }
|
| }
|
| if (!attachment->CanRenderTo(feature_info)) {
|
| return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
|
|
|