[Piglit] [PATCH 03/11] glean/glsl1: Delete duplicated built-in function tests.
Matt Turner
mattst88 at gmail.com
Tue May 20 15:31:55 PDT 2014
I've less "cross() function, in-place" because we don't have an
equivalent test for it elsewhere.
---
tests/all.py | 31 ----
tests/glean/tglsl1.cpp | 452 -------------------------------------------------
2 files changed, 483 deletions(-)
diff --git a/tests/all.py b/tests/all.py
index 6c94262..e80deec 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -179,38 +179,7 @@ glean_glsl_tests = ['Directly set fragment color',
'pre increment (++x)',
'post decrement (x--)',
'pre decrement (--x)',
- 'dot product',
- 'length() function',
- 'sqrt(vec4) function',
- 'sqrt(vec2) function',
- 'clamp() function',
- 'clamp() function, vec4',
- 'sin(vec4) function',
- 'cos(vec4) function',
- 'asin(vec4) function',
- 'acos(vec4) function',
- 'atan(vec4) function',
- 'pow(vec4) function',
- 'exp(vec4) function',
- 'exp2(vec4) function',
- 'log(vec4) function',
- 'log2(vec4) function',
- 'length() functions',
- 'normalize(vec3) function',
- 'cross() function',
'cross() function, in-place',
- 'abs() function',
- 'sign() function',
- 'floor() function',
- 'ceil() function',
- 'fract() function',
- 'mod() function',
- 'min() function',
- 'max() function',
- 'step() function',
- 'smoothstep() function',
- 'mix(vec4) function',
- 'mix(float) function',
'precision exp2',
'precision log2',
'simple if statement, fragment shader',
diff --git a/tests/glean/tglsl1.cpp b/tests/glean/tglsl1.cpp
index cd0d449..f8f8f03 100644
--- a/tests/glean/tglsl1.cpp
+++ b/tests/glean/tglsl1.cpp
@@ -604,281 +604,6 @@ static const ShaderProgram Programs[] = {
// built-in functions ================================================
{
- "dot product",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 u = vec4(-1.0, 0.5, 0.5, -0.25); \n"
- " vec4 v = vec4(0.5, 1.0, 0.5, 0.0); \n"
- " gl_FragColor = vec4(dot(u, v)); \n"
- "} \n",
- { 0.25, 0.25, 0.25, 0.25 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "length() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec3 u = vec3(0.25, 0.1, 0.2); \n"
- " gl_FragColor = vec4(length(u)); \n"
- "} \n",
- { 0.335, 0.335, 0.335, 0.335 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- // This test is interesting for sqrt(0) which may be
- // implemented as 1/rsqrt(x) which would generate Inf values
- "sqrt(vec4) function",
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = vec4(0.0, 0.09, 0.25, 1.0); \n"
- " u = u * uniform1.xxxx; // mul by 1.0 \n"
- " u = sqrt(u); \n"
- " gl_FragColor = u; \n"
- "} \n",
- { 0.0, 0.3, 0.5, 1.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "sqrt(vec2) function",
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec2 u = vec2(0.0, 0.04); \n"
- " u = u * uniform1.xx; // mul by 1.0 \n"
- " u = sqrt(u); \n"
- " u = u * uniform1.xx; // mul by 1.0 \n"
- " gl_FragColor = vec4(u.x, u.y, 0.0, 0.0); \n"
- "} \n",
- { 0.0, 0.2, 0.0, 0.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "clamp() function",
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = uniform1 * vec4(3.0); \n"
- " gl_FragColor = clamp(u, 0.0, 1.0); \n"
- "} \n",
- { 1.0, 0.75, 1.0, 0.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "clamp() function, vec4",
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = uniform1; \n"
- " gl_FragColor = clamp(u, vec4(0.2), vec4(0.8)); \n"
- "} \n",
- { 0.8, 0.25, 0.75, 0.2 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "sin(vec4) function",
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = vec4(0.0, 3.1415/2.0, 3.1415, -3.1415/2.0); \n"
- " u = u * uniform1.x; // mul by one \n"
- " u = sin(u); \n"
- " gl_FragColor = u * 0.5 + 0.5; // scale to [0,1] range \n"
- "} \n",
- { 0.5, 1.0, 0.5, 0.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "cos(vec4) function",
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = vec4(0.0, 3.1415/2.0, 3.1415, -3.1415/2.0); \n"
- " u = u * uniform1.x; // mul by one \n"
- " u = cos(u); \n"
- " gl_FragColor = u * 0.5 + 0.5; // scale to [0,1] range \n"
- "} \n",
- { 1.0, 0.5, 0.0, 0.5 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "asin(vec4) function",
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = vec4(0.0, 1.0, -1.0, 0.0); \n"
- " u = u * uniform1.x; // mul by one \n"
- " u = asin(u); \n"
- " gl_FragColor = u * 0.1 + 0.5; \n"
- "} \n",
- { 0.5, 0.5 + 0.157, 0.5 - 0.157, 0.5 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "acos(vec4) function",
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = vec4(0.0, 0.8, -0.8, 1.0); \n"
- " u = u * uniform1.x; // mul by one \n"
- " u = acos(u); \n"
- " gl_FragColor = u * 0.1; \n"
- "} \n",
- { 0.157, 0.064, 0.249, 0.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "atan(vec4) function",
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = vec4(0.0, 0.8, -0.6, 0.5); \n"
- " u = u * uniform1.x; // mul by one \n"
- " u = atan(u); \n"
- " gl_FragColor = u; \n"
- " gl_FragColor.z = -u.z; \n"
- "} \n",
- { 0.0, 0.675, 0.540, 0.464 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "pow(vec4) function",
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = vec4(0.5, 2.0, 0.3, 2.0); \n"
- " u = u * uniform1.x; // mul by one \n"
- " vec4 v = vec4(2.0, 0.5, 1.0, 0.0); \n"
- " gl_FragColor = pow(u, v) * 0.5; \n"
- "} \n",
- { 0.25 * 0.5, 1.4142 * 0.5, 0.3 * 0.5, 1.0 * 0.5 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "exp(vec4) function", // base e
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = vec4(1.0, 0.5, -0.5, 2.0); \n"
- " gl_FragColor = exp(u) * 0.1; \n"
- "} \n",
- { 0.2718, 0.1649, 0.0606, 0.7389 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "exp2(vec4) function", // base 2
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = vec4(1.0, 2.5, -0.5, 2.0); \n"
- " gl_FragColor = exp2(u) * 0.1; \n"
- "} \n",
- { 0.2, 0.5657, 0.0707, 0.4 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "log(vec4) function", // natural log
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = vec4(1.0, 10.0, 500.0, 1000.0); \n"
- " gl_FragColor = log(u) * 0.1; \n"
- "} \n",
- { 0.0, 0.2314, 0.6215, 0.6908 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "log2(vec4) function", // log base 2
- NO_VERTEX_SHADER,
- "uniform vec4 uniform1; \n"
- "void main() { \n"
- " vec4 u = vec4(1.0, 10.0, 500.0, 1000.0); \n"
- " gl_FragColor = log2(u) * 0.1; \n"
- "} \n",
- { 0.0, 0.3322, 0.8966, 0.9966 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "length() functions",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec2 v2 = vec2(1.0, 3.0); \n"
- " vec3 v3 = vec3(0.5, -1.0, 2.0); \n"
- " vec4 v4 = vec4(0.5, -1.0, 2.0, 1.0); \n"
- " gl_FragColor.x = length(v2) * 0.1; \n"
- " gl_FragColor.y = length(v3) * 0.1; \n"
- " gl_FragColor.z = length(v4) * 0.1; \n"
- " gl_FragColor.w = 1.0; \n"
- "} \n",
- { 0.3162, 0.2291, 0.25, 1.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "normalize(vec3) function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec3 v3 = vec3(0.5, -1.0, 2.0); \n"
- " v3 = normalize(v3); \n"
- " gl_FragColor.x = v3.x; \n"
- " gl_FragColor.y = v3.y; \n"
- " gl_FragColor.z = v3.z; \n"
- " gl_FragColor.w = 1.0; \n"
- "} \n",
- { 0.2182, /*-0.4364*/0.0, 0.8729, 1.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "cross() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec3 u = vec3(0.5, 0.0, 0.0); \n"
- " vec3 v = vec3(0.0, 0.5, 0.0); \n"
- " vec3 w = cross(u, v); \n"
- " gl_FragColor.xyz = w; \n"
- " gl_FragColor.w = 1.0; \n"
- "} \n",
- { 0.0, 0.0, 0.25, 1.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
// This is a Mesa regression test (bump.c)
"cross() function, in-place",
NO_VERTEX_SHADER,
@@ -899,183 +624,6 @@ static const ShaderProgram Programs[] = {
FLAG_NONE
},
- {
- "abs() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 v = vec4(-0.3, -0.7, 0.2, 0.0); \n"
- " gl_FragColor = abs(v); \n"
- "} \n",
- { 0.3, 0.7, 0.2, 0.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "sign() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 v = vec4(-0.3, 0.0, 0.2, 0.0); \n"
- " v = sign(v); \n"
- " gl_FragColor.x = v.x + 1.5; \n"
- " gl_FragColor.y = v.y + 0.5; \n"
- " gl_FragColor.z = v.z - 0.5; \n"
- " gl_FragColor.w = v.w + 0.5; \n"
- "} \n",
- { 0.5, 0.5, 0.5, 0.5 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "floor() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 v = vec4(1.3, -1.7, -0.2, 0.0); \n"
- " v = floor(v); \n"
- " gl_FragColor.x = v.x * 0.5; \n"
- " gl_FragColor.y = v.y + 2.5; \n"
- " gl_FragColor.z = v.z + 1.5; \n"
- " gl_FragColor.w = v.w + 0.5; \n"
- "} \n",
- { 0.5, 0.5, 0.5, 0.5 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "ceil() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 v = vec4(1.3, -1.7, -0.2, 0.0); \n"
- " v = ceil(v); \n"
- " gl_FragColor.x = v.x - 1.5; \n"
- " gl_FragColor.y = v.y + 1.5; \n"
- " gl_FragColor.z = v.z + 0.5; \n"
- " gl_FragColor.w = v.w + 0.5; \n"
- "} \n",
- { 0.5, 0.5, 0.5, 0.5 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "fract() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 v = vec4(1.3, -1.7, -0.2, 1.0); \n"
- " gl_FragColor = fract(v); \n"
- "} \n",
- { 0.3, 0.3, 0.8, 0.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "mod() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 u = vec4(7.0, 5.2, 5.3, 0.5); \n"
- " vec4 v = vec4(4.0, 5.0, -5.0, 1.0); \n"
- " vec4 w = mod(u, v); \n"
- " gl_FragColor.x = w.x * 0.1; \n"
- " gl_FragColor.y = w.y; \n"
- " gl_FragColor.z = w.z * -0.1; \n"
- " gl_FragColor.w = w.w; \n"
- "} \n",
- { 0.3, 0.2, 0.47, 0.5 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "min() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 u = vec4(-1.0, 0.5, 0.5, -0.25); \n"
- " vec4 v = vec4(0.5, 1.0, 0.5, 0.0); \n"
- " gl_FragColor = min(u, v); \n"
- "} \n",
- { 0.0, 0.5, 0.5, 0.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "max() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 u = vec4(-1.0, 0.5, 0.5, -0.25); \n"
- " vec4 v = vec4(0.5, 1.0, 0.5, 0.0); \n"
- " gl_FragColor = max(u, v); \n"
- "} \n",
- { 0.5, 1.0, 0.5, 0.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "step() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 edge = vec4(1.0, -2.0, 0.5, -1.0); \n"
- " vec4 v = vec4(0.5, -1.0, 0.0, 0.0); \n"
- " gl_FragColor = step(edge, v); \n"
- "} \n",
- { 0.0, 1.0, 0.0, 1.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "smoothstep() function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 edge0 = vec4(2.0); \n"
- " vec4 edge1 = vec4(4.0); \n"
- " vec4 v = vec4(1.0, 3.0, 4.0, 5.0); \n"
- " gl_FragColor = smoothstep(edge0, edge1, v); \n"
- "} \n",
- { 0.0, 0.5, 1.0, 1.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "mix(vec4) function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " vec4 v0 = vec4(0.0, 1.0, -4.8, 0.0); \n"
- " vec4 v1 = vec4(1.0, 0.0, 15.2, 0.0); \n"
- " gl_FragColor = mix(v0, v1, 0.25); \n"
- "} \n",
- { 0.25, 0.75, 0.2, 0.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
- {
- "mix(float) function",
- NO_VERTEX_SHADER,
- "void main() { \n"
- " float v0 = 0.0; \n"
- " float v1 = 1.0; \n"
- " gl_FragColor.x = mix(v0, v1, 0.25); \n"
- " v0 = 1.0; \n"
- " v1 = 0.0; \n"
- " gl_FragColor.y = mix(v0, v1, 0.25); \n"
- " v0 = -4.8; \n"
- " v1 = 15.2; \n"
- " gl_FragColor.z = mix(v0, v1, 0.25); \n"
- " v0 = 0.0; \n"
- " v1 = 0.0; \n"
- " gl_FragColor.w = mix(v0, v1, 0.25); \n"
- "} \n",
- { 0.25, 0.75, 0.2, 0.0 },
- DONT_CARE_Z,
- FLAG_NONE
- },
-
// Floating Point Precision ==========================================
{
"precision exp2",
--
1.8.3.2
More information about the Piglit
mailing list