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

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

Issue 2474593002: Float formats are allowed for CopyTexImage with EXT_color_buffer_float (Closed)
Patch Set: rebase only 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/gles2_cmd_decoder_unittest_framebuffers.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 13698 matching lines...) Expand 10 before | Expand all | Expand 10 after
13709 uint32_t channels_exist = GLES2Util::GetChannelsForFormat(read_format); 13709 uint32_t channels_exist = GLES2Util::GetChannelsForFormat(read_format);
13710 uint32_t channels_needed = GLES2Util::GetChannelsForFormat(internal_format); 13710 uint32_t channels_needed = GLES2Util::GetChannelsForFormat(internal_format);
13711 if (!channels_needed || 13711 if (!channels_needed ||
13712 (channels_needed & channels_exist) != channels_needed) { 13712 (channels_needed & channels_exist) != channels_needed) {
13713 LOCAL_SET_GL_ERROR( 13713 LOCAL_SET_GL_ERROR(
13714 GL_INVALID_OPERATION, func_name, "incompatible format"); 13714 GL_INVALID_OPERATION, func_name, "incompatible format");
13715 return false; 13715 return false;
13716 } 13716 }
13717 if (feature_info_->IsWebGL2OrES3Context()) { 13717 if (feature_info_->IsWebGL2OrES3Context()) {
13718 GLint color_encoding = GetColorEncodingFromInternalFormat(read_format); 13718 GLint color_encoding = GetColorEncodingFromInternalFormat(read_format);
13719 bool float_mismatch= feature_info_->ext_color_buffer_float_available() ?
13720 (GLES2Util::IsIntegerFormat(internal_format) !=
13721 GLES2Util::IsIntegerFormat(read_format)) :
13722 GLES2Util::IsFloatFormat(internal_format);
13719 if (color_encoding != GetColorEncodingFromInternalFormat(internal_format) || 13723 if (color_encoding != GetColorEncodingFromInternalFormat(internal_format) ||
13720 GLES2Util::IsFloatFormat(internal_format) || 13724 float_mismatch ||
13721 (GLES2Util::IsSignedIntegerFormat(internal_format) != 13725 (GLES2Util::IsSignedIntegerFormat(internal_format) !=
13722 GLES2Util::IsSignedIntegerFormat(read_format)) || 13726 GLES2Util::IsSignedIntegerFormat(read_format)) ||
13723 (GLES2Util::IsUnsignedIntegerFormat(internal_format) != 13727 (GLES2Util::IsUnsignedIntegerFormat(internal_format) !=
13724 GLES2Util::IsUnsignedIntegerFormat(read_format))) { 13728 GLES2Util::IsUnsignedIntegerFormat(read_format))) {
13725 LOCAL_SET_GL_ERROR( 13729 LOCAL_SET_GL_ERROR(
13726 GL_INVALID_OPERATION, func_name, "incompatible format"); 13730 GL_INVALID_OPERATION, func_name, "incompatible format");
13727 return false; 13731 return false;
13728 } 13732 }
13729 } 13733 }
13730 if ((channels_needed & (GLES2Util::kDepth | GLES2Util::kStencil)) != 0) { 13734 if ((channels_needed & (GLES2Util::kDepth | GLES2Util::kStencil)) != 0) {
(...skipping 5055 matching lines...) Expand 10 before | Expand all | Expand 10 after
18786 } 18790 }
18787 18791
18788 // Include the auto-generated part of this file. We split this because it means 18792 // Include the auto-generated part of this file. We split this because it means
18789 // we can easily edit the non-auto generated parts right here in this file 18793 // we can easily edit the non-auto generated parts right here in this file
18790 // instead of having to edit some template or the code generator. 18794 // instead of having to edit some template or the code generator.
18791 #include "base/macros.h" 18795 #include "base/macros.h"
18792 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 18796 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
18793 18797
18794 } // namespace gles2 18798 } // namespace gles2
18795 } // namespace gpu 18799 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698