diff options
author | qiankun.miao <qiankun.miao@intel.com> | 2015-09-17 20:34:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-18 03:35:50 +0000 |
commit | 4e2f0d09bae5ad062f5f35de0349f53f0f99122e (patch) | |
tree | c3048b2d26ead202d6d9b134c8f7348d464aedea /gpu | |
parent | 04b6b6f6d76cb8bc118bcc7cb271bee74747dbee (diff) | |
download | chromium_src-4e2f0d09bae5ad062f5f35de0349f53f0f99122e.zip chromium_src-4e2f0d09bae5ad062f5f35de0349f53f0f99122e.tar.gz chromium_src-4e2f0d09bae5ad062f5f35de0349f53f0f99122e.tar.bz2 |
Initialize default texture for GL_TEXTURE_3D and GL_TEXTURE_2D_ARRAY
ES3 supports GL_TEXTURE_3D and GL_TEXTURE_2D_ARRAY for glBindTexture. So
we should create default texture the the two targets.
BUG=429053
Review URL: https://codereview.chromium.org/1335873002
Cr-Commit-Position: refs/heads/master@{#349602}
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/test_helper.cc | 60 | ||||
-rw-r--r-- | gpu/command_buffer/service/test_helper.h | 18 | ||||
-rw-r--r-- | gpu/command_buffer/service/texture_manager.cc | 18 | ||||
-rw-r--r-- | gpu/command_buffer/service/texture_manager.h | 10 | ||||
-rw-r--r-- | gpu/command_buffer/service/texture_manager_unittest.cc | 128 |
5 files changed, 180 insertions, 54 deletions
diff --git a/gpu/command_buffer/service/test_helper.cc b/gpu/command_buffer/service/test_helper.cc index c12f872..4b8d8fc 100644 --- a/gpu/command_buffer/service/test_helper.cc +++ b/gpu/command_buffer/service/test_helper.cc @@ -58,6 +58,10 @@ T ConstructShaderVariable( #ifndef COMPILER_MSVC const GLuint TestHelper::kServiceBlackTexture2dId; const GLuint TestHelper::kServiceDefaultTexture2dId; +const GLuint TestHelper::kServiceBlackTexture3dId; +const GLuint TestHelper::kServiceDefaultTexture3dId; +const GLuint TestHelper::kServiceBlackTexture2dArrayId; +const GLuint TestHelper::kServiceDefaultTexture2dArrayId; const GLuint TestHelper::kServiceBlackTextureCubemapId; const GLuint TestHelper::kServiceDefaultTextureCubemapId; const GLuint TestHelper::kServiceBlackExternalTextureId; @@ -93,10 +97,18 @@ void TestHelper::SetupTextureInitializationExpectations( bool needs_initialization = (target != GL_TEXTURE_EXTERNAL_OES); bool needs_faces = (target == GL_TEXTURE_CUBE_MAP); + bool is_3d_or_2d_array_target = (target == GL_TEXTURE_3D || + target == GL_TEXTURE_2D_ARRAY); static GLuint texture_2d_ids[] = { kServiceBlackTexture2dId, kServiceDefaultTexture2dId }; + static GLuint texture_3d_ids[] = { + kServiceBlackTexture3dId, + kServiceDefaultTexture3dId }; + static GLuint texture_2d_array_ids[] = { + kServiceBlackTexture2dArrayId, + kServiceDefaultTexture2dArrayId }; static GLuint texture_cube_map_ids[] = { kServiceBlackTextureCubemapId, kServiceDefaultTextureCubemapId }; @@ -112,6 +124,12 @@ void TestHelper::SetupTextureInitializationExpectations( case GL_TEXTURE_2D: texture_ids = &texture_2d_ids[0]; break; + case GL_TEXTURE_3D: + texture_ids = &texture_3d_ids[0]; + break; + case GL_TEXTURE_2D_ARRAY: + texture_ids = &texture_2d_array_ids[0]; + break; case GL_TEXTURE_CUBE_MAP: texture_ids = &texture_cube_map_ids[0]; break; @@ -152,10 +170,17 @@ void TestHelper::SetupTextureInitializationExpectations( .RetiresOnSaturation(); } } else { - EXPECT_CALL(*gl, TexImage2D(target, 0, GL_RGBA, 1, 1, 0, GL_RGBA, - GL_UNSIGNED_BYTE, _)) - .Times(1) - .RetiresOnSaturation(); + if (is_3d_or_2d_array_target) { + EXPECT_CALL(*gl, TexImage3D(target, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA, + GL_UNSIGNED_BYTE, _)) + .Times(1) + .RetiresOnSaturation(); + } else { + EXPECT_CALL(*gl, TexImage2D(target, 0, GL_RGBA, 1, 1, 0, GL_RGBA, + GL_UNSIGNED_BYTE, _)) + .Times(1) + .RetiresOnSaturation(); + } } } } @@ -166,6 +191,7 @@ void TestHelper::SetupTextureInitializationExpectations( void TestHelper::SetupTextureManagerInitExpectations( ::gfx::MockGLInterface* gl, + bool is_es3_enabled, const char* extensions, bool use_default_textures) { InSequence sequence; @@ -175,6 +201,13 @@ void TestHelper::SetupTextureManagerInitExpectations( SetupTextureInitializationExpectations( gl, GL_TEXTURE_CUBE_MAP, use_default_textures); + if (is_es3_enabled) { + SetupTextureInitializationExpectations( + gl, GL_TEXTURE_3D, use_default_textures); + SetupTextureInitializationExpectations( + gl, GL_TEXTURE_2D_ARRAY, use_default_textures); + } + bool ext_image_external = false; bool arb_texture_rectangle = false; base::CStringTokenizer t(extensions, extensions + strlen(extensions), " "); @@ -211,6 +244,12 @@ void TestHelper::SetupTextureDestructionExpectations( case GL_TEXTURE_2D: texture_id = kServiceDefaultTexture2dId; break; + case GL_TEXTURE_3D: + texture_id = kServiceDefaultTexture3dId; + break; + case GL_TEXTURE_2D_ARRAY: + texture_id = kServiceDefaultTexture2dArrayId; + break; case GL_TEXTURE_CUBE_MAP: texture_id = kServiceDefaultTextureCubemapId; break; @@ -231,12 +270,20 @@ void TestHelper::SetupTextureDestructionExpectations( void TestHelper::SetupTextureManagerDestructionExpectations( ::gfx::MockGLInterface* gl, + bool is_es3_enabled, const char* extensions, bool use_default_textures) { SetupTextureDestructionExpectations(gl, GL_TEXTURE_2D, use_default_textures); SetupTextureDestructionExpectations( gl, GL_TEXTURE_CUBE_MAP, use_default_textures); + if (is_es3_enabled) { + SetupTextureDestructionExpectations( + gl, GL_TEXTURE_3D, use_default_textures); + SetupTextureDestructionExpectations( + gl, GL_TEXTURE_2D_ARRAY,use_default_textures); + } + bool ext_image_external = false; bool arb_texture_rectangle = false; base::CStringTokenizer t(extensions, extensions + strlen(extensions), " "); @@ -260,7 +307,7 @@ void TestHelper::SetupTextureManagerDestructionExpectations( gl, GL_TEXTURE_RECTANGLE_ARB, use_default_textures); } - EXPECT_CALL(*gl, DeleteTextures(4, _)) + EXPECT_CALL(*gl, DeleteTextures(TextureManager::kNumDefaultTextures, _)) .Times(1) .RetiresOnSaturation(); } @@ -343,7 +390,8 @@ void TestHelper::SetupContextGroupInitExpectations( } bool use_default_textures = bind_generates_resource; - SetupTextureManagerInitExpectations(gl, extensions, use_default_textures); + SetupTextureManagerInitExpectations( + gl, false, extensions, use_default_textures); } void TestHelper::SetupFeatureInfoInitExpectations( diff --git a/gpu/command_buffer/service/test_helper.h b/gpu/command_buffer/service/test_helper.h index a7eaec2a..5998915b 100644 --- a/gpu/command_buffer/service/test_helper.h +++ b/gpu/command_buffer/service/test_helper.h @@ -27,12 +27,16 @@ class TestHelper { public: static const GLuint kServiceBlackTexture2dId = 701; static const GLuint kServiceDefaultTexture2dId = 702; - static const GLuint kServiceBlackTextureCubemapId = 703; - static const GLuint kServiceDefaultTextureCubemapId = 704; - static const GLuint kServiceBlackExternalTextureId = 705; - static const GLuint kServiceDefaultExternalTextureId = 706; - static const GLuint kServiceBlackRectangleTextureId = 707; - static const GLuint kServiceDefaultRectangleTextureId = 708; + static const GLuint kServiceBlackTexture3dId = 703; + static const GLuint kServiceDefaultTexture3dId = 704; + static const GLuint kServiceBlackTexture2dArrayId = 705; + static const GLuint kServiceDefaultTexture2dArrayId = 706; + static const GLuint kServiceBlackTextureCubemapId = 707; + static const GLuint kServiceDefaultTextureCubemapId = 708; + static const GLuint kServiceBlackExternalTextureId = 709; + static const GLuint kServiceDefaultExternalTextureId = 710; + static const GLuint kServiceBlackRectangleTextureId = 711; + static const GLuint kServiceDefaultRectangleTextureId = 712; static const GLint kMaxSamples = 4; static const GLint kMaxRenderbufferSize = 1024; @@ -83,10 +87,12 @@ class TestHelper { const char* gl_renderer, const char* gl_version); static void SetupTextureManagerInitExpectations(::gfx::MockGLInterface* gl, + bool is_es3_enabled, const char* extensions, bool use_default_textures); static void SetupTextureManagerDestructionExpectations( ::gfx::MockGLInterface* gl, + bool is_es3_enabled, const char* extensions, bool use_default_textures); diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc index 45351d5..9955954 100644 --- a/gpu/command_buffer/service/texture_manager.cc +++ b/gpu/command_buffer/service/texture_manager.cc @@ -1411,6 +1411,13 @@ bool TextureManager::Initialize() { default_textures_[kCubeMap] = CreateDefaultAndBlackTextures( GL_TEXTURE_CUBE_MAP, &black_texture_ids_[kCubeMap]); + if (feature_info_->IsES3Enabled()) { + default_textures_[kTexture3D] = CreateDefaultAndBlackTextures( + GL_TEXTURE_3D, &black_texture_ids_[kTexture3D]); + default_textures_[kTexture2DArray] = CreateDefaultAndBlackTextures( + GL_TEXTURE_2D_ARRAY, &black_texture_ids_[kTexture2DArray]); + } + if (feature_info_->feature_flags().oes_egl_image_external) { default_textures_[kExternalOES] = CreateDefaultAndBlackTextures( GL_TEXTURE_EXTERNAL_OES, &black_texture_ids_[kExternalOES]); @@ -1441,6 +1448,8 @@ scoped_refptr<TextureRef> // black values according to the spec. bool needs_initialization = (target != GL_TEXTURE_EXTERNAL_OES); bool needs_faces = (target == GL_TEXTURE_CUBE_MAP); + bool is_3d_or_2d_array_target = (target == GL_TEXTURE_3D || + target == GL_TEXTURE_2D_ARRAY); // Make default textures and texture for replacing non-renderable textures. GLuint ids[2]; @@ -1455,8 +1464,13 @@ scoped_refptr<TextureRef> GL_RGBA, GL_UNSIGNED_BYTE, black); } } else { - glTexImage2D(target, 0, GL_RGBA, 1, 1, 0, GL_RGBA, - GL_UNSIGNED_BYTE, black); + if (is_3d_or_2d_array_target) { + glTexImage3D(target, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA, + GL_UNSIGNED_BYTE, black); + } else { + glTexImage2D(target, 0, GL_RGBA, 1, 1, 0, GL_RGBA, + GL_UNSIGNED_BYTE, black); + } } } } diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h index c491035..56d96ba 100644 --- a/gpu/command_buffer/service/texture_manager.h +++ b/gpu/command_buffer/service/texture_manager.h @@ -583,6 +583,8 @@ class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider { enum DefaultAndBlackTextures { kTexture2D, + kTexture3D, + kTexture2DArray, kCubeMap, kExternalOES, kRectangleARB, @@ -737,6 +739,10 @@ class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider { switch (target) { case GL_TEXTURE_2D: return default_textures_[kTexture2D].get(); + case GL_TEXTURE_3D: + return default_textures_[kTexture3D].get(); + case GL_TEXTURE_2D_ARRAY: + return default_textures_[kTexture2DArray].get(); case GL_TEXTURE_CUBE_MAP: return default_textures_[kCubeMap].get(); case GL_TEXTURE_EXTERNAL_OES: @@ -769,6 +775,10 @@ class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider { switch (target) { case GL_SAMPLER_2D: return black_texture_ids_[kTexture2D]; + case GL_SAMPLER_3D: + return black_texture_ids_[kTexture3D]; + case GL_SAMPLER_2D_ARRAY: + return black_texture_ids_[kTexture2DArray]; case GL_SAMPLER_CUBE: return black_texture_ids_[kCubeMap]; case GL_SAMPLER_EXTERNAL_OES: diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc index 430aa55..f9642b8 100644 --- a/gpu/command_buffer/service/texture_manager_unittest.cc +++ b/gpu/command_buffer/service/texture_manager_unittest.cc @@ -78,7 +78,7 @@ class TextureManagerTest : public GpuServiceTest { kMax3DTextureSize, kUseDefaultTextures)); TestHelper::SetupTextureManagerInitExpectations( - gl_.get(), "", kUseDefaultTextures); + gl_.get(), false, "", kUseDefaultTextures); manager_->Initialize(); error_state_.reset(new ::testing::StrictMock<gles2::MockErrorState>()); } @@ -96,6 +96,23 @@ class TextureManagerTest : public GpuServiceTest { texture_ref, pname, value, error); } + void SetupFeatureInfo(const char* gl_extensions, + const char* gl_version, + bool enable_es3) { + TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( + gl_.get(), gl_extensions, "", gl_version); + feature_info_->Initialize(); + if (enable_es3) { + EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _)) + .WillOnce(SetArgPointee<1>(8)) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_DRAW_BUFFERS, _)) + .WillOnce(SetArgPointee<1>(8)) + .RetiresOnSaturation(); + feature_info_->EnableES3Validators(); + } + } + scoped_refptr<FeatureInfo> feature_info_; scoped_ptr<TextureManager> manager_; scoped_ptr<MockErrorState> error_state_; @@ -177,10 +194,8 @@ TEST_F(TextureManagerTest, SetParameter) { TEST_F(TextureManagerTest, UseDefaultTexturesTrue) { bool use_default_textures = true; - scoped_refptr<FeatureInfo> feature_info(new FeatureInfo()); - - TestHelper::SetupTextureManagerInitExpectations( - gl_.get(), "GL_ANGLE_texture_usage", use_default_textures); + TestHelper::SetupTextureManagerInitExpectations(gl_.get(), + false, "GL_ANGLE_texture_usage", use_default_textures); TextureManager manager(NULL, feature_info_.get(), kMaxTextureSize, @@ -200,8 +215,8 @@ TEST_F(TextureManagerTest, UseDefaultTexturesTrue) { TEST_F(TextureManagerTest, UseDefaultTexturesFalse) { bool use_default_textures = false; - TestHelper::SetupTextureManagerInitExpectations( - gl_.get(), "GL_ANGLE_texture_usage", use_default_textures); + TestHelper::SetupTextureManagerInitExpectations(gl_.get(), + false, "GL_ANGLE_texture_usage", use_default_textures); TextureManager manager(NULL, feature_info_.get(), kMaxTextureSize, @@ -219,9 +234,49 @@ TEST_F(TextureManagerTest, UseDefaultTexturesFalse) { manager.Destroy(false); } +TEST_F(TextureManagerTest, UseDefaultTexturesTrueES3) { + bool use_default_textures = true; + SetupFeatureInfo("", "OpenGL ES 3.0", true); + TestHelper::SetupTextureManagerInitExpectations(gl_.get(), + true, "", use_default_textures); + TextureManager manager(NULL, + feature_info_.get(), + kMaxTextureSize, + kMaxCubeMapTextureSize, + kMaxRectangleTextureSize, + kMax3DTextureSize, + use_default_textures); + manager.Initialize(); + + EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_3D) != NULL); + EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_2D_ARRAY) != NULL); + + manager.Destroy(false); +} + +TEST_F(TextureManagerTest, UseDefaultTexturesFalseES3) { + bool use_default_textures = false; + SetupFeatureInfo("", "OpenGL ES 3.0", true); + TestHelper::SetupTextureManagerInitExpectations(gl_.get(), + true, "", use_default_textures); + TextureManager manager(NULL, + feature_info_.get(), + kMaxTextureSize, + kMaxCubeMapTextureSize, + kMaxRectangleTextureSize, + kMax3DTextureSize, + use_default_textures); + manager.Initialize(); + + EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_3D) == NULL); + EXPECT_TRUE(manager.GetDefaultTextureInfo(GL_TEXTURE_2D_ARRAY) == NULL); + + manager.Destroy(false); +} + TEST_F(TextureManagerTest, TextureUsageExt) { TestHelper::SetupTextureManagerInitExpectations( - gl_.get(), "GL_ANGLE_texture_usage", kUseDefaultTextures); + gl_.get(), false, "GL_ANGLE_texture_usage", kUseDefaultTextures); TextureManager manager(NULL, feature_info_.get(), kMaxTextureSize, @@ -249,7 +304,7 @@ TEST_F(TextureManagerTest, Destroy) { const GLuint kClient1Id = 1; const GLuint kService1Id = 11; TestHelper::SetupTextureManagerInitExpectations( - gl_.get(), "", kUseDefaultTextures); + gl_.get(), false, "", kUseDefaultTextures); TextureManager manager(NULL, feature_info_.get(), kMaxTextureSize, @@ -267,7 +322,7 @@ TEST_F(TextureManagerTest, Destroy) { .Times(1) .RetiresOnSaturation(); TestHelper::SetupTextureManagerDestructionExpectations( - gl_.get(), "", kUseDefaultTextures); + gl_.get(), false, "", kUseDefaultTextures); manager.Destroy(true); // Check that resources got freed. texture = manager.GetTexture(kClient1Id); @@ -1807,10 +1862,10 @@ class SharedTextureTest : public GpuServiceTest { TextureManagerTest::kMax3DTextureSize, kUseDefaultTextures)); TestHelper::SetupTextureManagerInitExpectations( - gl_.get(), "", kUseDefaultTextures); + gl_.get(), false, "", kUseDefaultTextures); texture_manager1_->Initialize(); TestHelper::SetupTextureManagerInitExpectations( - gl_.get(), "", kUseDefaultTextures); + gl_.get(), false, "", kUseDefaultTextures); texture_manager2_->Initialize(); } @@ -2055,12 +2110,6 @@ class TextureFormatTypeValidationTest : public TextureManagerTest { ~TextureFormatTypeValidationTest() override {} protected: - void SetupFeatureInfo(const char* gl_extensions, const char* gl_version) { - TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( - gl_.get(), gl_extensions, "", gl_version); - feature_info_->Initialize(); - } - void ExpectValid(GLenum format, GLenum type, GLenum internal_format) { EXPECT_TRUE(manager_->ValidateTextureParameters( error_state_.get(), "", format, type, internal_format, 0)); @@ -2086,7 +2135,7 @@ class TextureFormatTypeValidationTest : public TextureManagerTest { }; TEST_F(TextureFormatTypeValidationTest, ES2Basic) { - SetupFeatureInfo("", "OpenGL ES 2.0"); + SetupFeatureInfo("", "OpenGL ES 2.0", false); ExpectValid(GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA); ExpectValid(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB); @@ -2116,19 +2165,19 @@ TEST_F(TextureFormatTypeValidationTest, ES2Basic) { } TEST_F(TextureFormatTypeValidationTest, ES2WithExtTextureFormatBGRA8888) { - SetupFeatureInfo("GL_EXT_texture_format_BGRA8888", "OpenGL ES 2.0"); + SetupFeatureInfo("GL_EXT_texture_format_BGRA8888", "OpenGL ES 2.0", false); ExpectValid(GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_BGRA_EXT); } TEST_F(TextureFormatTypeValidationTest, ES2WithAppleTextureFormatBGRA8888) { - SetupFeatureInfo("GL_APPLE_texture_format_BGRA8888", "OpenGL ES 2.0"); + SetupFeatureInfo("GL_APPLE_texture_format_BGRA8888", "OpenGL ES 2.0", false); ExpectValid(GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_BGRA_EXT); } TEST_F(TextureFormatTypeValidationTest, ES2WithArbDepth) { - SetupFeatureInfo("GL_ARB_depth_texture", "OpenGL ES 2.0"); + SetupFeatureInfo("GL_ARB_depth_texture", "OpenGL ES 2.0", false); ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT); ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT); @@ -2136,7 +2185,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithArbDepth) { } TEST_F(TextureFormatTypeValidationTest, ES2WithOesDepth) { - SetupFeatureInfo("GL_OES_depth_texture", "OpenGL ES 2.0"); + SetupFeatureInfo("GL_OES_depth_texture", "OpenGL ES 2.0", false); ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT); ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT); @@ -2144,7 +2193,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesDepth) { } TEST_F(TextureFormatTypeValidationTest, ES2WithAngleDepth) { - SetupFeatureInfo("GL_ANGLE_depth_texture", "OpenGL ES 2.0"); + SetupFeatureInfo("GL_ANGLE_depth_texture", "OpenGL ES 2.0", false); ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT); ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT); @@ -2153,7 +2202,9 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithAngleDepth) { TEST_F(TextureFormatTypeValidationTest, ES2WithExtPackedDepthStencil) { SetupFeatureInfo( - "GL_EXT_packed_depth_stencil GL_ARB_depth_texture", "OpenGL ES 2.0"); + "GL_EXT_packed_depth_stencil GL_ARB_depth_texture", + "OpenGL ES 2.0", + false); ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT); ExpectValid(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT); @@ -2163,7 +2214,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithExtPackedDepthStencil) { TEST_F(TextureFormatTypeValidationTest, ES2WithRGWithFloat) { SetupFeatureInfo( "GL_EXT_texture_rg GL_OES_texture_float GL_OES_texture_half_float", - "OpenGL ES 2.0"); + "OpenGL ES 2.0", + false); ExpectValid(GL_RED_EXT, GL_HALF_FLOAT_OES, GL_RED_EXT); ExpectValid(GL_RG_EXT, GL_HALF_FLOAT_OES, GL_RG_EXT); @@ -2177,7 +2229,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithRGWithFloat) { } TEST_F(TextureFormatTypeValidationTest, ES2WithRGNoFloat) { - SetupFeatureInfo("GL_ARB_texture_rg", "OpenGL ES 2.0"); + SetupFeatureInfo("GL_ARB_texture_rg", "OpenGL ES 2.0", false); ExpectValid(GL_RED_EXT, GL_UNSIGNED_BYTE, GL_RED_EXT); ExpectValid(GL_RG_EXT, GL_UNSIGNED_BYTE, GL_RG_EXT); @@ -2187,7 +2239,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithRGNoFloat) { } TEST_F(TextureFormatTypeValidationTest, ES2OnTopOfES3) { - SetupFeatureInfo("", "OpenGL ES 3.0"); + SetupFeatureInfo("", "OpenGL ES 3.0", false); ExpectInvalidEnum(GL_RGB, GL_FLOAT, GL_RGB); ExpectInvalidEnum(GL_RGBA, GL_FLOAT, GL_RGBA); @@ -2200,7 +2252,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2OnTopOfES3) { } TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloat) { - SetupFeatureInfo("GL_OES_texture_float", "OpenGL ES 2.0"); + SetupFeatureInfo("GL_OES_texture_float", "OpenGL ES 2.0", false); ExpectValid(GL_RGB, GL_FLOAT, GL_RGB); ExpectValid(GL_RGBA, GL_FLOAT, GL_RGBA); @@ -2217,7 +2269,9 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloat) { TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloatLinear) { SetupFeatureInfo( - "GL_OES_texture_float GL_OES_texture_float_linear", "OpenGL ES 2.0"); + "GL_OES_texture_float GL_OES_texture_float_linear", + "OpenGL ES 2.0", + false); ExpectValid(GL_RGB, GL_FLOAT, GL_RGB); ExpectValid(GL_RGBA, GL_FLOAT, GL_RGBA); @@ -2233,7 +2287,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloatLinear) { } TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloat) { - SetupFeatureInfo("GL_OES_texture_half_float", "OpenGL ES 2.0"); + SetupFeatureInfo("GL_OES_texture_half_float", "OpenGL ES 2.0", false); ExpectValid(GL_RGB, GL_HALF_FLOAT_OES, GL_RGB); ExpectValid(GL_RGBA, GL_HALF_FLOAT_OES, GL_RGBA); @@ -2251,7 +2305,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloat) { TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloatLinear) { SetupFeatureInfo( "GL_OES_texture_half_float GL_OES_texture_half_float_linear", - "OpenGL ES 2.0"); + "OpenGL ES 2.0", + false); ExpectValid(GL_RGB, GL_HALF_FLOAT_OES, GL_RGB); ExpectValid(GL_RGBA, GL_HALF_FLOAT_OES, GL_RGBA); @@ -2267,14 +2322,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloatLinear) { } TEST_F(TextureFormatTypeValidationTest, ES3Basic) { - SetupFeatureInfo("", "OpenGL ES 3.0"); - EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _)) - .WillOnce(SetArgPointee<1>(8)) - .RetiresOnSaturation(); - EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_DRAW_BUFFERS, _)) - .WillOnce(SetArgPointee<1>(8)) - .RetiresOnSaturation(); - feature_info_->EnableES3Validators(); + SetupFeatureInfo("", "OpenGL ES 3.0", true); ExpectValid(GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA); ExpectValid(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB); |