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/conformance2/glsl3/texture-offset-non-constant-offset.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-non-constant-offset.html')
-rw-r--r-- | dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-non-constant-offset.html | 170 |
1 files changed, 170 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-non-constant-offset.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-non-constant-offset.html new file mode 100644 index 0000000000..8fd483140d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-offset-non-constant-offset.html @@ -0,0 +1,170 @@ +<!-- +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. +--> + +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>GLSL texture offset with non-constant offset test</title> +<link rel="stylesheet" href="../../resources/js-test-style.css"/> +<script src="../../js/js-test-pre.js"></script> +<script src="../../js/webgl-test-utils.js"></script> +<script src="../../js/glsl-conformance-test.js"></script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<script id="fshaderTextureOffset" type="x-shader/x-fragment">#version 300 es +precision mediump float; + +out vec4 my_FragColor; +uniform sampler2D u_sampler; +uniform vec2 u_texCoord; + +void main() { + ivec2 offset = ivec2(0); + my_FragColor = textureOffset(u_sampler, u_texCoord, offset); +} +</script> +<script id="fshaderTextureProjOffset" type="x-shader/x-fragment">#version 300 es +precision mediump float; + +out vec4 my_FragColor; +uniform sampler2D u_sampler; +uniform vec4 u_texCoord; + +void main() { + ivec2 offset = ivec2(0); + my_FragColor = textureProjOffset(u_sampler, u_texCoord, offset); +} +</script> +<script id="fshaderTextureLodOffset" type="x-shader/x-fragment">#version 300 es +precision mediump float; + +out vec4 my_FragColor; +uniform sampler2D u_sampler; +uniform vec2 u_texCoord; +uniform float u_lod; + +void main() { + ivec2 offset = ivec2(0); + my_FragColor = textureLodOffset(u_sampler, u_texCoord, u_lod, offset); +} +</script> +<script id="fshaderTextureProjLodOffset" type="x-shader/x-fragment">#version 300 es +precision mediump float; + +out vec4 my_FragColor; +uniform sampler2D u_sampler; +uniform vec4 u_texCoord; +uniform float u_lod; + +void main() { + ivec2 offset = ivec2(0); + my_FragColor = textureProjLodOffset(u_sampler, u_texCoord, u_lod, offset); +} +</script> +<script id="fshaderTextureGradOffset" type="x-shader/x-fragment">#version 300 es +precision mediump float; + +out vec4 my_FragColor; +uniform sampler2D u_sampler; +uniform vec2 u_texCoord; +uniform vec2 u_dPdx; +uniform vec2 u_dPdy; + +void main() { + ivec2 offset = ivec2(0); + my_FragColor = textureGradOffset(u_sampler, u_texCoord, u_dPdx, u_dPdy, offset); +} +</script> +<script id="fshaderTextureProjGradOffset" type="x-shader/x-fragment">#version 300 es +precision mediump float; + +out vec4 my_FragColor; +uniform sampler2D u_sampler; +uniform vec4 u_texCoord; +uniform vec2 u_dPdx; +uniform vec2 u_dPdy; + +void main() { + ivec2 offset = ivec2(0); + my_FragColor = textureProjGradOffset(u_sampler, u_texCoord, u_dPdx, u_dPdy, offset); +} +</script> +<script id="fshaderTexelFetchOffset" type="x-shader/x-fragment">#version 300 es +precision mediump float; + +out vec4 my_FragColor; +uniform sampler2D u_sampler; +uniform vec2 u_texCoord; +uniform vec2 u_lod; + +void main() { + ivec2 offset = ivec2(0); + my_FragColor = texelFetchOffset(u_sampler, ivec2(u_texCoord), int(u_lod), offset); +} +</script> +<script type="application/javascript"> +"use strict"; +description("A non-constant offset is not valid in texture offset functions."); + +var wtu = WebGLTestUtils; + +var shaderTextureOffsetSrc = wtu.getScript('fshaderTextureOffset'); +var shaderTextureLodOffsetSrc = wtu.getScript('fshaderTextureLodOffset'); +var shaderTextureGradOffsetSrc = wtu.getScript('fshaderTextureGradOffset'); +var shaderTextureProjOffsetSrc = wtu.getScript('fshaderTextureProjOffset'); +var shaderTextureProjLodOffsetSrc = wtu.getScript('fshaderTextureProjLodOffset'); +var shaderTextureProjGradOffsetSrc = wtu.getScript('fshaderTextureProjGradOffset'); +var shaderTexelFetchOffsetSrc = wtu.getScript('fshaderTexelFetchOffset'); + +var gl = wtu.create3DContext(undefined, undefined, 2); + +if (!gl) { + testFailed("Unable to initialize WebGL 2.0 context."); +} else { + GLSLConformanceTester.runTests([ + { + fShaderSource: shaderTextureOffsetSrc, + fShaderSuccess: false, + passMsg: 'textureOffset with non-constant offset is invalid' + }, + { + fShaderSource: shaderTextureLodOffsetSrc, + fShaderSuccess: false, + passMsg: 'textureLodOffset with non-constant offset is invalid' + }, + { + fShaderSource: shaderTextureGradOffsetSrc, + fShaderSuccess: false, + passMsg: 'textureGradOffset with non-constant offset is invalid' + }, + { + fShaderSource: shaderTextureProjOffsetSrc, + fShaderSuccess: false, + passMsg: 'textureProjOffset with non-constant offset is invalid' + }, + { + fShaderSource: shaderTextureProjLodOffsetSrc, + fShaderSuccess: false, + passMsg: 'textureProjLodOffset with non-constant offset is invalid' + }, + { + fShaderSource: shaderTextureProjGradOffsetSrc, + fShaderSuccess: false, + passMsg: 'textureProjGradOffset with non-constant offset is invalid' + }, + { + fShaderSource: shaderTexelFetchOffsetSrc, + fShaderSuccess: false, + passMsg: 'texelFetchOffset with non-constant offset is invalid' + } + ], 2); +} +</script> +</body> +</html> |