Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 7992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8003 "invalid filter for integer format"); | 8003 "invalid filter for integer format"); |
| 8004 return; | 8004 return; |
| 8005 } | 8005 } |
| 8006 | 8006 |
| 8007 GLenum src_sized_format = | 8007 GLenum src_sized_format = |
| 8008 GLES2Util::ConvertToSizedFormat(src_internal_format, src_type); | 8008 GLES2Util::ConvertToSizedFormat(src_internal_format, src_type); |
| 8009 DCHECK(read_framebuffer || (is_feedback_loop != FeedbackLoopUnknown)); | 8009 DCHECK(read_framebuffer || (is_feedback_loop != FeedbackLoopUnknown)); |
| 8010 const Framebuffer::Attachment* read_buffer = | 8010 const Framebuffer::Attachment* read_buffer = |
| 8011 is_feedback_loop == FeedbackLoopUnknown ? | 8011 is_feedback_loop == FeedbackLoopUnknown ? |
| 8012 read_framebuffer->GetReadBufferAttachment() : nullptr; | 8012 read_framebuffer->GetReadBufferAttachment() : nullptr; |
| 8013 bool draw_buffer_has_image = false; | |
| 8013 for (uint32_t ii = 0; ii < group_->max_draw_buffers(); ++ii) { | 8014 for (uint32_t ii = 0; ii < group_->max_draw_buffers(); ++ii) { |
| 8014 GLenum dst_format = GetBoundColorDrawBufferInternalFormat( | 8015 GLenum dst_format = GetBoundColorDrawBufferInternalFormat( |
| 8015 static_cast<GLint>(ii)); | 8016 static_cast<GLint>(ii)); |
| 8016 GLenum dst_type = GetBoundColorDrawBufferType(static_cast<GLint>(ii)); | 8017 GLenum dst_type = GetBoundColorDrawBufferType(static_cast<GLint>(ii)); |
| 8017 if (dst_format == 0) | 8018 if (dst_format == 0) |
| 8018 continue; | 8019 continue; |
| 8020 draw_buffer_has_image = true; | |
| 8019 if (!src_internal_format) { | 8021 if (!src_internal_format) { |
| 8020 read_framebuffer_miss_image = true; | 8022 read_framebuffer_miss_image = true; |
| 8021 } | 8023 } |
| 8022 if (GetColorEncodingFromInternalFormat(dst_format) == GL_SRGB) | 8024 if (GetColorEncodingFromInternalFormat(dst_format) == GL_SRGB) |
| 8023 draw_buffers_has_srgb = true; | 8025 draw_buffers_has_srgb = true; |
| 8024 if (read_buffer_samples > 0 && | 8026 if (read_buffer_samples > 0 && |
| 8025 (src_sized_format != | 8027 (src_sized_format != |
| 8026 GLES2Util::ConvertToSizedFormat(dst_format, dst_type))) { | 8028 GLES2Util::ConvertToSizedFormat(dst_format, dst_type))) { |
| 8027 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, | 8029 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, |
| 8028 "src and dst formats differ for color"); | 8030 "src and dst formats differ for color"); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 8045 draw_framebuffer->GetAttachment(attachment); | 8047 draw_framebuffer->GetAttachment(attachment); |
| 8046 if (!draw_buffer || !read_buffer) { | 8048 if (!draw_buffer || !read_buffer) { |
| 8047 continue; | 8049 continue; |
| 8048 } | 8050 } |
| 8049 if (draw_buffer->IsSameAttachment(read_buffer)) { | 8051 if (draw_buffer->IsSameAttachment(read_buffer)) { |
| 8050 is_feedback_loop = FeedbackLoopTrue; | 8052 is_feedback_loop = FeedbackLoopTrue; |
| 8051 break; | 8053 break; |
| 8052 } | 8054 } |
| 8053 } | 8055 } |
| 8054 } | 8056 } |
| 8057 if (draw_framebuffer && !draw_buffer_has_image) | |
|
Zhenyao Mo
2016/12/16 23:50:31
You can't return early here. DEPTH and STENCIL mi
yunchao
2016/12/19 03:20:08
You are correct. I made a mistake here. The code h
| |
| 8058 return; | |
| 8055 } | 8059 } |
| 8056 if (is_feedback_loop == FeedbackLoopTrue) { | 8060 if (is_feedback_loop == FeedbackLoopTrue) { |
| 8057 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, | 8061 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, |
| 8058 "source buffer and destination buffers are identical"); | 8062 "source buffer and destination buffers are identical"); |
| 8059 return; | 8063 return; |
| 8060 } | 8064 } |
| 8061 if (read_framebuffer_miss_image == true) { | 8065 if (read_framebuffer_miss_image == true) { |
| 8062 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, | 8066 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, |
| 8063 "The designated attachment point(s) in read framebuffer miss image"); | 8067 "The designated attachment point(s) in read framebuffer miss image"); |
| 8064 return; | 8068 return; |
| (...skipping 10938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 19003 } | 19007 } |
| 19004 | 19008 |
| 19005 // Include the auto-generated part of this file. We split this because it means | 19009 // Include the auto-generated part of this file. We split this because it means |
| 19006 // we can easily edit the non-auto generated parts right here in this file | 19010 // we can easily edit the non-auto generated parts right here in this file |
| 19007 // instead of having to edit some template or the code generator. | 19011 // instead of having to edit some template or the code generator. |
| 19008 #include "base/macros.h" | 19012 #include "base/macros.h" |
| 19009 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19013 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 19010 | 19014 |
| 19011 } // namespace gles2 | 19015 } // namespace gles2 |
| 19012 } // namespace gpu | 19016 } // namespace gpu |
| OLD | NEW |