Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/angle
Path: blob/main_old/src/tests/gl_tests/DebugMarkerTest.cpp
1693 views
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:
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.
32
TEST_P(DebugMarkerTest, BasicValidation)
33
{
34
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_debug_marker"));
35
36
std::string eventMarkerCaption = "Test event marker caption";
37
std::string groupMarkerCaption = "Test group marker caption";
38
39
glPushGroupMarkerEXT(static_cast<GLsizei>(groupMarkerCaption.length()),
40
groupMarkerCaption.c_str());
41
42
// Do some basic operations between calls to extension entry points
43
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
44
glClear(GL_COLOR_BUFFER_BIT);
45
46
glInsertEventMarkerEXT(static_cast<GLsizei>(eventMarkerCaption.length()),
47
eventMarkerCaption.c_str());
48
glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
49
glClear(GL_COLOR_BUFFER_BIT);
50
51
glPushGroupMarkerEXT(0, nullptr);
52
glClearColor(0.0f, 1.0f, 0.0f, 0.0f);
53
glClear(GL_COLOR_BUFFER_BIT);
54
55
glPopGroupMarkerEXT();
56
glClearColor(0.0f, 0.0f, 1.0f, 0.0f);
57
glClear(GL_COLOR_BUFFER_BIT);
58
59
glPopGroupMarkerEXT();
60
61
ASSERT_GL_NO_ERROR();
62
}
63
64
// Use this to select which configurations (e.g. which renderer, which GLES major version) these
65
// tests should be run against.
66
ANGLE_INSTANTIATE_TEST_ES2(DebugMarkerTest);
67
68
} // namespace
69
70