Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 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 | |
Corentin Wallez | d3970de | 2015-05-14 11:07:48 -0400 | [diff] [blame] | 7 | #include "test_utils/ANGLETest.h" |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 8 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 9 | using namespace angle; |
| 10 | |
| 11 | template <typename IndexType, GLenum IndexTypeName> |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 12 | class IndexedPointsTest : public ANGLETest |
| 13 | { |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 14 | protected: |
| 15 | IndexedPointsTest() |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 16 | { |
| 17 | setWindowWidth(128); |
| 18 | setWindowHeight(128); |
| 19 | setConfigRedBits(8); |
| 20 | setConfigGreenBits(8); |
| 21 | setConfigBlueBits(8); |
| 22 | setConfigAlphaBits(8); |
| 23 | setConfigDepthBits(24); |
| 24 | } |
| 25 | |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 26 | float getIndexPositionX(size_t idx) { return (idx == 0 || idx == 3) ? -0.5f : 0.5f; } |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 27 | |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 28 | float getIndexPositionY(size_t idx) { return (idx == 2 || idx == 3) ? -0.5f : 0.5f; } |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 29 | |
| 30 | virtual void SetUp() |
| 31 | { |
| 32 | ANGLETest::SetUp(); |
| 33 | |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 34 | const std::string vertexShaderSource = |
Olli Etuaho | a20af6d | 2017-09-18 13:32:29 +0300 | [diff] [blame^] | 35 | R"(precision highp float; |
| 36 | attribute vec2 position; |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 37 | |
Olli Etuaho | a20af6d | 2017-09-18 13:32:29 +0300 | [diff] [blame^] | 38 | void main() { |
| 39 | gl_PointSize = 5.0; |
| 40 | gl_Position = vec4(position, 0.0, 1.0); |
| 41 | })"; |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 42 | |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 43 | const std::string fragmentShaderSource = |
Olli Etuaho | a20af6d | 2017-09-18 13:32:29 +0300 | [diff] [blame^] | 44 | R"(precision highp float; |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 45 | |
Olli Etuaho | a20af6d | 2017-09-18 13:32:29 +0300 | [diff] [blame^] | 46 | void main() |
| 47 | { |
| 48 | gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); |
| 49 | })"; |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 50 | |
Jamie Madill | 5599c8f | 2014-08-26 13:16:39 -0400 | [diff] [blame] | 51 | mProgram = CompileProgram(vertexShaderSource, fragmentShaderSource); |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 52 | ASSERT_NE(0u, mProgram); |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 53 | |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 54 | const std::string vertexShaderSource2 = |
Olli Etuaho | a20af6d | 2017-09-18 13:32:29 +0300 | [diff] [blame^] | 55 | R"(precision highp float; |
| 56 | attribute vec2 position; |
| 57 | attribute vec4 color; |
| 58 | varying vec4 vcolor; |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 59 | |
Olli Etuaho | a20af6d | 2017-09-18 13:32:29 +0300 | [diff] [blame^] | 60 | void main() { |
| 61 | gl_PointSize = 5.0; |
| 62 | gl_Position = vec4(position, 0.0, 1.0); |
| 63 | vcolor = color; |
| 64 | })"; |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 65 | |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 66 | const std::string fragmentShaderSource2 = |
Olli Etuaho | a20af6d | 2017-09-18 13:32:29 +0300 | [diff] [blame^] | 67 | R"(precision highp float; |
| 68 | varying vec4 vcolor; |
| 69 | |
| 70 | void main() |
| 71 | { |
| 72 | gl_FragColor = vec4(vcolor.xyz, 1.0); |
| 73 | })"; |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 74 | |
| 75 | mVertexWithColorBufferProgram = CompileProgram(vertexShaderSource2, fragmentShaderSource2); |
| 76 | ASSERT_NE(0u, mVertexWithColorBufferProgram); |
| 77 | |
| 78 | // Construct a vertex buffer of position values and color values |
| 79 | // contained in a single structure |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 80 | const float verticesWithColor[] = { |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 81 | getIndexPositionX(0), getIndexPositionY(0), 0.0f, 1.0f, 0.0f, |
| 82 | getIndexPositionX(2), getIndexPositionY(2), 0.0f, 1.0f, 0.0f, |
| 83 | getIndexPositionX(1), getIndexPositionY(1), 0.0f, 1.0f, 0.0f, |
| 84 | getIndexPositionX(3), getIndexPositionY(3), 0.0f, 1.0f, 0.0f, |
| 85 | }; |
| 86 | |
| 87 | glGenBuffers(1, &mVertexWithColorBuffer); |
| 88 | glBindBuffer(GL_ARRAY_BUFFER, mVertexWithColorBuffer); |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 89 | glBufferData(GL_ARRAY_BUFFER, sizeof(verticesWithColor), &verticesWithColor[0], |
| 90 | GL_STATIC_DRAW); |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 91 | |
| 92 | // Construct a vertex buffer of position values only |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 93 | const GLfloat vertices[] = { |
| 94 | getIndexPositionX(0), getIndexPositionY(0), getIndexPositionX(2), getIndexPositionY(2), |
| 95 | getIndexPositionX(1), getIndexPositionY(1), getIndexPositionX(3), getIndexPositionY(3), |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 96 | }; |
| 97 | glGenBuffers(1, &mVertexBuffer); |
| 98 | glBindBuffer(GL_ARRAY_BUFFER, mVertexBuffer); |
Corentin Wallez | 91c2fad | 2015-05-15 10:34:14 -0400 | [diff] [blame] | 99 | glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), &vertices[0], GL_STATIC_DRAW); |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 100 | |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 101 | // The indices buffer is shared between both variations of tests |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 102 | const IndexType indices[] = {0, 2, 1, 3}; |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 103 | glGenBuffers(1, &mIndexBuffer); |
| 104 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mIndexBuffer); |
Corentin Wallez | 91c2fad | 2015-05-15 10:34:14 -0400 | [diff] [blame] | 105 | glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), &indices[0], GL_STATIC_DRAW); |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | virtual void TearDown() |
| 109 | { |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 110 | glDeleteBuffers(1, &mVertexBuffer); |
| 111 | glDeleteBuffers(1, &mIndexBuffer); |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 112 | glDeleteProgram(mProgram); |
| 113 | |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 114 | glDeleteBuffers(1, &mVertexWithColorBuffer); |
| 115 | glDeleteProgram(mVertexWithColorBufferProgram); |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 116 | ANGLETest::TearDown(); |
| 117 | } |
| 118 | |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 119 | void runTest(GLuint firstIndex, bool useVertexBufferWithColor = false) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 120 | { |
| 121 | glClearColor(0.0f, 0.0f, 0.0f, 1.0f); |
| 122 | glClear(GL_COLOR_BUFFER_BIT); |
| 123 | |
| 124 | GLint viewportSize[4]; |
| 125 | glGetIntegerv(GL_VIEWPORT, viewportSize); |
| 126 | |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 127 | // Choose appropriate program to apply for the test |
| 128 | GLuint program = useVertexBufferWithColor ? mVertexWithColorBufferProgram : mProgram; |
| 129 | |
| 130 | if (useVertexBufferWithColor) |
| 131 | { |
| 132 | glBindBuffer(GL_ARRAY_BUFFER, mVertexWithColorBuffer); |
| 133 | GLint vertexLocation = glGetAttribLocation(program, "position"); |
Cooper Partin | 4d61f7e | 2015-08-12 10:56:50 -0700 | [diff] [blame] | 134 | glVertexAttribPointer(vertexLocation, 2, GL_FLOAT, GL_FALSE, |
| 135 | static_cast<const GLsizei>(VertexWithColorSize), 0); |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 136 | glEnableVertexAttribArray(vertexLocation); |
| 137 | |
| 138 | GLint vertexColorLocation = glGetAttribLocation(program, "color"); |
Cooper Partin | 4d61f7e | 2015-08-12 10:56:50 -0700 | [diff] [blame] | 139 | glVertexAttribPointer(vertexColorLocation, 3, GL_FLOAT, GL_FALSE, |
| 140 | static_cast<const GLsizei>(VertexWithColorSize), |
Jamie Madill | 876429b | 2017-04-20 15:46:24 -0400 | [diff] [blame] | 141 | (void *)((sizeof(float) * 2))); |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 142 | glEnableVertexAttribArray(vertexColorLocation); |
| 143 | } |
| 144 | else |
| 145 | { |
| 146 | glBindBuffer(GL_ARRAY_BUFFER, mVertexBuffer); |
| 147 | GLint vertexLocation = glGetAttribLocation(program, "position"); |
| 148 | glVertexAttribPointer(vertexLocation, 2, GL_FLOAT, GL_FALSE, 0, 0); |
| 149 | glEnableVertexAttribArray(vertexLocation); |
| 150 | } |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 151 | |
| 152 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mIndexBuffer); |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 153 | glUseProgram(program); |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 154 | |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 155 | glDrawElements(GL_POINTS, mPointCount - firstIndex, IndexTypeName, |
| 156 | reinterpret_cast<void *>(firstIndex * sizeof(IndexType))); |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 157 | |
| 158 | for (size_t i = 0; i < mPointCount; i++) |
| 159 | { |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 160 | GLuint x = |
| 161 | static_cast<GLuint>(viewportSize[0] + (getIndexPositionX(i) * 0.5f + 0.5f) * |
| 162 | (viewportSize[2] - viewportSize[0])); |
| 163 | GLuint y = |
| 164 | static_cast<GLuint>(viewportSize[1] + (getIndexPositionY(i) * 0.5f + 0.5f) * |
| 165 | (viewportSize[3] - viewportSize[1])); |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 166 | |
| 167 | if (i < firstIndex) |
| 168 | { |
| 169 | EXPECT_PIXEL_EQ(x, y, 0, 0, 0, 255); |
| 170 | } |
| 171 | else |
| 172 | { |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 173 | if (useVertexBufferWithColor) |
| 174 | { |
| 175 | // Pixel data is assumed to be GREEN |
| 176 | EXPECT_PIXEL_EQ(x, y, 0, 255, 0, 255); |
| 177 | } |
| 178 | else |
| 179 | { |
| 180 | // Pixel data is assumed to be RED |
| 181 | EXPECT_PIXEL_EQ(x, y, 255, 0, 0, 255); |
| 182 | } |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 183 | } |
| 184 | } |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 185 | swapBuffers(); |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | GLuint mProgram; |
| 189 | GLuint mVertexBuffer; |
| 190 | GLuint mIndexBuffer; |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 191 | |
| 192 | GLuint mVertexWithColorBufferProgram; |
| 193 | GLuint mVertexWithColorBuffer; |
| 194 | |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 195 | static const GLuint mPointCount = 4; |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 196 | |
| 197 | private: |
| 198 | const size_t VertexWithColorSize = sizeof(float) * 5; |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 199 | }; |
| 200 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 201 | typedef IndexedPointsTest<GLubyte, GL_UNSIGNED_BYTE> IndexedPointsTestUByte; |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 202 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 203 | TEST_P(IndexedPointsTestUByte, UnsignedByteOffset0) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 204 | { |
| 205 | runTest(0); |
| 206 | } |
| 207 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 208 | TEST_P(IndexedPointsTestUByte, UnsignedByteOffset1) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 209 | { |
| 210 | runTest(1); |
| 211 | } |
| 212 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 213 | TEST_P(IndexedPointsTestUByte, UnsignedByteOffset2) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 214 | { |
| 215 | runTest(2); |
| 216 | } |
| 217 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 218 | TEST_P(IndexedPointsTestUByte, UnsignedByteOffset3) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 219 | { |
| 220 | runTest(3); |
| 221 | } |
| 222 | |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 223 | TEST_P(IndexedPointsTestUByte, VertexWithColorUnsignedByteOffset0) |
| 224 | { |
| 225 | runTest(0, true); |
| 226 | } |
| 227 | |
| 228 | TEST_P(IndexedPointsTestUByte, VertexWithColorUnsignedByteOffset1) |
| 229 | { |
| 230 | runTest(1, true); |
| 231 | } |
| 232 | |
| 233 | TEST_P(IndexedPointsTestUByte, VertexWithColorUnsignedByteOffset2) |
| 234 | { |
| 235 | runTest(2, true); |
| 236 | } |
| 237 | |
| 238 | TEST_P(IndexedPointsTestUByte, VertexWithColorUnsignedByteOffset3) |
| 239 | { |
| 240 | runTest(3, true); |
| 241 | } |
| 242 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 243 | typedef IndexedPointsTest<GLushort, GL_UNSIGNED_SHORT> IndexedPointsTestUShort; |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 244 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 245 | TEST_P(IndexedPointsTestUShort, UnsignedShortOffset0) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 246 | { |
| 247 | runTest(0); |
| 248 | } |
| 249 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 250 | TEST_P(IndexedPointsTestUShort, UnsignedShortOffset1) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 251 | { |
| 252 | runTest(1); |
| 253 | } |
| 254 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 255 | TEST_P(IndexedPointsTestUShort, UnsignedShortOffset2) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 256 | { |
| 257 | runTest(2); |
| 258 | } |
| 259 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 260 | TEST_P(IndexedPointsTestUShort, UnsignedShortOffset3) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 261 | { |
| 262 | runTest(3); |
| 263 | } |
| 264 | |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 265 | TEST_P(IndexedPointsTestUShort, VertexWithColorUnsignedShortOffset0) |
| 266 | { |
| 267 | runTest(0, true); |
| 268 | } |
| 269 | |
| 270 | TEST_P(IndexedPointsTestUShort, VertexWithColorUnsignedShortOffset1) |
| 271 | { |
| 272 | runTest(1, true); |
| 273 | } |
| 274 | |
| 275 | TEST_P(IndexedPointsTestUShort, VertexWithColorUnsignedShortOffset2) |
| 276 | { |
| 277 | runTest(2, true); |
| 278 | } |
| 279 | |
| 280 | TEST_P(IndexedPointsTestUShort, VertexWithColorUnsignedShortOffset3) |
| 281 | { |
| 282 | runTest(3, true); |
| 283 | } |
| 284 | |
| 285 | TEST_P(IndexedPointsTestUShort, VertexWithColorUnsignedShortOffsetChangingIndices) |
| 286 | { |
Frank Henigman | df55f25 | 2017-04-05 15:32:06 -0400 | [diff] [blame] | 287 | // TODO(fjhenigman): Figure out why this fails on Ozone Intel. |
| 288 | if (IsOzone() && IsIntel() && IsOpenGLES()) |
| 289 | { |
| 290 | std::cout << "Test skipped on Ozone Intel." << std::endl; |
| 291 | return; |
| 292 | } |
| 293 | |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 294 | runTest(3, true); |
| 295 | runTest(1, true); |
| 296 | runTest(0, true); |
| 297 | runTest(2, true); |
| 298 | } |
| 299 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 300 | typedef IndexedPointsTest<GLuint, GL_UNSIGNED_INT> IndexedPointsTestUInt; |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 301 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 302 | TEST_P(IndexedPointsTestUInt, UnsignedIntOffset0) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 303 | { |
Martin Radev | 1be913c | 2016-07-11 17:59:16 +0300 | [diff] [blame] | 304 | if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 305 | { |
| 306 | return; |
| 307 | } |
| 308 | |
| 309 | runTest(0); |
| 310 | } |
| 311 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 312 | TEST_P(IndexedPointsTestUInt, UnsignedIntOffset1) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 313 | { |
Martin Radev | 1be913c | 2016-07-11 17:59:16 +0300 | [diff] [blame] | 314 | if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 315 | { |
| 316 | return; |
| 317 | } |
| 318 | |
| 319 | runTest(1); |
| 320 | } |
| 321 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 322 | TEST_P(IndexedPointsTestUInt, UnsignedIntOffset2) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 323 | { |
Martin Radev | 1be913c | 2016-07-11 17:59:16 +0300 | [diff] [blame] | 324 | if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 325 | { |
| 326 | return; |
| 327 | } |
| 328 | |
| 329 | runTest(2); |
| 330 | } |
| 331 | |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 332 | TEST_P(IndexedPointsTestUInt, UnsignedIntOffset3) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 333 | { |
Martin Radev | 1be913c | 2016-07-11 17:59:16 +0300 | [diff] [blame] | 334 | if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) |
Geoff Lang | f8c2f5c | 2013-12-05 13:52:33 -0500 | [diff] [blame] | 335 | { |
| 336 | return; |
| 337 | } |
| 338 | |
| 339 | runTest(3); |
| 340 | } |
Jamie Madill | fa05f60 | 2015-05-07 13:47:11 -0400 | [diff] [blame] | 341 | |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 342 | TEST_P(IndexedPointsTestUInt, VertexWithColorUnsignedIntOffset0) |
| 343 | { |
Martin Radev | 1be913c | 2016-07-11 17:59:16 +0300 | [diff] [blame] | 344 | if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 345 | { |
| 346 | return; |
| 347 | } |
| 348 | |
| 349 | runTest(0, false); |
| 350 | } |
| 351 | |
| 352 | TEST_P(IndexedPointsTestUInt, VertexWithColorUnsignedIntOffset1) |
| 353 | { |
Martin Radev | 1be913c | 2016-07-11 17:59:16 +0300 | [diff] [blame] | 354 | if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 355 | { |
| 356 | return; |
| 357 | } |
| 358 | |
| 359 | runTest(1, false); |
| 360 | } |
| 361 | |
| 362 | TEST_P(IndexedPointsTestUInt, VertexWithColorUnsignedIntOffset2) |
| 363 | { |
Martin Radev | 1be913c | 2016-07-11 17:59:16 +0300 | [diff] [blame] | 364 | if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 365 | { |
| 366 | return; |
| 367 | } |
| 368 | |
| 369 | runTest(2, false); |
| 370 | } |
| 371 | |
| 372 | TEST_P(IndexedPointsTestUInt, VertexWithColorUnsignedIntOffset3) |
| 373 | { |
Martin Radev | 1be913c | 2016-07-11 17:59:16 +0300 | [diff] [blame] | 374 | if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint")) |
Cooper Partin | 558f2b5 | 2015-06-02 09:34:11 -0700 | [diff] [blame] | 375 | { |
| 376 | return; |
| 377 | } |
| 378 | |
| 379 | runTest(3, false); |
| 380 | } |
| 381 | |
Geoff Lang | c422207 | 2015-05-25 13:19:48 -0400 | [diff] [blame] | 382 | // TODO(geofflang): Figure out why this test fails on Intel OpenGL |
Geoff Lang | e0cc2a4 | 2016-01-20 10:58:17 -0500 | [diff] [blame] | 383 | ANGLE_INSTANTIATE_TEST(IndexedPointsTestUByte, |
| 384 | ES2_D3D11(), |
| 385 | ES2_D3D11_FL9_3(), |
| 386 | ES2_OPENGL(), |
| 387 | ES2_OPENGLES()); |
| 388 | ANGLE_INSTANTIATE_TEST(IndexedPointsTestUShort, |
| 389 | ES2_D3D11(), |
| 390 | ES2_D3D11_FL9_3(), |
| 391 | ES2_OPENGL(), |
| 392 | ES2_OPENGLES()); |
| 393 | ANGLE_INSTANTIATE_TEST(IndexedPointsTestUInt, |
| 394 | ES2_D3D11(), |
| 395 | ES2_D3D11_FL9_3(), |
| 396 | ES2_OPENGL(), |
| 397 | ES2_OPENGLES()); |