es3fReadPixelsTests.cpp revision 115e0bf114f70d2c8caec6ff7a85aa7536ac713f
1/*------------------------------------------------------------------------- 2 * drawElements Quality Program OpenGL ES 3.0 Module 3 * ------------------------------------------------- 4 * 5 * Copyright 2014 The Android Open Source Project 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 *//*! 20 * \file 21 * \brief Read pixels tests 22 *//*--------------------------------------------------------------------*/ 23 24#include "es3fReadPixelsTests.hpp" 25 26#include "tcuTexture.hpp" 27#include "tcuTextureUtil.hpp" 28#include "tcuImageCompare.hpp" 29#include "tcuTestLog.hpp" 30#include "tcuRenderTarget.hpp" 31 32#include "deRandom.hpp" 33#include "deMath.h" 34#include "deString.h" 35 36#include "gluDefs.hpp" 37#include "gluShaderProgram.hpp" 38#include "gluStrUtil.hpp" 39#include "gluTextureUtil.hpp" 40 41#include <cstring> 42#include <sstream> 43 44#include "glw.h" 45 46using std::vector; 47 48namespace deqp 49{ 50namespace gles3 51{ 52namespace Functional 53{ 54 55namespace 56{ 57 58class ReadPixelsTest : public TestCase 59{ 60public: 61 ReadPixelsTest (Context& context, const char* name, const char* description, bool chooseFormat, int alignment, GLint rowLength, GLint skipRows, GLint skipPixels, GLenum format = GL_RGBA, GLenum type = GL_UNSIGNED_BYTE); 62 63 IterateResult iterate (void); 64 void render (tcu::Texture2D& reference); 65 66private: 67 int m_seed; 68 bool m_chooseFormat; 69 int m_alignment; 70 GLint m_rowLength; 71 GLint m_skipRows; 72 GLint m_skipPixels; 73 GLint m_format; 74 GLint m_type; 75 76 const int m_width; 77 const int m_height; 78 79 void getFormatInfo (tcu::TextureFormat& format, int& pixelSize); 80 void clearColor (tcu::Texture2D& reference, vector<deUint8>& pixelData, int pixelSize); 81}; 82 83ReadPixelsTest::ReadPixelsTest (Context& context, const char* name, const char* description, bool chooseFormat, int alignment, GLint rowLength, GLint skipRows, GLint skipPixels, GLenum format, GLenum type) 84 : TestCase (context, name, description) 85 , m_seed (deStringHash(name)) 86 , m_chooseFormat (chooseFormat) 87 , m_alignment (alignment) 88 , m_rowLength (rowLength) 89 , m_skipRows (skipRows) 90 , m_skipPixels (skipPixels) 91 , m_format (format) 92 , m_type (type) 93 , m_width (13) 94 , m_height (13) 95{ 96} 97 98void ReadPixelsTest::render (tcu::Texture2D& reference) 99{ 100 // Create program 101 const char* vertexSource = 102 "#version 300 es\n" 103 "in mediump vec2 i_coord;\n" 104 "void main (void)\n" 105 "{\n" 106 "\tgl_Position = vec4(i_coord, 0.0, 1.0);\n" 107 "}\n"; 108 109 std::stringstream fragmentSource; 110 111 112 fragmentSource << 113 "#version 300 es\n"; 114 115 if (reference.getFormat().type == tcu::TextureFormat::SIGNED_INT32) 116 fragmentSource << "layout(location = 0) out mediump ivec4 o_color;\n"; 117 else if (reference.getFormat().type == tcu::TextureFormat::UNSIGNED_INT32) 118 fragmentSource << "layout(location = 0) out mediump uvec4 o_color;\n"; 119 else 120 fragmentSource << "layout(location = 0) out mediump vec4 o_color;\n"; 121 122 fragmentSource << 123 "void main (void)\n" 124 "{\n"; 125 126 if (reference.getFormat().type == tcu::TextureFormat::UNSIGNED_INT32) 127 fragmentSource << "\to_color = uvec4(0, 0, 0, 1000);\n"; 128 else if (reference.getFormat().type == tcu::TextureFormat::SIGNED_INT32) 129 fragmentSource << "\to_color = ivec4(0, 0, 0, 1000);\n"; 130 else 131 fragmentSource << "\to_color = vec4(0.0, 0.0, 0.0, 1.0);\n"; 132 133 fragmentSource << 134 "}\n"; 135 136 glu::ShaderProgram program(m_context.getRenderContext(), glu::makeVtxFragSources(vertexSource, fragmentSource.str())); 137 138 m_testCtx.getLog() << program; 139 TCU_CHECK(program.isOk()); 140 GLU_CHECK_CALL(glUseProgram(program.getProgram())); 141 142 // Render 143 { 144 const float coords[] = 145 { 146 -0.5f, -0.5f, 147 0.5f, -0.5f, 148 0.5f, 0.5f, 149 150 0.5f, 0.5f, 151 -0.5f, 0.5f, 152 -0.5f, -0.5f 153 }; 154 GLuint coordLoc; 155 156 coordLoc = glGetAttribLocation(program.getProgram(), "i_coord"); 157 GLU_CHECK_MSG("glGetAttribLocation()"); 158 159 GLU_CHECK_CALL(glEnableVertexAttribArray(coordLoc)); 160 161 GLU_CHECK_CALL(glVertexAttribPointer(coordLoc, 2, GL_FLOAT, GL_FALSE, 0, coords)); 162 163 GLU_CHECK_CALL(glDrawArrays(GL_TRIANGLES, 0, 6)); 164 GLU_CHECK_CALL(glDisableVertexAttribArray(coordLoc)); 165 } 166 167 // Render reference 168 169 const int coordX1 = (int)((-0.5f * reference.getWidth() / 2.0f) + reference.getWidth() / 2.0f); 170 const int coordY1 = (int)((-0.5f * reference.getHeight() / 2.0f) + reference.getHeight() / 2.0f); 171 const int coordX2 = (int)(( 0.5f * reference.getWidth() / 2.0f) + reference.getWidth() / 2.0f); 172 const int coordY2 = (int)(( 0.5f * reference.getHeight() / 2.0f) + reference.getHeight() / 2.0f); 173 174 for (int x = 0; x < reference.getWidth(); x++) 175 { 176 if (x < coordX1 || x > coordX2) 177 continue; 178 179 for (int y = 0; y < reference.getHeight(); y++) 180 { 181 if (y >= coordY1 && y <= coordY2) 182 { 183 if (reference.getFormat().type == tcu::TextureFormat::SIGNED_INT32) 184 reference.getLevel(0).setPixel(tcu::IVec4(0, 0, 0, 1000), x, y); 185 else if (reference.getFormat().type == tcu::TextureFormat::UNSIGNED_INT32) 186 reference.getLevel(0).setPixel(tcu::UVec4(0, 0, 0, 1000), x, y); 187 else 188 reference.getLevel(0).setPixel(tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f), x, y); 189 } 190 } 191 } 192} 193 194void ReadPixelsTest::getFormatInfo (tcu::TextureFormat& format, int& pixelSize) 195{ 196 if (m_chooseFormat) 197 { 198 GLU_CHECK_CALL(glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &m_format)); 199 GLU_CHECK_CALL(glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &m_type)); 200 } 201 202 format = glu::mapGLTransferFormat(m_format, m_type); 203 pixelSize = format.getPixelSize(); 204} 205 206void ReadPixelsTest::clearColor (tcu::Texture2D& reference, vector<deUint8>& pixelData, int pixelSize) 207{ 208 de::Random rnd(m_seed); 209 GLuint framebuffer = 0; 210 GLuint renderbuffer = 0; 211 212 if (m_format == GL_RGBA_INTEGER) 213 { 214 if (m_type == GL_UNSIGNED_INT) 215 { 216 GLU_CHECK_CALL(glGenRenderbuffers(1, &renderbuffer)); 217 GLU_CHECK_CALL(glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer)); 218 GLU_CHECK_CALL(glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA32UI, m_width, m_height)); 219 } 220 else if (m_type == GL_INT) 221 { 222 GLU_CHECK_CALL(glGenRenderbuffers(1, &renderbuffer)); 223 GLU_CHECK_CALL(glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer)); 224 GLU_CHECK_CALL(glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA32I, m_width, m_height)); 225 } 226 else 227 DE_ASSERT(false); 228 229 GLU_CHECK_CALL(glBindRenderbuffer(GL_RENDERBUFFER, 0)); 230 GLU_CHECK_CALL(glGenFramebuffers(1, &framebuffer)); 231 GLU_CHECK_CALL(glBindFramebuffer(GL_FRAMEBUFFER, framebuffer)); 232 GLU_CHECK_CALL(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, renderbuffer)); 233 } 234 else if (m_format == GL_RGBA || m_format == GL_BGRA || m_format == GL_RGB) 235 { 236 // Empty 237 } 238 else 239 DE_ASSERT(false); 240 241 GLU_CHECK_CALL(glViewport(0, 0, reference.getWidth(), reference.getHeight())); 242 243 // Clear color 244 if (m_format == GL_RGBA || m_format == GL_BGRA || m_format == GL_RGB) 245 { 246 const float red = rnd.getFloat(); 247 const float green = rnd.getFloat(); 248 const float blue = rnd.getFloat(); 249 const float alpha = rnd.getFloat(); 250 251 const GLfloat color[] = { red, green, blue, alpha }; 252 // Clear target 253 GLU_CHECK_CALL(glClearColor(red, green, blue, alpha)); 254 m_testCtx.getLog() << tcu::TestLog::Message << "ClearColor: (" << red << ", " << green << ", " << blue << ")" << tcu::TestLog::EndMessage; 255 256 GLU_CHECK_CALL(glClearBufferfv(GL_COLOR, 0, color)); 257 258 // Clear reference 259 for (int x = 0; x < reference.getWidth(); x++) 260 for (int y = 0; y < reference.getHeight(); y++) 261 reference.getLevel(0).setPixel(tcu::UVec4((deUint32)(255.0f * red), (deUint32)(255.0f * green), (deUint32)(255.0f * blue), (deUint32)(255 * alpha)), x, y); 262 } 263 else if (m_format == GL_RGBA_INTEGER) 264 { 265 if (m_type == GL_INT) 266 { 267 const GLint red = rnd.getUint32(); 268 const GLint green = rnd.getUint32(); 269 const GLint blue = rnd.getUint32(); 270 const GLint alpha = rnd.getUint32(); 271 272 const GLint color[] = { red, green, blue, alpha }; 273 m_testCtx.getLog() << tcu::TestLog::Message << "ClearColor: (" << red << ", " << green << ", " << blue << ")" << tcu::TestLog::EndMessage; 274 275 GLU_CHECK_CALL(glClearBufferiv(GL_COLOR, 0, color)); 276 277 // Clear reference 278 for (int x = 0; x < reference.getWidth(); x++) 279 for (int y = 0; y < reference.getHeight(); y++) 280 reference.getLevel(0).setPixel(tcu::IVec4(red, green, blue, alpha), x, y); 281 } 282 else if (m_type == GL_UNSIGNED_INT) 283 { 284 const GLuint red = rnd.getUint32(); 285 const GLuint green = rnd.getUint32(); 286 const GLuint blue = rnd.getUint32(); 287 const GLuint alpha = rnd.getUint32(); 288 289 const GLuint color[] = { red, green, blue, alpha }; 290 m_testCtx.getLog() << tcu::TestLog::Message << "ClearColor: (" << red << ", " << green << ", " << blue << ")" << tcu::TestLog::EndMessage; 291 292 GLU_CHECK_CALL(glClearBufferuiv(GL_COLOR, 0, color)); 293 294 // Clear reference 295 for (int x = 0; x < reference.getWidth(); x++) 296 for (int y = 0; y < reference.getHeight(); y++) 297 reference.getLevel(0).setPixel(tcu::UVec4(red, green, blue, alpha), x, y); 298 } 299 else 300 DE_ASSERT(false); 301 } 302 else 303 DE_ASSERT(false); 304 305 render(reference); 306 307 const int rowWidth = (m_rowLength == 0 ? m_width : m_rowLength) + m_skipPixels; 308 const int rowPitch = m_alignment * deCeilFloatToInt32(pixelSize * rowWidth / (float)m_alignment); 309 310 pixelData.resize(rowPitch * (m_height + m_skipRows), 0); 311 312 GLU_CHECK_CALL(glReadPixels(0, 0, m_width, m_height, m_format, m_type, &(pixelData[0]))); 313 314 if (framebuffer) 315 GLU_CHECK_CALL(glDeleteFramebuffers(1, &framebuffer)); 316 317 if (renderbuffer) 318 GLU_CHECK_CALL(glDeleteRenderbuffers(1, &renderbuffer)); 319} 320 321TestCase::IterateResult ReadPixelsTest::iterate (void) 322{ 323 tcu::TextureFormat format(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8); 324 int pixelSize; 325 326 getFormatInfo(format, pixelSize); 327 m_testCtx.getLog() << tcu::TestLog::Message << "Format: " << glu::getPixelFormatStr(m_format) << ", Type: " << glu::getTypeStr(m_type) << tcu::TestLog::EndMessage; 328 329 tcu::Texture2D reference(format, m_width, m_height); 330 reference.allocLevel(0); 331 332 GLU_CHECK_CALL(glPixelStorei(GL_PACK_ALIGNMENT, m_alignment)); 333 m_testCtx.getLog() << tcu::TestLog::Message << "GL_PACK_ALIGNMENT: " << m_alignment << tcu::TestLog::EndMessage; 334 335 GLU_CHECK_CALL(glPixelStorei(GL_PACK_ROW_LENGTH, m_rowLength)); 336 m_testCtx.getLog() << tcu::TestLog::Message << "GL_PACK_ROW_LENGTH: " << m_rowLength << tcu::TestLog::EndMessage; 337 338 GLU_CHECK_CALL(glPixelStorei(GL_PACK_SKIP_ROWS, m_skipRows)); 339 m_testCtx.getLog() << tcu::TestLog::Message << "GL_PACK_SKIP_ROWS: " << m_skipRows << tcu::TestLog::EndMessage; 340 341 GLU_CHECK_CALL(glPixelStorei(GL_PACK_SKIP_PIXELS, m_skipPixels)); 342 m_testCtx.getLog() << tcu::TestLog::Message << "GL_PACK_SKIP_PIXELS: " << m_skipPixels << tcu::TestLog::EndMessage; 343 344 GLU_CHECK_CALL(glViewport(0, 0, m_width, m_height)); 345 346 vector<deUint8> pixelData; 347 clearColor(reference, pixelData, pixelSize); 348 349 const int rowWidth = (m_rowLength == 0 ? m_width : m_rowLength); 350 const int rowPitch = m_alignment * deCeilFloatToInt32(pixelSize * rowWidth / (float)m_alignment); 351 352 // \note GL_RGBA_INTEGER uses always renderbuffers that are never multisampled. Otherwise default framebuffer is used. 353 if (m_format != GL_RGBA_INTEGER && m_context.getRenderTarget().getNumSamples() > 1) 354 { 355 const tcu::IVec4 formatBitDepths = tcu::getTextureFormatBitDepth(format); 356 const deUint8 redThreshold = (deUint8)deCeilFloatToInt32(256.0f * (2.0f / (1 << deMin32(m_context.getRenderTarget().getPixelFormat().redBits, formatBitDepths.x())))); 357 const deUint8 greenThreshold = (deUint8)deCeilFloatToInt32(256.0f * (2.0f / (1 << deMin32(m_context.getRenderTarget().getPixelFormat().greenBits, formatBitDepths.y())))); 358 const deUint8 blueThreshold = (deUint8)deCeilFloatToInt32(256.0f * (2.0f / (1 << deMin32(m_context.getRenderTarget().getPixelFormat().blueBits, formatBitDepths.z())))); 359 const deUint8 alphaThreshold = (deUint8)deCeilFloatToInt32(256.0f * (2.0f / (1 << deMin32(m_context.getRenderTarget().getPixelFormat().alphaBits, formatBitDepths.w())))); 360 361 if (tcu::bilinearCompare(m_testCtx.getLog(), "Result", "Result", reference.getLevel(0), tcu::PixelBufferAccess(format, m_width, m_height, 1, rowPitch, 0, &(pixelData[0])), tcu::RGBA(redThreshold, greenThreshold, blueThreshold, alphaThreshold), tcu::COMPARE_LOG_RESULT)) 362 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass"); 363 else 364 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail"); 365 } 366 else 367 { 368 const tcu::IVec4 formatBitDepths = tcu::getTextureFormatBitDepth(format); 369 const float redThreshold = 2.0f / (1 << deMin32(m_context.getRenderTarget().getPixelFormat().redBits, formatBitDepths.x())); 370 const float greenThreshold = 2.0f / (1 << deMin32(m_context.getRenderTarget().getPixelFormat().greenBits, formatBitDepths.y())); 371 const float blueThreshold = 2.0f / (1 << deMin32(m_context.getRenderTarget().getPixelFormat().blueBits, formatBitDepths.z())); 372 const float alphaThreshold = 2.0f / (1 << deMin32(m_context.getRenderTarget().getPixelFormat().alphaBits, formatBitDepths.w())); 373 374 // Compare 375 if (tcu::floatThresholdCompare(m_testCtx.getLog(), "Result", "Result", reference.getLevel(0), tcu::PixelBufferAccess(format, m_width, m_height, 1, rowPitch, 0, &(pixelData[pixelSize * m_skipPixels + m_skipRows * rowPitch])), tcu::Vec4(redThreshold, greenThreshold, blueThreshold, alphaThreshold), tcu::COMPARE_LOG_RESULT)) 376 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass"); 377 else 378 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail"); 379 } 380 381 return STOP; 382} 383 384} // anonymous 385 386ReadPixelsTests::ReadPixelsTests (Context& context) 387 : TestCaseGroup(context, "read_pixels", "ReadPixel tests") 388{ 389} 390 391void ReadPixelsTests::init (void) 392{ 393 { 394 TestCaseGroup* group = new TestCaseGroup(m_context, "alignment", "Read pixels pack alignment parameter tests"); 395 396 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_1", "", false, 1, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE)); 397 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_2", "", false, 2, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE)); 398 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_4", "", false, 4, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE)); 399 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_8", "", false, 8, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE)); 400 401 group->addChild(new ReadPixelsTest(m_context, "rgba_int_1", "", false, 1, 0, 0, 0, GL_RGBA_INTEGER, GL_INT)); 402 group->addChild(new ReadPixelsTest(m_context, "rgba_int_2", "", false, 2, 0, 0, 0, GL_RGBA_INTEGER, GL_INT)); 403 group->addChild(new ReadPixelsTest(m_context, "rgba_int_4", "", false, 4, 0, 0, 0, GL_RGBA_INTEGER, GL_INT)); 404 group->addChild(new ReadPixelsTest(m_context, "rgba_int_8", "", false, 8, 0, 0, 0, GL_RGBA_INTEGER, GL_INT)); 405 406 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_1", "", false, 1, 0, 0, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 407 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_2", "", false, 2, 0, 0, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 408 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_4", "", false, 4, 0, 0, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 409 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_8", "", false, 8, 0, 0, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 410 411 group->addChild(new ReadPixelsTest(m_context, "choose_1", "", true, 1, 0, 0, 0)); 412 group->addChild(new ReadPixelsTest(m_context, "choose_2", "", true, 2, 0, 0, 0)); 413 group->addChild(new ReadPixelsTest(m_context, "choose_4", "", true, 4, 0, 0, 0)); 414 group->addChild(new ReadPixelsTest(m_context, "choose_8", "", true, 8, 0, 0, 0)); 415 416 addChild(group); 417 } 418 419 { 420 TestCaseGroup* group = new TestCaseGroup(m_context, "rowlength", "Read pixels rowlength test"); 421 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_17", "", false, 4, 17, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE)); 422 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_19", "", false, 4, 19, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE)); 423 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_23", "", false, 4, 23, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE)); 424 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_29", "", false, 4, 29, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE)); 425 426 group->addChild(new ReadPixelsTest(m_context, "rgba_int_17", "", false, 4, 17, 0, 0, GL_RGBA_INTEGER, GL_INT)); 427 group->addChild(new ReadPixelsTest(m_context, "rgba_int_19", "", false, 4, 19, 0, 0, GL_RGBA_INTEGER, GL_INT)); 428 group->addChild(new ReadPixelsTest(m_context, "rgba_int_23", "", false, 4, 23, 0, 0, GL_RGBA_INTEGER, GL_INT)); 429 group->addChild(new ReadPixelsTest(m_context, "rgba_int_29", "", false, 4, 29, 0, 0, GL_RGBA_INTEGER, GL_INT)); 430 431 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_17", "", false, 4, 17, 0, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 432 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_19", "", false, 4, 19, 0, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 433 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_23", "", false, 4, 23, 0, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 434 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_29", "", false, 4, 29, 0, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 435 436 group->addChild(new ReadPixelsTest(m_context, "choose_17", "", true, 4, 17, 0, 0)); 437 group->addChild(new ReadPixelsTest(m_context, "choose_19", "", true, 4, 19, 0, 0)); 438 group->addChild(new ReadPixelsTest(m_context, "choose_23", "", true, 4, 23, 0, 0)); 439 group->addChild(new ReadPixelsTest(m_context, "choose_29", "", true, 4, 29, 0, 0)); 440 441 addChild(group); 442 } 443 444 { 445 TestCaseGroup* group = new TestCaseGroup(m_context, "skip", "Read pixels skip pixels and rows test"); 446 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_0_3", "", false, 4, 17, 0, 3, GL_RGBA, GL_UNSIGNED_BYTE)); 447 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_3_0", "", false, 4, 17, 3, 0, GL_RGBA, GL_UNSIGNED_BYTE)); 448 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_3_3", "", false, 4, 17, 3, 3, GL_RGBA, GL_UNSIGNED_BYTE)); 449 group->addChild(new ReadPixelsTest(m_context, "rgba_ubyte_3_5", "", false, 4, 17, 3, 5, GL_RGBA, GL_UNSIGNED_BYTE)); 450 451 group->addChild(new ReadPixelsTest(m_context, "rgba_int_0_3", "", false, 4, 17, 0, 3, GL_RGBA_INTEGER, GL_INT)); 452 group->addChild(new ReadPixelsTest(m_context, "rgba_int_3_0", "", false, 4, 17, 3, 0, GL_RGBA_INTEGER, GL_INT)); 453 group->addChild(new ReadPixelsTest(m_context, "rgba_int_3_3", "", false, 4, 17, 3, 3, GL_RGBA_INTEGER, GL_INT)); 454 group->addChild(new ReadPixelsTest(m_context, "rgba_int_3_5", "", false, 4, 17, 3, 5, GL_RGBA_INTEGER, GL_INT)); 455 456 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_0_3", "", false, 4, 17, 0, 3, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 457 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_3_0", "", false, 4, 17, 3, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 458 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_3_3", "", false, 4, 17, 3, 3, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 459 group->addChild(new ReadPixelsTest(m_context, "rgba_uint_3_5", "", false, 4, 17, 3, 5, GL_RGBA_INTEGER, GL_UNSIGNED_INT)); 460 461 group->addChild(new ReadPixelsTest(m_context, "choose_0_3", "", true, 4, 17, 0, 3)); 462 group->addChild(new ReadPixelsTest(m_context, "choose_3_0", "", true, 4, 17, 3, 0)); 463 group->addChild(new ReadPixelsTest(m_context, "choose_3_3", "", true, 4, 17, 3, 3)); 464 group->addChild(new ReadPixelsTest(m_context, "choose_3_5", "", true, 4, 17, 3, 5)); 465 466 addChild(group); 467 } 468} 469 470} // Functional 471} // gles3 472} // deqp 473