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

Unified Diff: gpu/command_buffer/service/feature_info_unittest.cc

Issue 499283002: gpu: support immutable texture on Linux Mesa driver and GLES3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove is_es3 and APPLE_texture_format_BGRA8888 allows BGRA8_EXT in ES3 Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/feature_info_unittest.cc
diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc
index 3b32f7a5bae6f7061a34080b5b78604ebcb57564..64eebd9aa2ad2968d02656f5b122e7cbbe82adef 100644
--- a/gpu/command_buffer/service/feature_info_unittest.cc
+++ b/gpu/command_buffer/service/feature_info_unittest.cc
@@ -429,7 +429,105 @@ TEST_F(FeatureInfoTest, InitializeEXT_read_format_bgra) {
GL_BGRA_EXT));
EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(
GL_BGRA_EXT));
- EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(
+ EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid(GL_BGRA8_EXT));
+}
+
+TEST_F(FeatureInfoTest, InitializeEXT_texture_storage) {
+ SetupInitExpectations("GL_EXT_texture_storage");
+ EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage"));
+ EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(
+ GL_TEXTURE_IMMUTABLE_FORMAT_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_BGRA8_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGBA32F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGB32F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_ALPHA32F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE32F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE_ALPHA32F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGBA16F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGB16F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_ALPHA16F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE16F_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE_ALPHA16F_EXT));
+}
+
+TEST_F(FeatureInfoTest, InitializeARB_texture_storage) {
+ SetupInitExpectations("GL_ARB_texture_storage");
+ EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage"));
+ EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(
+ GL_TEXTURE_IMMUTABLE_FORMAT_EXT));
+}
+
+TEST_F(FeatureInfoTest, InitializeEXT_texture_storage_BGRA) {
+ SetupInitExpectations(
+ "GL_EXT_texture_storage GL_EXT_texture_format_BGRA8888");
+ EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage"));
+ EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_format_BGRA8888"));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_BGRA8_EXT));
+}
+
+TEST_F(FeatureInfoTest, InitializeEXT_texture_storage_float) {
+ SetupInitExpectations("GL_EXT_texture_storage GL_OES_texture_float");
+ EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage"));
+ EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_texture_float"));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGBA32F_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGB32F_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_ALPHA32F_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE32F_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE_ALPHA32F_EXT));
+}
+
+TEST_F(FeatureInfoTest, InitializeEXT_texture_storage_half_float) {
+ SetupInitExpectations("GL_EXT_texture_storage GL_OES_texture_half_float");
+ EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage"));
+ EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_texture_half_float"));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGBA16F_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_RGB16F_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_ALPHA16F_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE16F_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_LUMINANCE_ALPHA16F_EXT));
+}
+
+TEST_F(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888GLES3) {
+ SetupInitExpectationsWithGLVersion(
+ "GL_EXT_texture_format_BGRA8888", "", "OpenGL ES 3.0");
+ EXPECT_FALSE(info_->feature_flags().ext_texture_storage);
+ EXPECT_THAT(info_->extensions(), Not(HasSubstr("GL_EXT_texture_storage")));
+ EXPECT_FALSE(info_->validators()->texture_parameter.IsValid(
+ GL_TEXTURE_IMMUTABLE_FORMAT_EXT));
+ EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid(
+ GL_BGRA8_EXT));
+}
+
+TEST_F(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888AppleGLES3) {
+ SetupInitExpectationsWithGLVersion(
+ "GL_APPLE_texture_format_BGRA8888", "", "OpenGL ES 3.0");
+ EXPECT_TRUE(info_->feature_flags().ext_texture_storage);
+ EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage"));
+ EXPECT_TRUE(info_->validators()->texture_parameter.IsValid(
+ GL_TEXTURE_IMMUTABLE_FORMAT_EXT));
+ EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid(
GL_BGRA8_EXT));
}

Powered by Google App Engine
This is Rietveld 408576698