diff options
author | kalyan.kondapally <kalyan.kondapally@intel.com> | 2014-11-08 10:10:45 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-08 18:11:05 +0000 |
commit | e7737e18932fe3ec2c74d6282b1cd6a329d0a79e (patch) | |
tree | 800e70eaf3c2ea7f76f2d2c4caa8c3e95f3890f0 | |
parent | 4851f5ec490edc23a3ac46508c00d8e01ba7fbe8 (diff) | |
download | chromium_src-e7737e18932fe3ec2c74d6282b1cd6a329d0a79e.zip chromium_src-e7737e18932fe3ec2c74d6282b1cd6a329d0a79e.tar.gz chromium_src-e7737e18932fe3ec2c74d6282b1cd6a329d0a79e.tar.bz2 |
Check if drivers support GL_OES_texture_float even with GLES3 context.
GLES3 adds support for Float type but doesn't specify support for
all formats with FLOAT as GL_OES_texture_float
(i.e. LUMINANCE_ALPHA,LUMINANCE and Alpha). Hence, we need to
explicitly check for support of this extension even with GLES3.
Review URL: https://codereview.chromium.org/696603002
Cr-Commit-Position: refs/heads/master@{#303391}
-rw-r--r-- | gpu/command_buffer/service/feature_info.cc | 8 | ||||
-rw-r--r-- | gpu/command_buffer/service/feature_info_unittest.cc | 20 |
2 files changed, 27 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index 9be747d..24e1f92 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -477,16 +477,22 @@ void FeatureInfo::InitializeFeatures() { enable_texture_half_float_linear = true; may_enable_chromium_color_buffer_float = true; } else { - if (is_es3 || extensions.Contains("GL_OES_texture_float")) { + // GLES3 adds support for Float type by default but it doesn't support all + // formats as GL_OES_texture_float(i.e.LUMINANCE_ALPHA,LUMINANCE and Alpha) + if (extensions.Contains("GL_OES_texture_float")) { enable_texture_float = true; if (extensions.Contains("GL_OES_texture_float_linear")) { enable_texture_float_linear = true; } + // This extension allows a variety of floating point formats to be + // rendered to via framebuffer objects. Enable it's usage only if + // support for Floating textures is enabled. if ((is_es3 && extensions.Contains("GL_EXT_color_buffer_float")) || feature_flags_.is_angle) { may_enable_chromium_color_buffer_float = true; } } + // TODO(dshwang): GLES3 supports half float by default but GL_HALF_FLOAT_OES // isn't equal to GL_HALF_FLOAT. if (extensions.Contains("GL_OES_texture_half_float")) { diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc index 69bd4d3..88a0a37 100644 --- a/gpu/command_buffer/service/feature_info_unittest.cc +++ b/gpu/command_buffer/service/feature_info_unittest.cc @@ -669,6 +669,26 @@ TEST_F(FeatureInfoTest, InitializeARB_texture_float) { GL_RGB32F)); } +TEST_F(FeatureInfoTest, Initialize_texture_floatGLES3) { + SetupInitExpectationsWithGLVersion("", "", "OpenGL ES 3.0"); + EXPECT_THAT(info_->extensions(), Not(HasSubstr("GL_OES_texture_float"))); + EXPECT_THAT(info_->extensions(), Not(HasSubstr("GL_OES_texture_half_float"))); + EXPECT_THAT(info_->extensions(), + Not(HasSubstr("GL_OES_texture_float_linear"))); + EXPECT_THAT(info_->extensions(), + Not(HasSubstr("GL_OES_texture_half_float_linear"))); + EXPECT_FALSE(info_->GetTextureFormatValidator(GL_RGB).IsValid( + GL_FLOAT)); + EXPECT_FALSE(info_->GetTextureFormatValidator(GL_RGBA).IsValid( + GL_FLOAT)); + EXPECT_FALSE(info_->GetTextureFormatValidator(GL_LUMINANCE).IsValid( + GL_FLOAT)); + EXPECT_FALSE(info_->GetTextureFormatValidator(GL_LUMINANCE_ALPHA).IsValid( + GL_FLOAT)); + EXPECT_FALSE(info_->GetTextureFormatValidator(GL_ALPHA).IsValid( + GL_FLOAT)); +} + TEST_F(FeatureInfoTest, InitializeOES_texture_floatGLES2) { SetupInitExpectations("GL_OES_texture_float"); EXPECT_FALSE(info_->feature_flags().enable_texture_float_linear); |