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

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: 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
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 13678 matching lines...) Expand 10 before | Expand all | Expand 10 after
13689 } 13689 }
13690 13690
13691 // This may be a slow command. Exit command processing to allow for 13691 // This may be a slow command. Exit command processing to allow for
13692 // context preemption and GPU watchdog checks. 13692 // context preemption and GPU watchdog checks.
13693 ExitCommandProcessingEarly(); 13693 ExitCommandProcessingEarly();
13694 return error::kNoError; 13694 return error::kNoError;
13695 } 13695 }
13696 13696
13697 bool GLES2DecoderImpl::ValidateCopyTexFormat( 13697 bool GLES2DecoderImpl::ValidateCopyTexFormat(
13698 const char* func_name, GLenum internal_format, 13698 const char* func_name, GLenum internal_format,
13699 GLenum read_format, GLenum read_type) { 13699 GLenum read_format, GLenum read_type) {
qiankun 2016/11/02 10:30:05 May I add an argument like "report_msg" to control
Zhenyao Mo 2016/11/02 18:26:08 Looks like this function always generates INVALID_
13700 if (read_format == 0) { 13700 if (read_format == 0) {
13701 LOCAL_SET_GL_ERROR( 13701 LOCAL_SET_GL_ERROR(
13702 GL_INVALID_OPERATION, func_name, "no valid color image"); 13702 GL_INVALID_OPERATION, func_name, "no valid color image");
13703 return false; 13703 return false;
13704 } 13704 }
13705 // Check we have compatible formats. 13705 // Check we have compatible formats.
13706 uint32_t channels_exist = GLES2Util::GetChannelsForFormat(read_format); 13706 uint32_t channels_exist = GLES2Util::GetChannelsForFormat(read_format);
13707 uint32_t channels_needed = GLES2Util::GetChannelsForFormat(internal_format); 13707 uint32_t channels_needed = GLES2Util::GetChannelsForFormat(internal_format);
13708 if (!channels_needed || 13708 if (!channels_needed ||
13709 (channels_needed & channels_exist) != channels_needed) { 13709 (channels_needed & channels_exist) != channels_needed) {
13710 LOCAL_SET_GL_ERROR( 13710 LOCAL_SET_GL_ERROR(
13711 GL_INVALID_OPERATION, func_name, "incompatible format"); 13711 GL_INVALID_OPERATION, func_name, "incompatible format");
13712 return false; 13712 return false;
13713 } 13713 }
13714 if (feature_info_->IsES3Enabled()) { 13714 if (feature_info_->IsES3Enabled()) {
13715 GLint color_encoding = GetColorEncodingFromInternalFormat(read_format); 13715 GLint color_encoding = GetColorEncodingFromInternalFormat(read_format);
13716 bool float_mismatch= feature_info_->ext_color_buffer_float_available() ?
13717 (GLES2Util::IsIntegerFormat(internal_format) !=
13718 GLES2Util::IsIntegerFormat(read_format)) :
13719 GLES2Util::IsFloatFormat(internal_format);
13716 if (color_encoding != GetColorEncodingFromInternalFormat(internal_format) || 13720 if (color_encoding != GetColorEncodingFromInternalFormat(internal_format) ||
13717 GLES2Util::IsFloatFormat(internal_format) || 13721 float_mismatch ||
13718 (GLES2Util::IsSignedIntegerFormat(internal_format) != 13722 (GLES2Util::IsSignedIntegerFormat(internal_format) !=
13719 GLES2Util::IsSignedIntegerFormat(read_format)) || 13723 GLES2Util::IsSignedIntegerFormat(read_format)) ||
13720 (GLES2Util::IsUnsignedIntegerFormat(internal_format) != 13724 (GLES2Util::IsUnsignedIntegerFormat(internal_format) !=
13721 GLES2Util::IsUnsignedIntegerFormat(read_format))) { 13725 GLES2Util::IsUnsignedIntegerFormat(read_format))) {
13722 LOCAL_SET_GL_ERROR( 13726 LOCAL_SET_GL_ERROR(
13723 GL_INVALID_OPERATION, func_name, "incompatible format"); 13727 GL_INVALID_OPERATION, func_name, "incompatible format");
13724 return false; 13728 return false;
13725 } 13729 }
13726 } 13730 }
13727 if ((channels_needed & (GLES2Util::kDepth | GLES2Util::kStencil)) != 0) { 13731 if ((channels_needed & (GLES2Util::kDepth | GLES2Util::kStencil)) != 0) {
(...skipping 5042 matching lines...) Expand 10 before | Expand all | Expand 10 after
18770 } 18774 }
18771 18775
18772 // Include the auto-generated part of this file. We split this because it means 18776 // Include the auto-generated part of this file. We split this because it means
18773 // we can easily edit the non-auto generated parts right here in this file 18777 // we can easily edit the non-auto generated parts right here in this file
18774 // instead of having to edit some template or the code generator. 18778 // instead of having to edit some template or the code generator.
18775 #include "base/macros.h" 18779 #include "base/macros.h"
18776 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 18780 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
18777 18781
18778 } // namespace gles2 18782 } // namespace gles2
18779 } // namespace gpu 18783 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698