diff options
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3')
10 files changed, 553 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/input.run.txt new file mode 100644 index 0000000000..1d1f9189d7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +vec3_001_to_008.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html new file mode 100644 index 0000000000..6c4c642388 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html @@ -0,0 +1,313 @@ +<!DOCTYPE html> +<!-- this file is auto-generated. DO NOT EDIT. --> +<!-- +Copyright (c) 2019 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +--> +<html> +<head> +<meta charset="utf-8"> +<title>WebGL GLSL conformance test: vec3_001_to_008.html</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css" /> +<link rel="stylesheet" href="../../../../resources/ogles-tests.css" /> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> +<script src="../../ogles-utils.js"></script> +</head> +<body> +<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas> +<div id="description"></div> +<div id="console"></div> +</body> +<script> +"use strict"; +OpenGLESTestRunner.run({ + "tests": [ + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "../default/default.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "../default/default.vert", + "uniforms": { + "lightPosition": { + "count": 2, + "type": "uniform3fv", + "value": [ + 0.25, + 0.75, + 0.0, + 0.75, + 0.25, + 1.0 + ] + } + }, + "fragmentShader": "vec3array_frag.frag" + }, + "name": "vec3array_frag.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "uniforms": { + "result": { + "count": 1, + "type": "uniform4fv", + "value": [ + 0.25, + 0.75, + 0.5, + 1.0 + ] + } + }, + "fragmentShader": "../default/expected.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "vec3single_vert.vert", + "uniforms": { + "lightPosition": { + "count": 1, + "type": "uniform3fv", + "value": [ + 0.25, + 0.75, + 0.5 + ] + } + }, + "fragmentShader": "../default/default.frag" + }, + "name": "vec3single_vert.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "uniforms": { + "result": { + "count": 1, + "type": "uniform4fv", + "value": [ + 0.5, + 0.5, + 0.5, + 1.0 + ] + } + }, + "fragmentShader": "../default/expected.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "vec3arrayindirect_vert.vert", + "uniforms": { + "lightPosition": { + "count": 2, + "type": "uniform3fv", + "value": [ + 0.25, + 0.75, + 0.0, + 0.75, + 0.25, + 1.0 + ] + } + }, + "fragmentShader": "../default/default.frag" + }, + "name": "vec3arrayindirect_vert.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "uniforms": { + "result": { + "count": 1, + "type": "uniform4fv", + "value": [ + 0.5, + 0.5, + 0.5, + 1.0 + ] + } + }, + "fragmentShader": "../default/expected.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "vec3arraydirect_vert.vert", + "uniforms": { + "lightPosition": { + "count": 2, + "type": "uniform3fv", + "value": [ + 0.25, + 0.75, + 0.0, + 0.75, + 0.25, + 1.0 + ] + } + }, + "fragmentShader": "../default/default.frag" + }, + "name": "vec3arraydirect_vert.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "../default/default.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "vec3array_vert.vert", + "uniforms": { + "lightPosition": { + "count": 2, + "type": "uniform3fv", + "value": [ + 0.25, + 0.75, + 0.0, + 0.75, + 0.25, + 1.0 + ] + } + }, + "fragmentShader": "../default/default.frag" + }, + "name": "vec3array_vert.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "uniforms": { + "result": { + "count": 1, + "type": "uniform4fv", + "value": [ + 0.25, + 0.75, + 0.5, + 1.0 + ] + } + }, + "fragmentShader": "../default/expected.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "../default/default.vert", + "uniforms": { + "lightPosition": { + "count": 1, + "type": "uniform3fv", + "value": [ + 0.25, + 0.75, + 0.5 + ] + } + }, + "fragmentShader": "vec3single_frag.frag" + }, + "name": "vec3single_frag.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "uniforms": { + "result": { + "count": 1, + "type": "uniform4fv", + "value": [ + 0.5, + 0.5, + 0.5, + 1.0 + ] + } + }, + "fragmentShader": "../default/expected.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "../default/default.vert", + "uniforms": { + "lightPosition": { + "count": 2, + "type": "uniform3fv", + "value": [ + 0.25, + 0.75, + 0.0, + 0.75, + 0.25, + 1.0 + ] + } + }, + "fragmentShader": "vec3arrayindirect_frag.frag" + }, + "name": "vec3arrayindirect_frag.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "uniforms": { + "result": { + "count": 1, + "type": "uniform4fv", + "value": [ + 0.5, + 0.5, + 0.5, + 1.0 + ] + } + }, + "fragmentShader": "../default/expected.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "../default/default.vert", + "uniforms": { + "lightPosition": { + "count": 2, + "type": "uniform3fv", + "value": [ + 0.25, + 0.75, + 0.0, + 0.75, + 0.25, + 1.0 + ] + } + }, + "fragmentShader": "vec3arraydirect_frag.frag" + }, + "name": "vec3arraydirect_frag.test.html", + "pattern": "compare" + } + ] +}); +var successfullyParsed = true; +</script> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_frag.frag new file mode 100644 index 0000000000..0b13eee69d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_frag.frag @@ -0,0 +1,32 @@ + +/* +Copyright (c) 2019 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// +// vec3array_frag.frag: Simple Fragment shader using vec3 to get colors. +// +// + +varying vec4 color; + +uniform vec3 lightPosition[2]; + +void main(void) +{ + vec3 v[2]; + + v[1] = vec3(color.r, color.g, color.b); + + + v[0] = lightPosition[1]; + + + gl_FragColor = vec4(v[1] + v[1], 0.0)/2.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_vert.vert new file mode 100644 index 0000000000..91651bccee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_vert.vert @@ -0,0 +1,30 @@ + +/* +Copyright (c) 2019 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +// +// vec3array_vert.vert: Simple vertex shader using vec3 to get colors. +// +// + +varying vec4 color; +uniform vec3 lightPosition[2]; + +void main(void) +{ + vec3 v[2]; + + v[1] = vec3(gtf_Color.r, gtf_Color.g, gtf_Color.b); + + v[0] = lightPosition[1]; + + color = vec4(v[1] + v[1], 0.0)/2.0; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag new file mode 100644 index 0000000000..042af3233d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag @@ -0,0 +1,24 @@ + +/* +Copyright (c) 2019 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// +// vec3arraydirect_frag.frag: Fragment shader solid color +// +// +// + +uniform vec3 lightPosition[2]; +varying vec4 color; + +void main(void) +{ + gl_FragColor = vec4(lightPosition[0] + lightPosition[1], 0.0) * 0.5; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert new file mode 100644 index 0000000000..a68009f5e3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert @@ -0,0 +1,28 @@ + +/* +Copyright (c) 2019 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +// +// vec3arraydirect_vert.vert: Vertex shader solid color +// +// +// + +uniform vec3 lightPosition[2]; +varying vec4 color; + +void main(void) +{ + + color = vec4(lightPosition[0] + lightPosition[1], 0.0) * 0.5; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag new file mode 100644 index 0000000000..a1252a9253 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag @@ -0,0 +1,38 @@ + +/* +Copyright (c) 2019 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// +// vec3arrayindirect_frag.frag: Fragment shader solid color +// The vec3 values are determined at runtime. +// +// + +uniform vec3 lightPosition[2]; +varying vec4 color; + +void main(void) +{ + int i; + + gl_FragColor = vec4(0.0); + + /* + // No indirect indexing in fragment shaders + for (i = 0; i < 2; i++) + { + gl_FragColor += vec4(lightPosition[i], 0.0); + } + */ + gl_FragColor += vec4(lightPosition[0], 0.0); + gl_FragColor += vec4(lightPosition[1], 0.0); + + gl_FragColor /= 2.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert new file mode 100644 index 0000000000..8da406319f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert @@ -0,0 +1,34 @@ + +/* +Copyright (c) 2019 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +// +// vec3arrayindirect_vert.vert: Vertex shader solid color +// The vec3 values are determined at runtime. +// +// + +uniform vec3 lightPosition[2]; +varying vec4 color; + +void main(void) +{ + color = vec4(0.0); + + for (int i = 0; i < 2; i++) + { + color += vec4(lightPosition[i], 0.0); + } + + color /= 2.0; + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_frag.frag new file mode 100644 index 0000000000..73148c40ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_frag.frag @@ -0,0 +1,24 @@ + +/* +Copyright (c) 2019 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +// +// vec3Matrix_frag.frag: Fragment shader solid color +// +// +// + +uniform vec3 lightPosition; +varying vec4 color; + +void main(void) +{ + gl_FragColor = vec4(lightPosition, 0.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_vert.vert new file mode 100644 index 0000000000..386aaacde5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_vert.vert @@ -0,0 +1,28 @@ + +/* +Copyright (c) 2019 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +*/ + + +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +// +// vec3Matrix_vert.vert: Vertex shader solid color +// +// +// + +uniform vec3 lightPosition; +varying vec4 color; + +void main(void) +{ + + color = vec4(lightPosition, 0.0); + + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + +} |