Index: gpu/command_buffer/common/gles2_cmd_utils.cc |
=================================================================== |
--- gpu/command_buffer/common/gles2_cmd_utils.cc (revision 187725) |
+++ gpu/command_buffer/common/gles2_cmd_utils.cc (working copy) |
@@ -622,15 +622,19 @@ |
} |
} |
-uint32 GLES2Util::GetChannelsNeededForAttachmentType(int type) { |
+uint32 GLES2Util::GetChannelsNeededForAttachmentType( |
+ int type, uint32 max_color_attachments) { |
switch (type) { |
- case GL_COLOR_ATTACHMENT0: |
- return kRGBA; |
case GL_DEPTH_ATTACHMENT: |
return kDepth; |
case GL_STENCIL_ATTACHMENT: |
return kStencil; |
default: |
+ if (type >= GL_COLOR_ATTACHMENT0 && |
+ type < static_cast<int>( |
+ GL_COLOR_ATTACHMENT0 + max_color_attachments)) { |
+ return kRGBA; |
+ } |
return 0x0000; |
} |
} |