Path: blob/main_old/src/tests/gl_tests/DebugMarkerTest.cpp
1693 views
//1// Copyright 2015 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//5// DebugMarkerTest:6// Basic tests to ensure EXT_debug_marker entry points work.78#include "test_utils/ANGLETest.h"910using namespace angle;1112namespace13{1415class DebugMarkerTest : public ANGLETest16{17protected:18DebugMarkerTest()19{20setWindowWidth(128);21setWindowHeight(128);22setConfigRedBits(8);23setConfigGreenBits(8);24setConfigBlueBits(8);25setConfigAlphaBits(8);26}27};2829// Simple test to ensure the various EXT_debug_marker entry points don't crash.30// The debug markers can be validated by capturing this test under PIX/Graphics Diagnostics.31TEST_P(DebugMarkerTest, BasicValidation)32{33ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_debug_marker"));3435std::string eventMarkerCaption = "Test event marker caption";36std::string groupMarkerCaption = "Test group marker caption";3738glPushGroupMarkerEXT(static_cast<GLsizei>(groupMarkerCaption.length()),39groupMarkerCaption.c_str());4041// Do some basic operations between calls to extension entry points42glClearColor(1.0f, 1.0f, 1.0f, 1.0f);43glClear(GL_COLOR_BUFFER_BIT);4445glInsertEventMarkerEXT(static_cast<GLsizei>(eventMarkerCaption.length()),46eventMarkerCaption.c_str());47glClearColor(1.0f, 0.0f, 0.0f, 1.0f);48glClear(GL_COLOR_BUFFER_BIT);4950glPushGroupMarkerEXT(0, nullptr);51glClearColor(0.0f, 1.0f, 0.0f, 0.0f);52glClear(GL_COLOR_BUFFER_BIT);5354glPopGroupMarkerEXT();55glClearColor(0.0f, 0.0f, 1.0f, 0.0f);56glClear(GL_COLOR_BUFFER_BIT);5758glPopGroupMarkerEXT();5960ASSERT_GL_NO_ERROR();61}6263// Use this to select which configurations (e.g. which renderer, which GLES major version) these64// tests should be run against.65ANGLE_INSTANTIATE_TEST_ES2(DebugMarkerTest);6667} // namespace686970