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

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

Issue 72173002: gpu: Support ES3 msaa and depth/stencil formats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment, rebase Created 7 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 | Annotate | Revision Log
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/feature_info.h" 5 #include "gpu/command_buffer/service/feature_info.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "gpu/command_buffer/service/gpu_switches.h" 10 #include "gpu/command_buffer/service/gpu_switches.h"
(...skipping 14 matching lines...) Expand all
25 using ::testing::Pointee; 25 using ::testing::Pointee;
26 using ::testing::Return; 26 using ::testing::Return;
27 using ::testing::SetArrayArgument; 27 using ::testing::SetArrayArgument;
28 using ::testing::SetArgumentPointee; 28 using ::testing::SetArgumentPointee;
29 using ::testing::StrEq; 29 using ::testing::StrEq;
30 using ::testing::StrictMock; 30 using ::testing::StrictMock;
31 31
32 namespace gpu { 32 namespace gpu {
33 namespace gles2 { 33 namespace gles2 {
34 34
35 namespace {
36 const char kGLRendererStringANGLE[] = "ANGLE (some renderer)";
37 } // anonymous namespace
38
35 class FeatureInfoTest : public testing::Test { 39 class FeatureInfoTest : public testing::Test {
36 public: 40 public:
37 FeatureInfoTest() { 41 FeatureInfoTest() {
38 } 42 }
39 43
40 void SetupInitExpectations(const char* extensions) { 44 void SetupInitExpectations(const char* extensions) {
41 SetupInitExpectationsWithGLVersion(extensions, ""); 45 SetupInitExpectationsWithGLVersion(extensions, "", "");
42 } 46 }
43 47
44 void SetupInitExpectationsWithGLVersion( 48 void SetupInitExpectationsWithGLVersion(
45 const char* extensions, const char* version) { 49 const char* extensions, const char* renderer, const char* version) {
46 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 50 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
47 gl_.get(), extensions, version); 51 gl_.get(), extensions, renderer, version);
48 info_ = new FeatureInfo(); 52 info_ = new FeatureInfo();
49 info_->Initialize(); 53 info_->Initialize();
50 } 54 }
51 55
52 void SetupWithCommandLine(const CommandLine& command_line) { 56 void SetupWithCommandLine(const CommandLine& command_line) {
53 info_ = new FeatureInfo(command_line); 57 info_ = new FeatureInfo(command_line);
54 } 58 }
55 59
56 void SetupInitExpectationsWithCommandLine( 60 void SetupInitExpectationsWithCommandLine(
57 const char* extensions, const CommandLine& command_line) { 61 const char* extensions, const CommandLine& command_line) {
58 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 62 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
59 gl_.get(), extensions, ""); 63 gl_.get(), extensions, "", "");
60 info_ = new FeatureInfo(command_line); 64 info_ = new FeatureInfo(command_line);
61 info_->Initialize(); 65 info_->Initialize();
62 } 66 }
63 67
64 void SetupWithoutInit() { 68 void SetupWithoutInit() {
65 info_ = new FeatureInfo(); 69 info_ = new FeatureInfo();
66 } 70 }
67 71
68 protected: 72 protected:
69 virtual void SetUp() { 73 virtual void SetUp() {
(...skipping 18 matching lines...) Expand all
88 const GLenum* types; 92 const GLenum* types;
89 size_t count; 93 size_t count;
90 }; 94 };
91 95
92 } // anonymous namespace. 96 } // anonymous namespace.
93 97
94 TEST_F(FeatureInfoTest, Basic) { 98 TEST_F(FeatureInfoTest, Basic) {
95 SetupWithoutInit(); 99 SetupWithoutInit();
96 // Test it starts off uninitialized. 100 // Test it starts off uninitialized.
97 EXPECT_FALSE(info_->feature_flags().chromium_framebuffer_multisample); 101 EXPECT_FALSE(info_->feature_flags().chromium_framebuffer_multisample);
102 EXPECT_FALSE(info_->feature_flags().use_core_framebuffer_multisample);
98 EXPECT_FALSE(info_->feature_flags().multisampled_render_to_texture); 103 EXPECT_FALSE(info_->feature_flags().multisampled_render_to_texture);
99 EXPECT_FALSE(info_->feature_flags( 104 EXPECT_FALSE(info_->feature_flags(
100 ).use_img_for_multisampled_render_to_texture); 105 ).use_img_for_multisampled_render_to_texture);
101 EXPECT_FALSE(info_->feature_flags().oes_standard_derivatives); 106 EXPECT_FALSE(info_->feature_flags().oes_standard_derivatives);
102 EXPECT_FALSE(info_->feature_flags().npot_ok); 107 EXPECT_FALSE(info_->feature_flags().npot_ok);
103 EXPECT_FALSE(info_->feature_flags().enable_texture_float_linear); 108 EXPECT_FALSE(info_->feature_flags().enable_texture_float_linear);
104 EXPECT_FALSE(info_->feature_flags().enable_texture_half_float_linear); 109 EXPECT_FALSE(info_->feature_flags().enable_texture_half_float_linear);
105 EXPECT_FALSE(info_->feature_flags().oes_egl_image_external); 110 EXPECT_FALSE(info_->feature_flags().oes_egl_image_external);
111 EXPECT_FALSE(info_->feature_flags().oes_depth24);
112 EXPECT_FALSE(info_->feature_flags().packed_depth24_stencil8);
106 EXPECT_FALSE(info_->feature_flags().chromium_stream_texture); 113 EXPECT_FALSE(info_->feature_flags().chromium_stream_texture);
107 EXPECT_FALSE(info_->feature_flags().angle_translated_shader_source); 114 EXPECT_FALSE(info_->feature_flags().angle_translated_shader_source);
108 EXPECT_FALSE(info_->feature_flags().angle_pack_reverse_row_order); 115 EXPECT_FALSE(info_->feature_flags().angle_pack_reverse_row_order);
109 EXPECT_FALSE(info_->feature_flags().arb_texture_rectangle); 116 EXPECT_FALSE(info_->feature_flags().arb_texture_rectangle);
110 EXPECT_FALSE(info_->feature_flags().angle_instanced_arrays); 117 EXPECT_FALSE(info_->feature_flags().angle_instanced_arrays);
111 EXPECT_FALSE(info_->feature_flags().occlusion_query_boolean); 118 EXPECT_FALSE(info_->feature_flags().occlusion_query_boolean);
112 EXPECT_FALSE(info_->feature_flags( 119 EXPECT_FALSE(info_->feature_flags(
113 ).use_arb_occlusion_query2_for_occlusion_query_boolean); 120 ).use_arb_occlusion_query2_for_occlusion_query_boolean);
114 EXPECT_FALSE(info_->feature_flags( 121 EXPECT_FALSE(info_->feature_flags(
115 ).use_arb_occlusion_query_for_occlusion_query_boolean); 122 ).use_arb_occlusion_query_for_occlusion_query_boolean);
116 EXPECT_FALSE(info_->feature_flags().native_vertex_array_object); 123 EXPECT_FALSE(info_->feature_flags().native_vertex_array_object);
117 EXPECT_FALSE(info_->feature_flags().map_buffer_range); 124 EXPECT_FALSE(info_->feature_flags().map_buffer_range);
118 EXPECT_FALSE(info_->feature_flags().use_async_readpixels); 125 EXPECT_FALSE(info_->feature_flags().use_async_readpixels);
119 EXPECT_FALSE(info_->feature_flags().ext_discard_framebuffer); 126 EXPECT_FALSE(info_->feature_flags().ext_discard_framebuffer);
120 EXPECT_FALSE(info_->feature_flags().angle_depth_texture); 127 EXPECT_FALSE(info_->feature_flags().angle_depth_texture);
128 EXPECT_FALSE(info_->feature_flags().is_angle);
121 129
122 #define GPU_OP(type, name) EXPECT_FALSE(info_->workarounds().name); 130 #define GPU_OP(type, name) EXPECT_FALSE(info_->workarounds().name);
123 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) 131 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
124 #undef GPU_OP 132 #undef GPU_OP
125 EXPECT_EQ(0, info_->workarounds().max_texture_size); 133 EXPECT_EQ(0, info_->workarounds().max_texture_size);
126 EXPECT_EQ(0, info_->workarounds().max_cube_map_texture_size); 134 EXPECT_EQ(0, info_->workarounds().max_cube_map_texture_size);
127 135
128 // Test good types. 136 // Test good types.
129 { 137 {
130 static const GLenum kAlphaTypes[] = { 138 static const GLenum kAlphaTypes[] = {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 EXPECT_FALSE(info_->validators()->texture_parameter.IsValid( 290 EXPECT_FALSE(info_->validators()->texture_parameter.IsValid(
283 GL_TEXTURE_USAGE_ANGLE)); 291 GL_TEXTURE_USAGE_ANGLE));
284 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid( 292 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
285 GL_DEPTH_COMPONENT16)); 293 GL_DEPTH_COMPONENT16));
286 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid( 294 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
287 GL_DEPTH_COMPONENT32_OES)); 295 GL_DEPTH_COMPONENT32_OES));
288 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid( 296 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
289 GL_DEPTH24_STENCIL8_OES)); 297 GL_DEPTH24_STENCIL8_OES));
290 } 298 }
291 299
300 TEST_F(FeatureInfoTest, InitializeWithANGLE) {
301 SetupInitExpectationsWithGLVersion("", kGLRendererStringANGLE, "");
302 EXPECT_TRUE(info_->feature_flags().is_angle);
303 }
304
292 TEST_F(FeatureInfoTest, InitializeNPOTExtensionGLES) { 305 TEST_F(FeatureInfoTest, InitializeNPOTExtensionGLES) {
293 SetupInitExpectations("GL_OES_texture_npot"); 306 SetupInitExpectations("GL_OES_texture_npot");
294 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_texture_npot")); 307 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_texture_npot"));
295 EXPECT_TRUE(info_->feature_flags().npot_ok); 308 EXPECT_TRUE(info_->feature_flags().npot_ok);
296 } 309 }
297 310
298 TEST_F(FeatureInfoTest, InitializeNPOTExtensionGL) { 311 TEST_F(FeatureInfoTest, InitializeNPOTExtensionGL) {
299 SetupInitExpectations("GL_ARB_texture_non_power_of_two"); 312 SetupInitExpectations("GL_ARB_texture_non_power_of_two");
300 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_texture_npot")); 313 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_texture_npot"));
301 EXPECT_TRUE(info_->feature_flags().npot_ok); 314 EXPECT_TRUE(info_->feature_flags().npot_ok);
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 EXPECT_TRUE(info_->validators()->frame_buffer_target.IsValid( 554 EXPECT_TRUE(info_->validators()->frame_buffer_target.IsValid(
542 GL_DRAW_FRAMEBUFFER_EXT)); 555 GL_DRAW_FRAMEBUFFER_EXT));
543 EXPECT_TRUE(info_->validators()->g_l_state.IsValid( 556 EXPECT_TRUE(info_->validators()->g_l_state.IsValid(
544 GL_READ_FRAMEBUFFER_BINDING_EXT)); 557 GL_READ_FRAMEBUFFER_BINDING_EXT));
545 EXPECT_TRUE(info_->validators()->g_l_state.IsValid( 558 EXPECT_TRUE(info_->validators()->g_l_state.IsValid(
546 GL_MAX_SAMPLES_EXT)); 559 GL_MAX_SAMPLES_EXT));
547 EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid( 560 EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(
548 GL_RENDERBUFFER_SAMPLES_EXT)); 561 GL_RENDERBUFFER_SAMPLES_EXT));
549 } 562 }
550 563
564 TEST_F(FeatureInfoTest, InitializeANGLE_framebuffer_multisample) {
565 SetupInitExpectationsWithGLVersion(
566 "GL_ANGLE_framebuffer_multisample", kGLRendererStringANGLE, "");
567 EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);
568 EXPECT_THAT(info_->extensions(),
569 HasSubstr("GL_CHROMIUM_framebuffer_multisample"));
570 EXPECT_TRUE(info_->validators()->frame_buffer_target.IsValid(
571 GL_READ_FRAMEBUFFER_EXT));
572 EXPECT_TRUE(info_->validators()->frame_buffer_target.IsValid(
573 GL_DRAW_FRAMEBUFFER_EXT));
574 EXPECT_TRUE(info_->validators()->g_l_state.IsValid(
575 GL_READ_FRAMEBUFFER_BINDING_EXT));
576 EXPECT_TRUE(info_->validators()->g_l_state.IsValid(
577 GL_MAX_SAMPLES_EXT));
578 EXPECT_TRUE(info_->validators()->render_buffer_parameter.IsValid(
579 GL_RENDERBUFFER_SAMPLES_EXT));
580 }
581
582 // We don't allow ANGLE_framebuffer_multisample on non-ANGLE implementations,
583 // because we wouldn't be choosing the right driver entry point and because the
584 // extension was falsely advertised on some Android devices (crbug.com/165736).
585 TEST_F(FeatureInfoTest, InitializeANGLE_framebuffer_multisampleWithoutANGLE) {
586 SetupInitExpectations("GL_ANGLE_framebuffer_multisample");
587 EXPECT_FALSE(info_->feature_flags().chromium_framebuffer_multisample);
588 EXPECT_THAT(info_->extensions(),
589 Not(HasSubstr("GL_CHROMIUM_framebuffer_multisample")));
590 EXPECT_FALSE(info_->validators()->frame_buffer_target.IsValid(
591 GL_READ_FRAMEBUFFER_EXT));
592 EXPECT_FALSE(info_->validators()->frame_buffer_target.IsValid(
593 GL_DRAW_FRAMEBUFFER_EXT));
594 EXPECT_FALSE(info_->validators()->g_l_state.IsValid(
595 GL_READ_FRAMEBUFFER_BINDING_EXT));
596 EXPECT_FALSE(info_->validators()->g_l_state.IsValid(
597 GL_MAX_SAMPLES_EXT));
598 EXPECT_FALSE(info_->validators()->render_buffer_parameter.IsValid(
599 GL_RENDERBUFFER_SAMPLES_EXT));
600 }
601
551 TEST_F(FeatureInfoTest, InitializeEXT_multisampled_render_to_texture) { 602 TEST_F(FeatureInfoTest, InitializeEXT_multisampled_render_to_texture) {
552 SetupInitExpectations("GL_EXT_multisampled_render_to_texture"); 603 SetupInitExpectations("GL_EXT_multisampled_render_to_texture");
553 EXPECT_TRUE(info_->feature_flags( 604 EXPECT_TRUE(info_->feature_flags(
554 ).multisampled_render_to_texture); 605 ).multisampled_render_to_texture);
555 EXPECT_FALSE(info_->feature_flags( 606 EXPECT_FALSE(info_->feature_flags(
556 ).use_img_for_multisampled_render_to_texture); 607 ).use_img_for_multisampled_render_to_texture);
557 EXPECT_THAT(info_->extensions(), 608 EXPECT_THAT(info_->extensions(),
558 HasSubstr("GL_EXT_multisampled_render_to_texture")); 609 HasSubstr("GL_EXT_multisampled_render_to_texture"));
559 EXPECT_TRUE(info_->validators()->g_l_state.IsValid( 610 EXPECT_TRUE(info_->validators()->g_l_state.IsValid(
560 GL_MAX_SAMPLES_EXT)); 611 GL_MAX_SAMPLES_EXT));
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_COMPONENT).IsValid( 752 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_COMPONENT).IsValid(
702 GL_UNSIGNED_SHORT)); 753 GL_UNSIGNED_SHORT));
703 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_COMPONENT).IsValid( 754 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_COMPONENT).IsValid(
704 GL_UNSIGNED_INT)); 755 GL_UNSIGNED_INT));
705 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_STENCIL).IsValid( 756 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_STENCIL).IsValid(
706 GL_UNSIGNED_INT_24_8)); 757 GL_UNSIGNED_INT_24_8));
707 } 758 }
708 759
709 TEST_F(FeatureInfoTest, InitializeOES_depth24) { 760 TEST_F(FeatureInfoTest, InitializeOES_depth24) {
710 SetupInitExpectations("GL_OES_depth24"); 761 SetupInitExpectations("GL_OES_depth24");
762 EXPECT_TRUE(info_->feature_flags().oes_depth24);
711 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_depth24")); 763 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_depth24"));
712 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid( 764 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(
713 GL_DEPTH_COMPONENT24)); 765 GL_DEPTH_COMPONENT24));
714 } 766 }
715 767
716 TEST_F(FeatureInfoTest, InitializeOES_standard_derivatives) { 768 TEST_F(FeatureInfoTest, InitializeOES_standard_derivatives) {
717 SetupInitExpectations("GL_OES_standard_derivatives"); 769 SetupInitExpectations("GL_OES_standard_derivatives");
718 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_standard_derivatives")); 770 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_standard_derivatives"));
719 EXPECT_TRUE(info_->feature_flags().oes_standard_derivatives); 771 EXPECT_TRUE(info_->feature_flags().oes_standard_derivatives);
720 EXPECT_TRUE(info_->validators()->hint_target.IsValid( 772 EXPECT_TRUE(info_->validators()->hint_target.IsValid(
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_frag_depth")); 905 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_frag_depth"));
854 } 906 }
855 907
856 TEST_F(FeatureInfoTest, InitializeEXT_discard_framebuffer) { 908 TEST_F(FeatureInfoTest, InitializeEXT_discard_framebuffer) {
857 SetupInitExpectations("GL_EXT_discard_framebuffer"); 909 SetupInitExpectations("GL_EXT_discard_framebuffer");
858 EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer); 910 EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer);
859 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_discard_framebuffer")); 911 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_discard_framebuffer"));
860 } 912 }
861 913
862 TEST_F(FeatureInfoTest, InitializeSamplersWithARBSamplerObjects) { 914 TEST_F(FeatureInfoTest, InitializeSamplersWithARBSamplerObjects) {
863 SetupInitExpectationsWithGLVersion("GL_ARB_sampler_objects", "OpenGL 3.0"); 915 SetupInitExpectationsWithGLVersion(
916 "GL_ARB_sampler_objects", "", "OpenGL 3.0");
864 EXPECT_TRUE(info_->feature_flags().enable_samplers); 917 EXPECT_TRUE(info_->feature_flags().enable_samplers);
865 } 918 }
866 919
867 TEST_F(FeatureInfoTest, InitializeWithES3) { 920 TEST_F(FeatureInfoTest, InitializeWithES3) {
868 SetupInitExpectationsWithGLVersion("", "OpenGL ES 3.0"); 921 SetupInitExpectationsWithGLVersion("", "", "OpenGL ES 3.0");
869 EXPECT_TRUE(info_->feature_flags().enable_samplers); 922 EXPECT_TRUE(info_->feature_flags().enable_samplers);
870 EXPECT_TRUE(info_->feature_flags().map_buffer_range); 923 EXPECT_TRUE(info_->feature_flags().map_buffer_range);
871 EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer); 924 EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer);
872 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_discard_framebuffer")); 925 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_discard_framebuffer"));
926 EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);
927 EXPECT_TRUE(info_->feature_flags().use_core_framebuffer_multisample);
928 EXPECT_THAT(info_->extensions(),
929 HasSubstr("GL_CHROMIUM_framebuffer_multisample"));
873 EXPECT_FALSE(info_->feature_flags().use_async_readpixels); 930 EXPECT_FALSE(info_->feature_flags().use_async_readpixels);
931 EXPECT_TRUE(info_->feature_flags().oes_depth24);
932 EXPECT_THAT(info_->extensions(), HasSubstr("GL_GOOGLE_depth_texture"));
933 EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_depth_texture"));
934 EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT_24_8));
935 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_COMPONENT)
936 .IsValid(GL_UNSIGNED_SHORT));
937 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_COMPONENT)
938 .IsValid(GL_UNSIGNED_INT));
939 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_STENCIL)
940 .IsValid(GL_UNSIGNED_INT_24_8));
941 EXPECT_TRUE(info_->feature_flags().packed_depth24_stencil8);
942 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_depth24"));
943 EXPECT_TRUE(
944 info_->validators()->render_buffer_format.IsValid(GL_DEPTH_COMPONENT24));
945 EXPECT_TRUE(
946 info_->validators()->render_buffer_format.IsValid(GL_DEPTH24_STENCIL8));
947 EXPECT_TRUE(
948 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));
949 EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));
874 } 950 }
875 951
876 TEST_F(FeatureInfoTest, InitializeWithoutSamplers) { 952 TEST_F(FeatureInfoTest, InitializeWithoutSamplers) {
877 SetupInitExpectationsWithGLVersion("", "OpenGL GL 3.0"); 953 SetupInitExpectationsWithGLVersion("", "", "OpenGL GL 3.0");
878 EXPECT_FALSE(info_->feature_flags().enable_samplers); 954 EXPECT_FALSE(info_->feature_flags().enable_samplers);
879 } 955 }
880 956
881 TEST_F(FeatureInfoTest, InitializeWithES3AndFences) { 957 TEST_F(FeatureInfoTest, InitializeWithES3AndFences) {
882 SetupInitExpectationsWithGLVersion("EGL_KHR_fence_sync", "OpenGL ES 3.0"); 958 SetupInitExpectationsWithGLVersion("EGL_KHR_fence_sync", "", "OpenGL ES 3.0");
883 EXPECT_TRUE(info_->feature_flags().use_async_readpixels); 959 EXPECT_TRUE(info_->feature_flags().use_async_readpixels);
884 } 960 }
885 961
886 TEST_F(FeatureInfoTest, ParseDriverBugWorkaroundsSingle) { 962 TEST_F(FeatureInfoTest, ParseDriverBugWorkaroundsSingle) {
887 CommandLine command_line(0, NULL); 963 CommandLine command_line(0, NULL);
888 command_line.AppendSwitchASCII( 964 command_line.AppendSwitchASCII(
889 switches::kGpuDriverBugWorkarounds, 965 switches::kGpuDriverBugWorkarounds,
890 base::IntToString(gpu::EXIT_ON_CONTEXT_LOST)); 966 base::IntToString(gpu::EXIT_ON_CONTEXT_LOST));
891 // Workarounds should get parsed without the need for a context. 967 // Workarounds should get parsed without the need for a context.
892 SetupWithCommandLine(command_line); 968 SetupWithCommandLine(command_line);
893 EXPECT_TRUE(info_->workarounds().exit_on_context_lost); 969 EXPECT_TRUE(info_->workarounds().exit_on_context_lost);
894 } 970 }
895 971
896 TEST_F(FeatureInfoTest, ParseDriverBugWorkaroundsMultiple) { 972 TEST_F(FeatureInfoTest, ParseDriverBugWorkaroundsMultiple) {
897 CommandLine command_line(0, NULL); 973 CommandLine command_line(0, NULL);
898 command_line.AppendSwitchASCII( 974 command_line.AppendSwitchASCII(
899 switches::kGpuDriverBugWorkarounds, 975 switches::kGpuDriverBugWorkarounds,
900 base::IntToString(gpu::EXIT_ON_CONTEXT_LOST) + "," + 976 base::IntToString(gpu::EXIT_ON_CONTEXT_LOST) + "," +
901 base::IntToString(gpu::MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024) + "," + 977 base::IntToString(gpu::MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024) + "," +
902 base::IntToString(gpu::MAX_TEXTURE_SIZE_LIMIT_4096)); 978 base::IntToString(gpu::MAX_TEXTURE_SIZE_LIMIT_4096));
903 // Workarounds should get parsed without the need for a context. 979 // Workarounds should get parsed without the need for a context.
904 SetupWithCommandLine(command_line); 980 SetupWithCommandLine(command_line);
905 EXPECT_TRUE(info_->workarounds().exit_on_context_lost); 981 EXPECT_TRUE(info_->workarounds().exit_on_context_lost);
906 EXPECT_EQ(1024, info_->workarounds().max_cube_map_texture_size); 982 EXPECT_EQ(1024, info_->workarounds().max_cube_map_texture_size);
907 EXPECT_EQ(4096, info_->workarounds().max_texture_size); 983 EXPECT_EQ(4096, info_->workarounds().max_texture_size);
908 } 984 }
909 985
910 } // namespace gles2 986 } // namespace gles2
911 } // namespace gpu 987 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698