1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES Utilities
3 * ------------------------------------------------
5 * Copyright 2014 The Android Open Source Project
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 goog.provide('functional.gles3.es3fReadPixelTests');
23 goog.require('framework.common.tcuImageCompare');
24 goog.require('framework.common.tcuRGBA');
25 goog.require('framework.common.tcuTestCase');
26 goog.require('framework.common.tcuTexture');
27 goog.require('framework.common.tcuTextureUtil');
28 goog.require('framework.delibs.debase.deRandom');
29 goog.require('framework.delibs.debase.deString');
30 goog.require('framework.opengl.gluShaderProgram');
31 goog.require('framework.opengl.gluTextureUtil');
33 goog.scope(function() {
34 var es3fReadPixelTests = functional.gles3.es3fReadPixelTests;
35 var tcuImageCompare = framework.common.tcuImageCompare;
36 var tcuRGBA = framework.common.tcuRGBA;
37 var tcuTestCase = framework.common.tcuTestCase;
38 var tcuTexture = framework.common.tcuTexture;
39 var tcuTextureUtil = framework.common.tcuTextureUtil;
40 var deString = framework.delibs.debase.deString;
41 var deRandom = framework.delibs.debase.deRandom;
42 var gluTextureUtil = framework.opengl.gluTextureUtil;
43 var gluShaderProgram = framework.opengl.gluShaderProgram;
47 * @extends {tcuTestCase.DeqpTest}
48 * @param {string} name
49 * @param {string} description
50 * @param {boolean} chooseFormat
51 * @param {number} alignment
52 * @param {number} rowLength
53 * @param {number} skipRows
54 * @param {number} skipPixels
55 * @param {number=} format
56 * @param {number=} type
58 es3fReadPixelTests.ReadPixelsTest = function(name, description, chooseFormat, alignment, rowLength, skipRows, skipPixels, format, type) {
59 tcuTestCase.DeqpTest.call(this, name, description);
61 /** @type {number} */ this.m_seed = deString.deStringHash(name);
62 /** @type {boolean} */ this.m_chooseFormat = chooseFormat;
63 /** @type {number} */ this.m_alignment = alignment;
64 /** @type {number} */ this.m_rowLength = rowLength;
65 /** @type {number} */ this.m_skipRows = skipRows;
66 /** @type {number} */ this.m_skipPixels = skipPixels;
67 /** @type {number} */ this.m_format = format !== undefined ? format : gl.RGBA;
68 /** @type {number} */ this.m_type = type !== undefined ? type : gl.UNSIGNED_BYTE;
70 /** @const {number} */ this.m_width = 13;
71 /** @const {number} */ this.m_height = 13;
74 es3fReadPixelTests.ReadPixelsTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
75 es3fReadPixelTests.ReadPixelsTest.prototype.constructor = es3fReadPixelTests.ReadPixelsTest;
78 * @param {tcuTexture.Texture2D} reference
80 es3fReadPixelTests.ReadPixelsTest.prototype.render = function(reference) {
81 var refType = /** @type {tcuTexture.ChannelType} */ (reference.getFormat().type);
82 /** @type {number} */ var width = reference.getWidth();
83 /** @type {number} */ var height = reference.getHeight();
84 /** @return {tcuTexture.PixelBufferAccess} */ var level0 = reference.getLevel(0);
87 /** @type {string} */ var vertexSource = '#version 300 es\n' +
88 'in mediump vec2 i_coord;\n' +
89 'void main (void)\n' +
91 '\tgl_Position = vec4(i_coord, 0.0, 1.0);\n' +
94 /** @type {string} */ var fragmentSource = '#version 300 es\n';
96 if (refType === tcuTexture.ChannelType.SIGNED_INT32)
97 fragmentSource += 'layout(location = 0) out mediump ivec4 o_color;\n';
98 else if (refType === tcuTexture.ChannelType.UNSIGNED_INT32)
99 fragmentSource += 'layout(location = 0) out mediump uvec4 o_color;\n';
101 fragmentSource += 'layout(location = 0) out mediump vec4 o_color;\n';
103 fragmentSource += 'void main (void)\n' +
106 if (refType === tcuTexture.ChannelType.UNSIGNED_INT32)
107 fragmentSource += '\to_color = uvec4(0, 0, 0, 1000);\n';
108 else if (refType === tcuTexture.ChannelType.SIGNED_INT32)
109 fragmentSource += '\to_color = ivec4(0, 0, 0, 1000);\n';
111 fragmentSource += '\to_color = vec4(0.0, 0.0, 0.0, 1.0);\n';
113 fragmentSource += '}\n';
115 /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexSource, fragmentSource));
117 assertMsgOptions(program.isOk(), 'Program failed', false, true);
119 gl.useProgram(program.getProgram());
122 /** @type {Array<number>} */ var coords = [
131 /** @type {number} */ var coordLoc;
133 coordLoc = gl.getAttribLocation(program.getProgram(), 'i_coord');
135 gl.enableVertexAttribArray(coordLoc);
137 /** @type {WebGLBuffer} */ var coordsGLBuffer = gl.createBuffer();
138 gl.bindBuffer(gl.ARRAY_BUFFER, coordsGLBuffer);
139 gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(coords), gl.STATIC_DRAW);
140 gl.vertexAttribPointer(coordLoc, 2, gl.FLOAT, false, 0, 0);
142 gl.drawArrays(gl.TRIANGLES, 0, 6);
143 gl.disableVertexAttribArray(coordLoc);
147 /** @type {number} */ var coordX1 = Math.floor((-0.5 * width / 2.0) + width / 2.0);
148 /** @type {number} */ var coordY1 = Math.floor((-0.5 * height / 2.0) + height / 2.0);
149 /** @type {number} */ var coordX2 = Math.floor((0.5 * width / 2.0) + width / 2.0);
150 /** @type {number} */ var coordY2 = Math.floor((0.5 * height / 2.0) + height / 2.0);
152 for (var x = 0; x < width; x++) {
153 if (x < coordX1 || x > coordX2)
156 for (var y = 0; y < height; y++) {
157 if (y >= coordY1 && y <= coordY2) {
158 if (refType === tcuTexture.ChannelType.SIGNED_INT32)
159 level0.setPixelInt([0, 0, 0, 1000], x, y);
160 else if (refType === tcuTexture.ChannelType.UNSIGNED_INT32)
161 level0.setPixelInt([0, 0, 0, 1000], x, y);
163 level0.setPixel([0.0, 0.0, 0.0, 1.0], x, y);
170 * @return {{format: tcuTexture.TextureFormat, pixelSize: number, align: boolean}}
172 es3fReadPixelTests.ReadPixelsTest.prototype.getFormatInfo = function() {
173 if (this.m_chooseFormat) {
174 this.m_format = /** @type {number} */ (gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT));
175 this.m_type = /** @type {number} */ (gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE));
178 /** @type {tcuTexture.TextureFormat} */ var fmt = gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_type);
179 /** @type {boolean} */ var align_;
180 switch (this.m_type) {
182 case gl.UNSIGNED_BYTE:
184 case gl.UNSIGNED_SHORT:
186 case gl.UNSIGNED_INT:
192 case gl.UNSIGNED_SHORT_5_6_5:
193 case gl.UNSIGNED_SHORT_4_4_4_4:
194 case gl.UNSIGNED_SHORT_5_5_5_1:
195 case gl.UNSIGNED_INT_2_10_10_10_REV:
196 case gl.UNSIGNED_INT_10F_11F_11F_REV:
197 case gl.UNSIGNED_INT_24_8:
198 case gl.FLOAT_32_UNSIGNED_INT_24_8_REV:
199 case gl.UNSIGNED_INT_5_9_9_9_REV:
204 throw new Error('Unsupported format');
207 /** @type {number} */ var pxSize = fmt.getPixelSize();
209 return {format: fmt, pixelSize: pxSize, align: align_};
213 * @param {tcuTexture.Texture2D} reference
214 * @param {boolean} align
215 * @param {number} pixelSize
216 * @return {goog.TypedArray}
218 es3fReadPixelTests.ReadPixelsTest.prototype.clearColor = function(reference, align, pixelSize) {
219 /** @type {number} */ var width = reference.getWidth();
220 /** @type {number} */ var height = reference.getHeight();
221 /** @return {tcuTexture.PixelBufferAccess} */ var level0 = reference.getLevel(0);
223 /** @type {deRandom.Random} */ var rnd = new deRandom.Random(this.m_seed);
224 /** @type {WebGLFramebuffer} */ var framebuffer;
225 /** @type {WebGLRenderbuffer} */ var renderbuffer;
226 /** @type {number} */ var red;
227 /** @type {number} */ var green;
228 /** @type {number} */ var blue;
229 /** @type {number} */ var alpha;
230 /** @type {Array<number>} */ var color;
232 if (this.m_format === gl.RGBA_INTEGER) {
233 if (this.m_type === gl.UNSIGNED_INT) {
234 renderbuffer = gl.createRenderbuffer();
235 gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
236 gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA32UI, this.m_width, this.m_height);
237 } else if (this.m_type === gl.INT) {
238 renderbuffer = gl.createRenderbuffer();
239 gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
240 gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA32I, this.m_width, this.m_height);
242 throw new Error('Type not supported');
244 gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
245 framebuffer = gl.createFramebuffer();
246 gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
247 gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbuffer);
248 } else if (this.m_format === gl.RGBA || /*this.m_format === gl.BGRA ||*/ this.m_format === gl.RGB) {
251 throw new Error('Format not supported');
253 gl.viewport(0, 0, width, height);
256 if (this.m_format === gl.RGBA || this.m_format === gl.RGB) {
257 red = rnd.getFloat();
258 green = rnd.getFloat();
259 blue = rnd.getFloat();
260 alpha = rnd.getFloat();
262 color = [red, green, blue, alpha];
264 gl.clearColor(red, green, blue, alpha);
265 bufferedLogToConsole('ClearColor: (' + red + ', ' + green + ', ' + blue + ')');
267 gl.clearBufferfv(gl.COLOR, 0, color);
271 } else if (this.m_format === gl.RGBA_INTEGER) {
272 if (this.m_type === gl.INT) {
273 red = Math.abs(rnd.getInt());
274 green = Math.abs(rnd.getInt());
275 blue = Math.abs(rnd.getInt());
276 alpha = Math.abs(rnd.getInt());
278 color = [red, green, blue, alpha];
279 bufferedLogToConsole('ClearColor: (' + red + ', ' + green + ', ' + blue + ')');
281 gl.clearBufferiv(gl.COLOR, 0, color);
284 level0.clear([red, green, blue, alpha]);
285 } else if (this.m_type === gl.UNSIGNED_INT) {
286 red = Math.abs(rnd.getInt());
287 green = Math.abs(rnd.getInt());
288 blue = Math.abs(rnd.getInt());
289 alpha = Math.abs(rnd.getInt());
291 color = [red, green, blue, alpha];
292 bufferedLogToConsole('ClearColor: (' + red + ', ' + green + ', ' + blue + ')');
294 gl.clearBufferuiv(gl.COLOR, 0, color);
299 throw new Error('Type not supported.');
301 throw new Error('Format not supported.');
303 this.render(reference);
305 /** @type {number} */ var rowWidth = (this.m_rowLength === 0 ? this.m_width : this.m_rowLength) + this.m_skipPixels;
306 /** @type {number} */ var rowPitch = (align ? this.m_alignment * Math.ceil(pixelSize * rowWidth / this.m_alignment) : rowWidth * pixelSize);
308 var arrayType = tcuTexture.getTypedArray(reference.getFormat().type);
309 /** @type {goog.TypedArray} */ var pixelData = new arrayType(rowPitch * (this.m_height + this.m_skipRows));
310 gl.readPixels(0, 0, this.m_width, this.m_height, this.m_format, this.m_type, pixelData);
313 gl.deleteFramebuffer(framebuffer);
316 gl.deleteRenderbuffer(renderbuffer);
322 * @return {tcuTestCase.IterateResult}
324 es3fReadPixelTests.ReadPixelsTest.prototype.iterate = function() {
325 /** @type {tcuTexture.TextureFormat} */ var format = new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8);
326 /** @type {number} */ var pixelSize;
327 /** @type {boolean} */ var align;
329 /** @type {{format: tcuTexture.TextureFormat, pixelSize: number, align: boolean}} */ var formatInfo = this.getFormatInfo();
330 format = formatInfo.format;
331 align = formatInfo.align;
332 pixelSize = formatInfo.pixelSize;
334 bufferedLogToConsole('Format: ' + this.m_format + ', Type: ' + this.m_type);
336 /** @type {tcuTexture.Texture2D} */ var reference = new tcuTexture.Texture2D(format, this.m_width, this.m_height);
337 reference.allocLevel(0);
338 /** @return {tcuTexture.PixelBufferAccess} */ var level0 = reference.getLevel(0);
340 this.m_alignment = /** @type {number} */ (gl.getParameter(gl.PACK_ALIGNMENT));
341 bufferedLogToConsole('gl.PACK_ALIGNMENT: ' + this.m_alignment);
343 this.m_rowLength = /** @type {number} */ (gl.getParameter(gl.PACK_ROW_LENGTH));
344 bufferedLogToConsole('gl.PACK_ROW_LENGTH: ' + this.m_rowLength);
346 this.m_skipRows = /** @type {number} */ (gl.getParameter(gl.PACK_SKIP_ROWS));
347 bufferedLogToConsole('gl.PACK_SKIP_ROWS: ' + this.m_skipRows);
349 this.m_skipPixels = /** @type {number} */ (gl.getParameter(gl.PACK_SKIP_PIXELS));
350 bufferedLogToConsole('gl.PACK_SKIP_PIXELS: ' + this.m_skipPixels);
352 gl.viewport(0, 0, this.m_width, this.m_height);
354 /** @type {goog.TypedArray} */ var pixelData = this.clearColor(reference, align, pixelSize);
356 /** @type {number} */ var rowWidth = (this.m_rowLength === 0 ? this.m_width : this.m_rowLength);
357 /** @type {number} */ var rowPitch = (align ? this.m_alignment * Math.ceil(pixelSize * rowWidth / this.m_alignment) : rowWidth * pixelSize);
358 /** @type {Array<number>} */ var formatBitDepths = [];
359 /** @type {number} */ var redThreshold;
360 /** @type {number} */ var greenThreshold;
361 /** @type {number} */ var blueThreshold;
362 /** @type {number} */ var alphaThreshold;
363 var redBits = /** @type {number} */ (gl.getParameter(gl.RED_BITS));
364 var blueBits = /** @type {number} */ (gl.getParameter(gl.BLUE_BITS));
365 var greenBits = /** @type {number} */ (gl.getParameter(gl.GREEN_BITS));
366 var alphaBits = /** @type {number} */ (gl.getParameter(gl.ALPHA_BITS));
367 /** @type {(tcuRGBA.RGBA|Array<number>)} */ var threshold;
368 /** @type {tcuTexture.PixelBufferAccess} */ var result;
369 // \note gl.RGBA_INTEGER uses always renderbuffers that are never multisampled. Otherwise default framebuffer is used.
370 if (this.m_format !== gl.RGBA_INTEGER && /** @type {number} */ (gl.getParameter(gl.SAMPLES)) > 1) {
371 formatBitDepths = tcuTextureUtil.getTextureFormatBitDepth(format);
372 redThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(redBits, formatBitDepths[0]))));
373 greenThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(greenBits, formatBitDepths[1]))));
374 blueThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(blueBits, formatBitDepths[2]))));
375 alphaThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(alphaBits, formatBitDepths[3]))));
377 result = tcuTexture.PixelBufferAccess.newFromTextureFormat(format, this.m_width, this.m_height, 1, rowPitch, 0, pixelData.buffer);
378 threshold = new tcuRGBA.RGBA([redThreshold, greenThreshold, blueThreshold, alphaThreshold]);
379 if (tcuImageCompare.bilinearCompare('Result', 'Result', level0, result, threshold))
380 testPassedOptions('Pass', true);
382 testFailedOptions('Fail', false);
384 formatBitDepths = tcuTextureUtil.getTextureFormatBitDepth(format);
385 redThreshold = 2.0 / (1 << Math.min(redBits, formatBitDepths[0]));
386 greenThreshold = 2.0 / (1 << Math.min(greenBits, formatBitDepths[1]));
387 blueThreshold = 2.0 / (1 << Math.min(blueBits, formatBitDepths[2]));
388 alphaThreshold = 2.0 / (1 << Math.min(alphaBits, formatBitDepths[3]));
391 result = new tcuTexture.PixelBufferAccess({
394 height: this.m_height,
396 data: pixelData.buffer,
397 offset: pixelSize * this.m_skipPixels + this.m_skipRows * rowPitch
400 threshold = [redThreshold, greenThreshold, blueThreshold, alphaThreshold];
401 if (tcuImageCompare.floatThresholdCompare('Result', 'Result', level0, result, threshold))
402 testPassedOptions('Pass', true);
404 testFailedOptions('Fail', false);
407 return tcuTestCase.IterateResult.STOP;
412 * @extends {tcuTestCase.DeqpTest}
414 es3fReadPixelTests.ReadPixelTests = function() {
415 tcuTestCase.DeqpTest.call(this, 'read_pixels', 'ReadPixel tests');
418 es3fReadPixelTests.ReadPixelTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
419 es3fReadPixelTests.ReadPixelTests.prototype.constructor = es3fReadPixelTests.ReadPixelTests;
421 es3fReadPixelTests.ReadPixelTests.prototype.init = function() {
422 /** @type {tcuTestCase.DeqpTest} */ var groupAlignment = tcuTestCase.newTest('alignment', 'Read pixels pack alignment parameter tests');
424 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_1', '', false, 1, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
425 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_2', '', false, 2, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
426 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_4', '', false, 4, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
427 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_8', '', false, 8, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
429 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_1', '', false, 1, 0, 0, 0, gl.RGBA_INTEGER, gl.INT));
430 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_2', '', false, 2, 0, 0, 0, gl.RGBA_INTEGER, gl.INT));
431 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_4', '', false, 4, 0, 0, 0, gl.RGBA_INTEGER, gl.INT));
432 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_8', '', false, 8, 0, 0, 0, gl.RGBA_INTEGER, gl.INT));
434 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_1', '', false, 1, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
435 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_2', '', false, 2, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
436 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_4', '', false, 4, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
437 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_8', '', false, 8, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
439 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_1', '', true, 1, 0, 0, 0));
440 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_2', '', true, 2, 0, 0, 0));
441 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_4', '', true, 4, 0, 0, 0));
442 groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_8', '', true, 8, 0, 0, 0));
444 this.addChild(groupAlignment);
446 /** @type {tcuTestCase.DeqpTest} */ var groupRowLength = tcuTestCase.newTest('rowlength', 'Read pixels rowlength test');
447 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_17', '', false, 4, 17, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
448 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_19', '', false, 4, 19, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
449 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_23', '', false, 4, 23, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
450 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_29', '', false, 4, 29, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
452 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_17', '', false, 4, 17, 0, 0, gl.RGBA_INTEGER, gl.INT));
453 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_19', '', false, 4, 19, 0, 0, gl.RGBA_INTEGER, gl.INT));
454 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_23', '', false, 4, 23, 0, 0, gl.RGBA_INTEGER, gl.INT));
455 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_29', '', false, 4, 29, 0, 0, gl.RGBA_INTEGER, gl.INT));
457 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_17', '', false, 4, 17, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
458 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_19', '', false, 4, 19, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
459 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_23', '', false, 4, 23, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
460 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_29', '', false, 4, 29, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
462 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_17', '', true, 4, 17, 0, 0));
463 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_19', '', true, 4, 19, 0, 0));
464 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_23', '', true, 4, 23, 0, 0));
465 groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_29', '', true, 4, 29, 0, 0));
467 this.addChild(groupRowLength);
469 /** @type {tcuTestCase.DeqpTest} */ var groupSkip = tcuTestCase.newTest('skip', 'Read pixels skip pixels and rows test');
470 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_0_3', '', false, 4, 17, 0, 3, gl.RGBA, gl.UNSIGNED_BYTE));
471 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_3_0', '', false, 4, 17, 3, 0, gl.RGBA, gl.UNSIGNED_BYTE));
472 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_3_3', '', false, 4, 17, 3, 3, gl.RGBA, gl.UNSIGNED_BYTE));
473 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_3_5', '', false, 4, 17, 3, 5, gl.RGBA, gl.UNSIGNED_BYTE));
475 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_0_3', '', false, 4, 17, 0, 3, gl.RGBA_INTEGER, gl.INT));
476 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_3_0', '', false, 4, 17, 3, 0, gl.RGBA_INTEGER, gl.INT));
477 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_3_3', '', false, 4, 17, 3, 3, gl.RGBA_INTEGER, gl.INT));
478 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_3_5', '', false, 4, 17, 3, 5, gl.RGBA_INTEGER, gl.INT));
480 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_0_3', '', false, 4, 17, 0, 3, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
481 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_3_0', '', false, 4, 17, 3, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
482 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_3_3', '', false, 4, 17, 3, 3, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
483 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_3_5', '', false, 4, 17, 3, 5, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
485 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_0_3', '', true, 4, 17, 0, 3));
486 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_3_0', '', true, 4, 17, 3, 0));
487 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_3_3', '', true, 4, 17, 3, 3));
488 groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_3_5', '', true, 4, 17, 3, 5));
490 this.addChild(groupSkip);
495 * @param {WebGL2RenderingContext} context
497 es3fReadPixelTests.run = function(context) {
499 //Set up Test Root parameters
500 var state = tcuTestCase.runner;
501 state.setRoot(new es3fReadPixelTests.ReadPixelTests());
503 //Set up name and description of this test series.
504 setCurrentTestName(state.testCases.fullName());
505 description(state.testCases.getDescription());
509 tcuTestCase.runTestCases();
512 testFailedOptions('Failed to es3fReadPixelTests.run tests', false);
513 tcuTestCase.runner.terminate();