1 //
2 // Copyright 2015 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // DebugMarkerTest:
7 // Basic tests to ensure EXT_debug_marker entry points work.
8
9 #include "test_utils/ANGLETest.h"
10
11 using namespace angle;
12
13 namespace
14 {
15
16 class DebugMarkerTest : public ANGLETest
17 {
18 protected:
DebugMarkerTest()19 DebugMarkerTest()
20 {
21 setWindowWidth(128);
22 setWindowHeight(128);
23 setConfigRedBits(8);
24 setConfigGreenBits(8);
25 setConfigBlueBits(8);
26 setConfigAlphaBits(8);
27 }
28 };
29
30 // Simple test to ensure the various EXT_debug_marker entry points don't crash.
31 // The debug markers can be validated by capturing this test under PIX/Graphics Diagnostics.
TEST_P(DebugMarkerTest,BasicValidation)32 TEST_P(DebugMarkerTest, BasicValidation)
33 {
34 if (!extensionEnabled("GL_EXT_debug_marker"))
35 {
36 std::cout << "Test skipped due to missing GL_EXT_debug_marker" << std::endl;
37 return;
38 }
39
40 std::string eventMarkerCaption = "Test event marker caption";
41 std::string groupMarkerCaption = "Test group marker caption";
42
43 glPushGroupMarkerEXT(static_cast<GLsizei>(groupMarkerCaption.length()),
44 groupMarkerCaption.c_str());
45
46 // Do some basic operations between calls to extension entry points
47 glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
48 glClear(GL_COLOR_BUFFER_BIT);
49
50 glInsertEventMarkerEXT(static_cast<GLsizei>(eventMarkerCaption.length()),
51 eventMarkerCaption.c_str());
52 glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
53 glClear(GL_COLOR_BUFFER_BIT);
54
55 glPushGroupMarkerEXT(0, NULL);
56 glClearColor(0.0f, 1.0f, 0.0f, 0.0f);
57 glClear(GL_COLOR_BUFFER_BIT);
58
59 glPopGroupMarkerEXT();
60 glClearColor(0.0f, 0.0f, 1.0f, 0.0f);
61 glClear(GL_COLOR_BUFFER_BIT);
62
63 glPopGroupMarkerEXT();
64
65 ASSERT_GL_NO_ERROR();
66 }
67
68 // Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
69 ANGLE_INSTANTIATE_TEST(DebugMarkerTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL(), ES2_OPENGLES());
70
71 } // namespace
72