Path: blob/main_old/src/tests/gles1_conformance_tests/PrimtestTests.cpp
1693 views
//1// Copyright 2020 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// PrimtestTests.cpp:6// GLES1 conformance primtest tests.7//89#include "GLES/gl.h"10#include "test_utils/ANGLETest.h"11#include "test_utils/gl_raii.h"1213#ifdef __cplusplus14extern "C" {15#endif1617// ES 1.018extern void DrawPrims(void);1920#include "primtest/driver.h"21#include "primtest/tproto.h"2223#ifdef __cplusplus24}2526#endif2728namespace angle29{30class GLES1PrimtestTest : public ANGLETest31{32protected:33GLES1PrimtestTest()34{35setWindowWidth(48);36setWindowHeight(48);37setConfigRedBits(8);38setConfigGreenBits(8);39setConfigBlueBits(8);40setConfigAlphaBits(8);41setConfigDepthBits(24);42setConfigStencilBits(8);43}4445void testTearDown() override46{47if (mTestData != nullptr)48{49free(mTestData);50}51}5253void execTest(long test)54{55long i;56for (i = 0; driver[i].test != TEST_NULL; i++)57{58if (driver[i].test == test)59{60break;61}62}6364ASSERT_NE(TEST_NULL, driver[i].test);6566driverRec &op = driver[i];6768op.funcInit((void *)&mTestData);69op.finish = 0;70ASSERT_GL_NO_ERROR();7172for (;;)73{74op.funcStatus(1, mTestData);75ASSERT_GL_NO_ERROR();7677op.funcSet(1, mTestData);78ASSERT_GL_NO_ERROR();7980DrawPrims();81ASSERT_GL_NO_ERROR();8283long finish = op.funcUpdate(mTestData);84ASSERT_GL_NO_ERROR();85if (finish)86{87break;88}89};90}9192protected:93void *mTestData;94};9596TEST_P(GLES1PrimtestTest, Hint)97{98execTest(TEST_HINT);99}100101TEST_P(GLES1PrimtestTest, Alias)102{103execTest(TEST_ALIAS);104}105106TEST_P(GLES1PrimtestTest, Alpha)107{108execTest(TEST_ALPHA);109}110111TEST_P(GLES1PrimtestTest, Blend)112{113execTest(TEST_BLEND);114}115116TEST_P(GLES1PrimtestTest, Depth)117{118execTest(TEST_DEPTH);119}120121TEST_P(GLES1PrimtestTest, Dither)122{123execTest(TEST_DITHER);124}125126TEST_P(GLES1PrimtestTest, Fog)127{128execTest(TEST_FOG);129}130131TEST_P(GLES1PrimtestTest, Light)132{133execTest(TEST_LIGHT);134}135136TEST_P(GLES1PrimtestTest, Logic)137{138execTest(TEST_LOGICOP);139}140141TEST_P(GLES1PrimtestTest, Scissor)142{143execTest(TEST_SCISSOR);144}145146TEST_P(GLES1PrimtestTest, Shade)147{148execTest(TEST_SHADE);149}150151TEST_P(GLES1PrimtestTest, Stencil)152{153execTest(TEST_STENCIL);154}155156TEST_P(GLES1PrimtestTest, Texture)157{158execTest(TEST_TEXTURE);159}160161ANGLE_INSTANTIATE_TEST(GLES1PrimtestTest, ES1_OPENGL(), ES1_VULKAN());162} // namespace angle163164// Included here to fix a compile error due to white box tests using angle_end2end_tests_main.165void RegisterContextCompatibilityTests() {}166167