Hash :
1478ec3c
Author :
Date :
2020-03-18T09:42:37
Add gles1 primtest tests Bug: angleproject:2303 Change-Id: Idece2eb2fb291799c9aae811ce63dafdd9333887 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2143029 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// PrimtestTests.cpp:
// GLES1 conformance primtest tests.
//
#include "GLES/gl.h"
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
#ifdef __cplusplus
extern "C" {
#endif
// ES 1.0
extern void DrawPrims(void);
#include "primtest/driver.h"
#include "primtest/tproto.h"
#ifdef __cplusplus
}
#endif
namespace angle
{
class GLES1PrimtestTest : public ANGLETest
{
protected:
GLES1PrimtestTest()
{
setWindowWidth(48);
setWindowHeight(48);
setConfigRedBits(8);
setConfigGreenBits(8);
setConfigBlueBits(8);
setConfigAlphaBits(8);
setConfigDepthBits(24);
setConfigStencilBits(8);
}
void testTearDown() override
{
if (mTestData != nullptr)
{
free(mTestData);
}
}
void execTest(long test)
{
long i;
for (i = 0; driver[i].test != TEST_NULL; i++)
{
if (driver[i].test == test)
{
break;
}
}
ASSERT_NE(TEST_NULL, driver[i].test);
driverRec &op = driver[i];
op.funcInit((void *)&mTestData);
op.finish = 0;
ASSERT_GL_NO_ERROR();
for (;;)
{
op.funcStatus(1, mTestData);
ASSERT_GL_NO_ERROR();
op.funcSet(1, mTestData);
ASSERT_GL_NO_ERROR();
DrawPrims();
ASSERT_GL_NO_ERROR();
long finish = op.funcUpdate(mTestData);
ASSERT_GL_NO_ERROR();
if (finish)
{
break;
}
};
}
protected:
void *mTestData;
};
TEST_P(GLES1PrimtestTest, Hint)
{
execTest(TEST_HINT);
}
TEST_P(GLES1PrimtestTest, Alias)
{
execTest(TEST_ALIAS);
}
TEST_P(GLES1PrimtestTest, Alpha)
{
execTest(TEST_ALPHA);
}
TEST_P(GLES1PrimtestTest, Blend)
{
execTest(TEST_BLEND);
}
TEST_P(GLES1PrimtestTest, Depth)
{
execTest(TEST_DEPTH);
}
TEST_P(GLES1PrimtestTest, Dither)
{
execTest(TEST_DITHER);
}
TEST_P(GLES1PrimtestTest, Fog)
{
execTest(TEST_FOG);
}
TEST_P(GLES1PrimtestTest, Light)
{
execTest(TEST_LIGHT);
}
TEST_P(GLES1PrimtestTest, Logic)
{
execTest(TEST_LOGICOP);
}
TEST_P(GLES1PrimtestTest, Scissor)
{
execTest(TEST_SCISSOR);
}
TEST_P(GLES1PrimtestTest, Shade)
{
execTest(TEST_SHADE);
}
TEST_P(GLES1PrimtestTest, Stencil)
{
execTest(TEST_STENCIL);
}
TEST_P(GLES1PrimtestTest, Texture)
{
execTest(TEST_TEXTURE);
}
ANGLE_INSTANTIATE_TEST(GLES1PrimtestTest, ES1_OPENGL(), ES1_VULKAN());
} // namespace angle
// Included here to fix a compile error due to white box tests using angle_end2end_tests_main.
void RegisterContextCompatibilityTests() {}