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

Side by Side Diff: gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc

Issue 2717953003: Support RGB32F and RGBA32F for CopyTextureCHROMIUM in ES2 with related extensions (Closed)
Patch Set: fix android bots Created 3 years, 9 months 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 | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | 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 #ifndef GL_GLEXT_PROTOTYPES 5 #ifndef GL_GLEXT_PROTOTYPES
6 #define GL_GLEXT_PROTOTYPES 6 #define GL_GLEXT_PROTOTYPES
7 #endif 7 #endif
8 8
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 } 766 }
767 767
768 EXPECT_TRUE(GL_NO_ERROR == glGetError()) << "src_index:" << src_index 768 EXPECT_TRUE(GL_NO_ERROR == glGetError()) << "src_index:" << src_index
769 << " dest_index:" << dest_index; 769 << " dest_index:" << dest_index;
770 glDeleteTextures(2, textures_); 770 glDeleteTextures(2, textures_);
771 glDeleteFramebuffers(1, &framebuffer_id_); 771 glDeleteFramebuffers(1, &framebuffer_id_);
772 } 772 }
773 } 773 }
774 } 774 }
775 775
776 TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatRGBFloat) {
777 if (!GLTestHelper::HasExtension("GL_CHROMIUM_color_buffer_float_rgb")) {
778 LOG(INFO)
779 << "GL_CHROMIUM_color_buffer_float_rgb not supported. Skipping test...";
780 return;
781 }
782 // TODO(qiankun.miao@intel.com): since RunCopyTexture requires dest texture to
783 // be texture complete, skip this test if float texture is not color
784 // filterable. We should remove this limitation when we find a way doesn't
785 // require dest texture to be texture complete in RunCopyTexture.
786 if (!gl_.decoder()
787 ->GetFeatureInfo()
788 ->feature_flags()
789 .enable_texture_float_linear)
Zhenyao Mo 2017/03/02 17:31:53 This is always false by default unless you explici
Ken Russell (switch to Gerrit) 2017/03/02 18:26:06 Is that accurate? It looks like GLManager::Initial
790 return;
791 CopyType copy_type = GetParam();
792 FormatType src_format_type = {GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE};
793 FormatType dest_format_type = {GL_RGB32F, GL_RGB, GL_FLOAT};
794
795 RunCopyTexture(GL_TEXTURE_2D, copy_type, src_format_type, 0, dest_format_type,
796 0, false);
797 }
798
799 TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatRGBAFloat) {
800 if (!GLTestHelper::HasExtension("GL_CHROMIUM_color_buffer_float_rgba")) {
801 LOG(INFO) << "GL_CHROMIUM_color_buffer_float_rgba not supported. Skipping "
802 "test...";
803 return;
804 }
805 // TODO(qiankun.miao@intel.com): since RunCopyTexture requires dest texture to
806 // be texture complete, skip this test if float texture is not color
807 // filterable. We should remove this limitation when we find a way doesn't
808 // require dest texture to be texture complete in RunCopyTexture.
809 if (!gl_.decoder()
810 ->GetFeatureInfo()
811 ->feature_flags()
812 .enable_texture_float_linear)
813 return;
814 CopyType copy_type = GetParam();
815 FormatType src_format_type = {GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE};
816 FormatType dest_format_type = {GL_RGBA32F, GL_RGBA, GL_FLOAT};
817
818 RunCopyTexture(GL_TEXTURE_2D, copy_type, src_format_type, 0, dest_format_type,
819 0, false);
820 }
821
776 TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) { 822 TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) {
777 CopyType copy_type = GetParam(); 823 CopyType copy_type = GetParam();
778 CreateAndBindDestinationTextureAndFBO(GL_TEXTURE_2D); 824 CreateAndBindDestinationTextureAndFBO(GL_TEXTURE_2D);
779 glBindTexture(GL_TEXTURE_2D, textures_[0]); 825 glBindTexture(GL_TEXTURE_2D, textures_[0]);
780 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 826 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
781 nullptr); 827 nullptr);
782 EXPECT_TRUE(GL_NO_ERROR == glGetError()); 828 EXPECT_TRUE(GL_NO_ERROR == glGetError());
783 829
784 // Check unsupported format reports error. 830 // Check unsupported format reports error.
785 GLint unsupported_dest_formats[] = {GL_RED, GL_RG}; 831 GLint unsupported_dest_formats[] = {GL_RED, GL_RG};
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 } 1632 }
1587 } 1633 }
1588 1634
1589 glDeleteTextures(2, textures_); 1635 glDeleteTextures(2, textures_);
1590 glDeleteFramebuffers(1, &framebuffer_id_); 1636 glDeleteFramebuffers(1, &framebuffer_id_);
1591 } 1637 }
1592 } 1638 }
1593 } 1639 }
1594 1640
1595 } // namespace gpu 1641 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698