summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r--gpu/command_buffer/service/context_group.cc7
-rw-r--r--gpu/command_buffer/service/context_group_unittest.cc9
2 files changed, 15 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/context_group.cc b/gpu/command_buffer/service/context_group.cc
index 8c85917..b4737ed 100644
--- a/gpu/command_buffer/service/context_group.cc
+++ b/gpu/command_buffer/service/context_group.cc
@@ -206,8 +206,13 @@ bool ContextGroup::Initialize() {
AddExtensionString("GL_EXT_framebuffer_blit");
}
+ if (strstr(extensions, "GL_OES_depth24") ||
+ gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL) {
+ AddExtensionString("GL_OES_depth24");
+ validators_.render_buffer_format.AddValue(GL_DEPTH_COMPONENT24);
+ }
+
// TODO(gman): Add support for these extensions.
- // GL_OES_depth24
// GL_OES_depth32
// GL_OES_element_index_uint
diff --git a/gpu/command_buffer/service/context_group_unittest.cc b/gpu/command_buffer/service/context_group_unittest.cc
index 066da29..49efb3a 100644
--- a/gpu/command_buffer/service/context_group_unittest.cc
+++ b/gpu/command_buffer/service/context_group_unittest.cc
@@ -113,6 +113,8 @@ TEST_F(ContextGroupTest, InitializeNoExtensions) {
GL_DEPTH_STENCIL));
EXPECT_FALSE(group_.validators()->pixel_type.IsValid(
GL_UNSIGNED_INT_24_8));
+ EXPECT_FALSE(group_.validators()->render_buffer_format.IsValid(
+ GL_DEPTH_COMPONENT24));
}
TEST_F(ContextGroupTest, InitializeNPOTExtensionGLES) {
@@ -366,6 +368,13 @@ TEST_F(ContextGroupTest,
GL_UNSIGNED_INT_24_8));
}
+TEST_F(ContextGroupTest, InitializeOES_depth24) {
+ SetupInitExpectations("GL_OES_depth24");
+ group_.Initialize();
+ EXPECT_THAT(group_.extensions(), HasSubstr("GL_OES_depth24"));
+ EXPECT_TRUE(group_.validators()->render_buffer_format.IsValid(
+ GL_DEPTH_COMPONENT24));
+}
} // namespace gles2
} // namespace gpu