1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.0 Module
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.
21 * \brief Tests for precision and range of GLSL builtins and types.
22 *//*--------------------------------------------------------------------*/
24 goog.provide('functional.gles3.es3fBuiltinPrecisionTests');
25 goog.require('framework.common.tcuTestCase');
26 goog.require('framework.opengl.gluShaderProgram');
27 goog.require('modules.shared.glsBuiltinPrecisionTests');
29 goog.scope(function() {
31 var es3fBuiltinPrecisionTests = functional.gles3.es3fBuiltinPrecisionTests;
32 var glsBuiltinPrecisionTests = modules.shared.glsBuiltinPrecisionTests;
33 var tcuTestCase = framework.common.tcuTestCase;
34 var gluShaderProgram = framework.opengl.gluShaderProgram;
38 * @param {number} caseId test case Id
39 * @return {tcuTestCase.DeqpTest}
41 es3fBuiltinPrecisionTests.createBuiltinPrecisionTests = function(context, caseId) {
42 /** @type {tcuTestCase.DeqpTest} */
43 var group = tcuTestCase.newTest('precision', 'Builtin precision tests');
45 /** @type {Array<gluShaderProgram.shaderType>} */ var shaderTypes = [];
46 var es3Cases = glsBuiltinPrecisionTests.createES3BuiltinCases(caseId);
48 shaderTypes.push(gluShaderProgram.shaderType.VERTEX);
49 shaderTypes.push(gluShaderProgram.shaderType.FRAGMENT);
51 glsBuiltinPrecisionTests.addBuiltinPrecisionTests(es3Cases, shaderTypes, group);
56 * Create and execute the test cases
57 * @param {WebGL2RenderingContext} context
58 * @param {number} caseId test case Id
60 es3fBuiltinPrecisionTests.run = function(context, caseId) {
63 var state = tcuTestCase.runner;
65 var test = es3fBuiltinPrecisionTests.createBuiltinPrecisionTests(context, caseId);
66 var testName = test.fullName();
67 var testDescription = test.getDescription() === undefined ? '' : test.getDescription();
69 state.testName = testName;
71 //Set up name and description of this test series.
72 setCurrentTestName(testName);
73 description(testDescription);
79 tcuTestCase.runTestCases();
81 bufferedLogToConsole('Exception: ' + err);
82 testFailedOptions('Failed to es3fAttribLocationTests.run tests', false);
83 tcuTestCase.runner.terminate();