Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2496633005: Fix unsized internalformat color-renderable detection (Closed)
Patch Set: fix comments of zmo Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13734 matching lines...) Expand 10 before | Expand all | Expand 10 after
13745 uint32_t channels_exist = GLES2Util::GetChannelsForFormat(read_format); 13745 uint32_t channels_exist = GLES2Util::GetChannelsForFormat(read_format);
13746 uint32_t channels_needed = GLES2Util::GetChannelsForFormat(internal_format); 13746 uint32_t channels_needed = GLES2Util::GetChannelsForFormat(internal_format);
13747 if (!channels_needed || 13747 if (!channels_needed ||
13748 (channels_needed & channels_exist) != channels_needed) { 13748 (channels_needed & channels_exist) != channels_needed) {
13749 LOCAL_SET_GL_ERROR( 13749 LOCAL_SET_GL_ERROR(
13750 GL_INVALID_OPERATION, func_name, "incompatible format"); 13750 GL_INVALID_OPERATION, func_name, "incompatible format");
13751 return false; 13751 return false;
13752 } 13752 }
13753 if (feature_info_->IsWebGL2OrES3Context()) { 13753 if (feature_info_->IsWebGL2OrES3Context()) {
13754 GLint color_encoding = GetColorEncodingFromInternalFormat(read_format); 13754 GLint color_encoding = GetColorEncodingFromInternalFormat(read_format);
13755 bool float_mismatch= feature_info_->ext_color_buffer_float_available() ? 13755 bool float_mismatch = feature_info_->ext_color_buffer_float_available() ?
13756 (GLES2Util::IsIntegerFormat(internal_format) != 13756 (GLES2Util::IsIntegerFormat(internal_format) !=
13757 GLES2Util::IsIntegerFormat(read_format)) : 13757 GLES2Util::IsIntegerFormat(read_format)) :
13758 GLES2Util::IsFloatFormat(internal_format); 13758 GLES2Util::IsFloatFormat(internal_format);
13759 if (color_encoding != GetColorEncodingFromInternalFormat(internal_format) || 13759 if (color_encoding != GetColorEncodingFromInternalFormat(internal_format) ||
13760 float_mismatch || 13760 float_mismatch ||
13761 (GLES2Util::IsSignedIntegerFormat(internal_format) != 13761 (GLES2Util::IsSignedIntegerFormat(internal_format) !=
13762 GLES2Util::IsSignedIntegerFormat(read_format)) || 13762 GLES2Util::IsSignedIntegerFormat(read_format)) ||
13763 (GLES2Util::IsUnsignedIntegerFormat(internal_format) != 13763 (GLES2Util::IsUnsignedIntegerFormat(internal_format) !=
13764 GLES2Util::IsUnsignedIntegerFormat(read_format))) { 13764 GLES2Util::IsUnsignedIntegerFormat(read_format))) {
13765 LOCAL_SET_GL_ERROR( 13765 LOCAL_SET_GL_ERROR(
(...skipping 5092 matching lines...) Expand 10 before | Expand all | Expand 10 after
18858 } 18858 }
18859 18859
18860 // Include the auto-generated part of this file. We split this because it means 18860 // Include the auto-generated part of this file. We split this because it means
18861 // we can easily edit the non-auto generated parts right here in this file 18861 // we can easily edit the non-auto generated parts right here in this file
18862 // instead of having to edit some template or the code generator. 18862 // instead of having to edit some template or the code generator.
18863 #include "base/macros.h" 18863 #include "base/macros.h"
18864 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 18864 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
18865 18865
18866 } // namespace gles2 18866 } // namespace gles2
18867 } // namespace gpu 18867 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698