diff options
Diffstat (limited to '')
14 files changed, 363 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/input.run.txt new file mode 100644 index 0000000000..552692d678 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +max_001_to_006.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_001_to_006.html new file mode 100644 index 0000000000..6f36d22cde --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_001_to_006.html @@ -0,0 +1,109 @@ +<!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: max_001_to_006.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": "max_float_frag_xvary_yconsthalf_ref.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "max_float_frag_xvary_yconsthalf.frag" + }, + "name": "max_float_frag_xvary_yconsthalf.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "max_vec2_frag_xvary_yconsthalf_ref.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "max_vec2_frag_xvary_yconsthalf.frag" + }, + "name": "max_vec2_frag_xvary_yconsthalf.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "max_vec3_frag_xvary_yconsthalf_ref.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "max_vec3_frag_xvary_yconsthalf.frag" + }, + "name": "max_vec3_frag_xvary_yconsthalf.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "max_float_vert_xvary_yconsthalf_ref.vert", + "fragmentShader": "../default/default.frag" + }, + "model": "grid", + "testProgram": { + "vertexShader": "max_float_vert_xvary_yconsthalf.vert", + "fragmentShader": "../default/default.frag" + }, + "name": "max_float_vert_xvary_yconsthalf.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "max_vec2_vert_xvary_yconsthalf_ref.vert", + "fragmentShader": "../default/default.frag" + }, + "model": "grid", + "testProgram": { + "vertexShader": "max_vec2_vert_xvary_yconsthalf.vert", + "fragmentShader": "../default/default.frag" + }, + "name": "max_vec2_vert_xvary_yconsthalf.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "max_vec3_vert_xvary_yconsthalf_ref.vert", + "fragmentShader": "../default/default.frag" + }, + "model": "grid", + "testProgram": { + "vertexShader": "max_vec3_vert_xvary_yconsthalf.vert", + "fragmentShader": "../default/default.frag" + }, + "name": "max_vec3_vert_xvary_yconsthalf.test.html", + "pattern": "compare" + } + ] +}); +var successfullyParsed = true; +</script> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag new file mode 100644 index 0000000000..f67b0b4bf7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag @@ -0,0 +1,19 @@ + +/* +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 +varying vec4 color; + +void main (void) +{ + const float max_c = 0.5; + float c = color.r; + gl_FragColor = vec4(max(c, max_c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 0000000000..4aadedb023 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,21 @@ + +/* +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 +varying vec4 color; + +void main (void) +{ + const float max_c = 0.5; + float c = color.r; + if(c < max_c) c = max_c; + + gl_FragColor = vec4(c, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert new file mode 100644 index 0000000000..31624e13fa --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert @@ -0,0 +1,20 @@ + +/* +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; +varying vec4 color; + +void main (void) +{ + const float max_c = 0.5; + float c = gtf_Color.r; + color = vec4(max(c, max_c), 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 0000000000..c8e5054b2d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert @@ -0,0 +1,22 @@ + +/* +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; +varying vec4 color; + +void main (void) +{ + const float max_c = 0.5; + float c = gtf_Color.r; + if(c < max_c) c = max_c; + + color = vec4(c, 0.0, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag new file mode 100644 index 0000000000..63f8f0bf70 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag @@ -0,0 +1,19 @@ + +/* +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 +varying vec4 color; + +void main (void) +{ + const vec2 max_c = vec2(0.5, 0.5); + vec2 c = color.rg; + gl_FragColor = vec4(max(c, max_c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 0000000000..4935dbd0c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,22 @@ + +/* +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 +varying vec4 color; + +void main (void) +{ + const vec2 max_c = vec2(0.5, 0.5); + vec2 c = color.rg; + if(c[0] < max_c[0]) c[0] = max_c[0]; + if(c[1] < max_c[1]) c[1] = max_c[1]; + + gl_FragColor = vec4(c, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert new file mode 100644 index 0000000000..94089c7628 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert @@ -0,0 +1,20 @@ + +/* +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; +varying vec4 color; + +void main (void) +{ + const vec2 max_c = vec2(0.5, 0.5); + vec2 c = gtf_Color.rg; + color = vec4(max(c, max_c), 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 0000000000..5705a9438f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert @@ -0,0 +1,23 @@ + +/* +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; +varying vec4 color; + +void main (void) +{ + const vec2 max_c = vec2(0.5, 0.5); + vec2 c = gtf_Color.rg; + if(c[0] < max_c[0]) c[0] = max_c[0]; + if(c[1] < max_c[1]) c[1] = max_c[1]; + + color = vec4(c, 0.0, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag new file mode 100644 index 0000000000..a0709c9477 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag @@ -0,0 +1,19 @@ + +/* +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 +varying vec4 color; + +void main (void) +{ + const vec3 max_c = vec3(0.5, 0.5, 0.5); + vec3 c = color.rgb; + gl_FragColor = vec4(max(c, max_c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag new file mode 100644 index 0000000000..be1c59119c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag @@ -0,0 +1,23 @@ + +/* +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 +varying vec4 color; + +void main (void) +{ + const vec3 max_c = vec3(0.5, 0.5, 0.5); + vec3 c = color.rgb; + if(c[0] < max_c[0]) c[0] = max_c[0]; + if(c[1] < max_c[1]) c[1] = max_c[1]; + if(c[2] < max_c[2]) c[2] = max_c[2]; + + gl_FragColor = vec4(c, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert new file mode 100644 index 0000000000..1738973213 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert @@ -0,0 +1,20 @@ + +/* +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; +varying vec4 color; + +void main (void) +{ + const vec3 max_c = vec3(0.5, 0.5, 0.5); + vec3 c = gtf_Color.rgb; + color = vec4(max(c, max_c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert new file mode 100644 index 0000000000..5e09dede0b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const vec3 max_c = vec3(0.5, 0.5, 0.5); + vec3 c = gtf_Color.rgb; + if(c[0] < max_c[0]) c[0] = max_c[0]; + if(c[1] < max_c[1]) c[1] = max_c[1]; + if(c[2] < max_c[2]) c[2] = max_c[2]; + + color = vec4(c, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} |