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

Side by Side Diff: gpu/command_buffer/service/feature_info_unittest.cc

Issue 2363773007: Command buffer should not report depth_texture on pure ES3 without depth_texture extension. (Closed)
Patch Set: fix unittests Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/feature_info.h" 5 #include "gpu/command_buffer/service/feature_info.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 1428
1429 TEST_P(FeatureInfoTest, InitializeWithES3) { 1429 TEST_P(FeatureInfoTest, InitializeWithES3) {
1430 SetupInitExpectationsWithGLVersion("", "", "OpenGL ES 3.0"); 1430 SetupInitExpectationsWithGLVersion("", "", "OpenGL ES 3.0");
1431 EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample); 1431 EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample);
1432 EXPECT_TRUE(info_->feature_flags().use_core_framebuffer_multisample); 1432 EXPECT_TRUE(info_->feature_flags().use_core_framebuffer_multisample);
1433 EXPECT_THAT(info_->extensions(), 1433 EXPECT_THAT(info_->extensions(),
1434 HasSubstr("GL_CHROMIUM_framebuffer_multisample")); 1434 HasSubstr("GL_CHROMIUM_framebuffer_multisample"));
1435 EXPECT_TRUE(info_->feature_flags().use_async_readpixels); 1435 EXPECT_TRUE(info_->feature_flags().use_async_readpixels);
1436 EXPECT_TRUE(info_->feature_flags().oes_standard_derivatives); 1436 EXPECT_TRUE(info_->feature_flags().oes_standard_derivatives);
1437 EXPECT_TRUE(info_->feature_flags().oes_depth24); 1437 EXPECT_TRUE(info_->feature_flags().oes_depth24);
1438 EXPECT_THAT(info_->extensions(), HasSubstr("GL_GOOGLE_depth_texture")); 1438 EXPECT_THAT(info_->extensions(), Not(HasSubstr("GL_GOOGLE_depth_texture")));
1439 EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_depth_texture")); 1439 EXPECT_THAT(info_->extensions(), Not(HasSubstr("GL_CHROMIUM_depth_texture")));
1440 EXPECT_TRUE( 1440 EXPECT_FALSE(
1441 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_COMPONENT)); 1441 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_COMPONENT));
1442 EXPECT_TRUE( 1442 EXPECT_FALSE(
1443 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL)); 1443 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));
1444 EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT)); 1444 EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));
1445 EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL)); 1445 EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));
1446 EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT)); 1446 EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));
1447 EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT)); 1447 EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));
1448 EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT_24_8)); 1448 EXPECT_FALSE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT_24_8));
1449 EXPECT_TRUE(info_->feature_flags().packed_depth24_stencil8); 1449 EXPECT_TRUE(info_->feature_flags().packed_depth24_stencil8);
1450 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_depth24")); 1450 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_depth24"));
1451 EXPECT_TRUE( 1451 EXPECT_TRUE(
1452 info_->validators()->render_buffer_format.IsValid(GL_DEPTH_COMPONENT24)); 1452 info_->validators()->render_buffer_format.IsValid(GL_DEPTH_COMPONENT24));
1453 EXPECT_TRUE( 1453 EXPECT_TRUE(
1454 info_->validators()->render_buffer_format.IsValid(GL_DEPTH24_STENCIL8)); 1454 info_->validators()->render_buffer_format.IsValid(GL_DEPTH24_STENCIL8));
1455 EXPECT_TRUE( 1455 EXPECT_FALSE(
1456 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL)); 1456 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));
1457 EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL)); 1457 EXPECT_FALSE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));
1458 EXPECT_TRUE(info_->feature_flags().npot_ok); 1458 EXPECT_TRUE(info_->feature_flags().npot_ok);
1459 EXPECT_TRUE(info_->feature_flags().native_vertex_array_object); 1459 EXPECT_TRUE(info_->feature_flags().native_vertex_array_object);
1460 EXPECT_TRUE(info_->feature_flags().enable_samplers); 1460 EXPECT_TRUE(info_->feature_flags().enable_samplers);
1461 EXPECT_TRUE(info_->feature_flags().map_buffer_range); 1461 EXPECT_TRUE(info_->feature_flags().map_buffer_range);
1462 EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer); 1462 EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer);
1463 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_discard_framebuffer")); 1463 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_discard_framebuffer"));
1464 EXPECT_TRUE(info_->feature_flags().chromium_sync_query); 1464 EXPECT_TRUE(info_->feature_flags().chromium_sync_query);
1465 EXPECT_TRUE(gl::GLFence::IsSupported()); 1465 EXPECT_TRUE(gl::GLFence::IsSupported());
1466 } 1466 }
1467 1467
1468 TEST_P(FeatureInfoTest, InitializeWithES3AndDepthTexture) {
1469 SetupInitExpectationsWithGLVersion(
1470 "GL_ANGLE_depth_texture", "", "OpenGL ES 3.0");
1471 EXPECT_THAT(info_->extensions(), HasSubstr("GL_GOOGLE_depth_texture"));
1472 EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_depth_texture"));
1473 EXPECT_TRUE(
1474 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_COMPONENT));
1475 EXPECT_TRUE(
1476 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));
1477 EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT));
1478 EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));
1479 EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT));
1480 EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT));
1481 EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT_24_8));
1482 EXPECT_TRUE(info_->feature_flags().packed_depth24_stencil8);
1483 EXPECT_TRUE(
1484 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL));
1485 EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL));
1486 }
1487
1468 TEST_P(FeatureInfoTest, InitializeWithoutSamplers) { 1488 TEST_P(FeatureInfoTest, InitializeWithoutSamplers) {
1469 SetupInitExpectationsWithGLVersion("", "", "3.0"); 1489 SetupInitExpectationsWithGLVersion("", "", "3.0");
1470 EXPECT_FALSE(info_->feature_flags().enable_samplers); 1490 EXPECT_FALSE(info_->feature_flags().enable_samplers);
1471 } 1491 }
1472 1492
1473 TEST_P(FeatureInfoTest, ParseDriverBugWorkaroundsSingle) { 1493 TEST_P(FeatureInfoTest, ParseDriverBugWorkaroundsSingle) {
1474 base::CommandLine command_line(0, NULL); 1494 base::CommandLine command_line(0, NULL);
1475 command_line.AppendSwitchASCII( 1495 command_line.AppendSwitchASCII(
1476 switches::kGpuDriverBugWorkarounds, 1496 switches::kGpuDriverBugWorkarounds,
1477 base::IntToString(gpu::EXIT_ON_CONTEXT_LOST)); 1497 base::IntToString(gpu::EXIT_ON_CONTEXT_LOST));
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT)); 1659 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT));
1640 } 1660 }
1641 1661
1642 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) { 1662 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) {
1643 SetupInitExpectations("GL_APPLE_ycbcr_422"); 1663 SetupInitExpectations("GL_APPLE_ycbcr_422");
1644 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422); 1664 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422);
1645 } 1665 }
1646 1666
1647 } // namespace gles2 1667 } // namespace gles2
1648 } // namespace gpu 1668 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698