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

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: Prevent GLES unless GL_APPLE_texture_format_BGRA8888 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
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | ui/gl/generate_bindings.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1010f993d1a776b8f71e8f54f872d58b3f7ddc12..fa2d82c16dde31fc62504428ef1adf8f3497e997 100644
--- a/gpu/command_buffer/service/feature_info_unittest.cc
+++ b/gpu/command_buffer/service/feature_info_unittest.cc
@@ -405,7 +405,7 @@ TEST_F(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888GL) {
GL_BGRA8_EXT));
}
-TEST_F(FeatureInfoTest, InitializeEXT_texture_format_BGRA8888Apple) {
+TEST_F(FeatureInfoTest, InitializeAPPLE_texture_format_BGRA8888) {
SetupInitExpectations("GL_APPLE_texture_format_BGRA8888");
EXPECT_THAT(info_->extensions(),
HasSubstr("GL_EXT_texture_format_BGRA8888"));
@@ -429,7 +429,117 @@ 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_FALSE(info_->feature_flags().ext_texture_storage);
+ EXPECT_THAT(info_->extensions(), Not(HasSubstr("GL_EXT_texture_storage")));
piman 2014/08/26 20:54:30 That seems wrong. If we have GL_EXT_texture_storag
+ EXPECT_FALSE(info_->validators()->texture_parameter.IsValid(
+ GL_TEXTURE_IMMUTABLE_FORMAT_EXT));
+}
+
+TEST_F(FeatureInfoTest, InitializeEXT_texture_storage_BRGA) {
+ SetupInitExpectations("GL_EXT_texture_storage GL_EXT_bgra");
+ 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));
+ 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_BGRA) {
+ SetupInitExpectations("GL_ARB_texture_storage GL_EXT_bgra");
+ 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));
+}
+
+TEST_F(FeatureInfoTest, InitializeEXT_texture_storage_BGRA8888) {
+ 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 GL_EXT_bgra");
+ 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 GL_EXT_bgra");
+ 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_BGRA8888_GLES3) {
+ 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, InitializeAPPLE_texture_format_BGRA8888_GLES3) {
+ 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));
}
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | ui/gl/generate_bindings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698