diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp')
14 files changed, 387 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_001_to_006.html new file mode 100644 index 0000000000..3a7a027c09 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_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: clamp_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": "clamp_float_frag_xvary_yconstquarter_ref.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "clamp_float_frag_xvary_yconstquarter.frag" + }, + "name": "clamp_float_frag_xvary_yconstquarter.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "clamp_vec2_frag_xvary_yconstquarter_ref.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "clamp_vec2_frag_xvary_yconstquarter.frag" + }, + "name": "clamp_vec2_frag_xvary_yconstquarter.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "clamp_vec3_frag_xvary_yconstquarter_ref.frag" + }, + "model": null, + "testProgram": { + "vertexShader": "../default/default.vert", + "fragmentShader": "clamp_vec3_frag_xvary_yconstquarter.frag" + }, + "name": "clamp_vec3_frag_xvary_yconstquarter.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "clamp_float_vert_xvary_yconstquarter_ref.vert", + "fragmentShader": "../default/default.frag" + }, + "model": "grid", + "testProgram": { + "vertexShader": "clamp_float_vert_xvary_yconstquarter.vert", + "fragmentShader": "../default/default.frag" + }, + "name": "clamp_float_vert_xvary_yconstquarter.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "clamp_vec2_vert_xvary_yconstquarter_ref.vert", + "fragmentShader": "../default/default.frag" + }, + "model": "grid", + "testProgram": { + "vertexShader": "clamp_vec2_vert_xvary_yconstquarter.vert", + "fragmentShader": "../default/default.frag" + }, + "name": "clamp_vec2_vert_xvary_yconstquarter.test.html", + "pattern": "compare" + }, + { + "referenceProgram": { + "vertexShader": "clamp_vec3_vert_xvary_yconstquarter_ref.vert", + "fragmentShader": "../default/default.frag" + }, + "model": "grid", + "testProgram": { + "vertexShader": "clamp_vec3_vert_xvary_yconstquarter.vert", + "fragmentShader": "../default/default.frag" + }, + "name": "clamp_vec3_vert_xvary_yconstquarter.test.html", + "pattern": "compare" + } + ] +}); +var successfullyParsed = true; +</script> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag new file mode 100644 index 0000000000..97c16a5ace --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + float c = color.r; + gl_FragColor = vec4(clamp(c, min_c, max_c), 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_ref.frag new file mode 100644 index 0000000000..beba604303 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_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 float min_c = 0.25; + const float max_c = 0.75; + float c = color.r; + if(c > max_c) c = max_c; + if(c < min_c) c = min_c; + + gl_FragColor = vec4(c, 0.0, 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert new file mode 100644 index 0000000000..37b17f8f45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + float c = gtf_Color.r; + color = vec4(clamp(c, min_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/clamp/clamp_float_vert_xvary_yconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter_ref.vert new file mode 100644 index 0000000000..5ba7a86b1c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter_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 float min_c = 0.25; + const float max_c = 0.75; + float c = gtf_Color.r; + if(c > max_c) c = max_c; + if(c < min_c) c = min_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/clamp/clamp_vec2_frag_xvary_yconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter.frag new file mode 100644 index 0000000000..78c4fa92b8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec2 min_c = vec2(0.25, 0.25); + const vec2 max_c = vec2(0.75, 0.75); + vec2 c = color.rg; + gl_FragColor = vec4(clamp(c, min_c, max_c), 0.0, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag new file mode 100644 index 0000000000..2e445dfbcb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag @@ -0,0 +1,25 @@ + +/* +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 min_c = vec2(0.25, 0.25); + const vec2 max_c = vec2(0.75, 0.75); + vec2 c = color.rg; + if(c[0] < min_c[0]) c[0] = min_c[0]; + if(c[1] < min_c[1]) c[1] = min_c[1]; + 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/clamp/clamp_vec2_vert_xvary_yconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter.vert new file mode 100644 index 0000000000..a4e2719168 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + vec2 c = gtf_Color.rg; + color = vec4(clamp(c, min_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/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert new file mode 100644 index 0000000000..e98e400d49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert @@ -0,0 +1,26 @@ + +/* +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 min_c = 0.25; + const float max_c = 0.75; + vec2 c = gtf_Color.rg; + if(c[0] > max_c) c[0] = max_c; + if(c[0] < min_c) c[0] = min_c; + if(c[1] > max_c) c[1] = max_c; + if(c[1] < min_c) c[1] = min_c; + + 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/clamp/clamp_vec3_frag_xvary_yconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter.frag new file mode 100644 index 0000000000..9b67fee7cf --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter.frag @@ -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. +*/ + + +#ifdef GL_ES +precision mediump float; +#endif +varying vec4 color; + +void main (void) +{ + const vec3 min_c = vec3(0.25, 0.25, 0.25); + const vec3 max_c = vec3(0.75, 0.75, 0.75); + vec3 c = color.rgb; + gl_FragColor = vec4(clamp(c, min_c, max_c), 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag new file mode 100644 index 0000000000..88341fc06a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag @@ -0,0 +1,27 @@ + +/* +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 min_c = vec3(0.25, 0.25, 0.25); + const vec3 max_c = vec3(0.75, 0.75, 0.75); + vec3 c = color.rgb; + if(c[0] < min_c[0]) c[0] = min_c[0]; + if(c[1] < min_c[1]) c[1] = min_c[1]; + if(c[2] < min_c[2]) c[2] = min_c[2]; + 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/clamp/clamp_vec3_vert_xvary_yconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter.vert new file mode 100644 index 0000000000..d9052ed643 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter.vert @@ -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. +*/ + + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + vec3 c = gtf_Color.rgb; + color = vec4(clamp(c, min_c, max_c), 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.vert new file mode 100644 index 0000000000..735597e449 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.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_Color; +attribute vec4 gtf_Vertex; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + const float min_c = 0.25; + const float max_c = 0.75; + vec3 c = gtf_Color.rgb; + if(c[0] > max_c) c[0] = max_c; + if(c[0] < min_c) c[0] = min_c; + if(c[1] > max_c) c[1] = max_c; + if(c[1] < min_c) c[1] = min_c; + if(c[2] > max_c) c[2] = max_c; + if(c[2] < min_c) c[2] = min_c; + + color = vec4(c, 1.0); + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/input.run.txt new file mode 100644 index 0000000000..2fafa275a4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/input.run.txt @@ -0,0 +1,2 @@ +# this file is auto-generated. DO NOT EDIT. +clamp_001_to_006.html |