diff options
author | Dave Airlie <airlied@redhat.com> | 2014-08-25 04:43:42 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-08-25 04:43:42 +0100 |
commit | 7b4951b6fbbd1d4de36fa80533df5fa2e00fe591 (patch) | |
tree | 1aa29440f214aeb7d4566b32f6e1aa0ac20a787a | |
parent | 0aeec0c88c69ccaeb4151093629c10da282167a0 (diff) | |
parent | 526fa8908187ece7ee0df1feffe022ecef4c4f41 (diff) |
Merge branch 'fp64_builtin_tests' of git://people.freedesktop.org/~tpalli/piglitarb_gpu_shader_fp64_2
27 files changed, 553 insertions, 0 deletions
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-add-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-add-double.shader_test new file mode 100644 index 000000000..feef315fb --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-add-double.shader_test @@ -0,0 +1,22 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +uniform vec4 color; +void main() +{ + dvec4 dcolor = color; + dvec4 a = dvec4(0.5lf, 0.0lf, 0.0lf, 0.0lf); + dvec4 b = dvec4(-1.0lf, 0.0lf, 0.0lf, 0.0lf); + gl_FragColor = vec4((a + dcolor) + b); +} + +[test] +uniform vec4 color 0.5 1.0 0.0 0.0 +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-csel-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-csel-double.shader_test new file mode 100644 index 000000000..e8bf9f87a --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-csel-double.shader_test @@ -0,0 +1,20 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const double small = 1.0lf; + const double big = 2.0lf; + double val = (big > small) ? 1.0lf : 0.0lf; + gl_FragColor = vec4(val, 0.0, val, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 1.0 0 1.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-div-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-div-double.shader_test new file mode 100644 index 000000000..b6358eb07 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-div-double.shader_test @@ -0,0 +1,20 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +uniform vec4 color; +void main() +{ + dvec4 dcolor = color; + gl_FragColor = vec4(dvec4(1.0lf, 0.6lf, 1.0lf, 1.0lf) / dcolor); +} + +[test] +uniform vec4 color 2.0 3.0 4.0 1.0 +draw rect -1 -1 2 2 +probe all rgba 0.5 0.2 0.25 1.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-mul-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-mul-double.shader_test new file mode 100644 index 000000000..227bd9314 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-mul-double.shader_test @@ -0,0 +1,20 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +uniform vec4 color; +void main() +{ + dvec4 dcolor = color; + gl_FragColor = vec4(dvec4(0.5lf, 0.5lf, 0.5lf, 1.0lf) * dcolor); +} + +[test] +uniform vec4 color 1.0 1.0 1.0 0.0 +draw rect -1 -1 2 2 +probe all rgba 0.5 0.5 0.5 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-neg-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-neg-double.shader_test new file mode 100644 index 000000000..3dc6c1379 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-algebraic-neg-double.shader_test @@ -0,0 +1,20 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +uniform vec4 color; +void main() +{ + dvec4 dcolor = color; + gl_FragColor = vec4(-dcolor); +} + +[test] +uniform vec4 color 1.0 -1.0 0.0 0.0 +draw rect -1 -1 2 2 +probe rgb 1 1 0.0 1.0 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-abs.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-abs.shader_test new file mode 100644 index 000000000..fa47ead26 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-abs.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const double x = abs(-0.5lf); + const double y = abs(0.0lf); + const double z = abs(0.5lf); + gl_FragColor = vec4(x, y, z, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.5 0.0 0.5 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-ceil.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-ceil.shader_test new file mode 100644 index 000000000..e085f980e --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-ceil.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const double x = ceil(-0.5lf); + const double y = ceil(0.0lf); + const double z = ceil(0.5lf); + gl_FragColor = vec4(x, y, z, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.0 0.0 1.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-dot.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-dot.shader_test new file mode 100644 index 000000000..daaebf9df --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-dot.shader_test @@ -0,0 +1,24 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const dvec2 c1 = dvec2(2.0lf, 4.0lf); + const dvec2 c2 = dvec2(1.0lf, 5.0lf); + const double c = dot(c1, c2); + + if (c == 22.0) + gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0); + else + gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.0 1.0 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-equal.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-equal.shader_test new file mode 100644 index 000000000..539944004 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-equal.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() { + const dvec3 small = dvec3(1.0lf, 2.0lf, 3.0lf); + const dvec3 large = dvec3(0.5lf, 2.0lf, 6.0lf); + const bvec3 result = equal(large, small); + gl_FragColor = vec4(result, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.0 1.0 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-floor.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-floor.shader_test new file mode 100644 index 000000000..92497191a --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-floor.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const double x = floor(-0.5lf); + const double y = floor(0.0lf); + const double z = floor(0.5lf); + gl_FragColor = vec4(x + 1.7, y, z, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.7 0.0 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-fract.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-fract.shader_test new file mode 100644 index 000000000..e1b9951de --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-fract.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const double x = fract(1.7lf); + const double y = fract(6.0lf); + const double z = fract(-1.7lf); /* should be 0.3 */ + gl_FragColor = vec4(x, y, z, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.7 0.0 0.3 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-greaterThan.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-greaterThan.shader_test new file mode 100644 index 000000000..065aba6c3 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-greaterThan.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() { + const dvec3 small = dvec3(1.0lf, 2.0lf, 3.0lf); + const dvec3 large = dvec3(0.5lf, 2.0lf, 6.0lf); + const bvec3 result = greaterThan(large, small); + gl_FragColor = vec4(result, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.0 0.0 1.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-lessThan.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-lessThan.shader_test new file mode 100644 index 000000000..326780c4e --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-lessThan.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() { + const dvec3 small = dvec3(1.0lf, 2.0lf, 3.0lf); + const dvec3 large = dvec3(0.5lf, 2.0lf, 6.0lf); + const bvec3 result = lessThan(large, small); + gl_FragColor = vec4(result, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 1.0 0.0 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-lessThanEqual.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-lessThanEqual.shader_test new file mode 100644 index 000000000..832fef84a --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-lessThanEqual.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() { + const dvec3 small = dvec3(1.0lf, 2.0lf, 3.0lf); + const dvec3 large = dvec3(0.5lf, 2.0lf, 6.0lf); + const bvec3 result = lessThanEqual(large, small); + gl_FragColor = vec4(result, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 1.0 1.0 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-lrp.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-lrp.shader_test new file mode 100644 index 000000000..1fdcb962b --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-lrp.shader_test @@ -0,0 +1,20 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const dvec4 red = dvec4(1.0, 0.0, 0.0, 1.0); + const dvec4 blue = dvec4(0.0, 0.0, 1.0, 1.0); + const dvec4 mixer = dvec4(0.5); + gl_FragColor = vec4(mix(red, blue, mixer)); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.5 0.0 0.5 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-max.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-max.shader_test new file mode 100644 index 000000000..496c7b7d8 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-max.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const double x = max(0.25lf, -5.0lf); + const dvec2 v = max(vec2(0.5lf, 0.2lf), 0.25lf); + gl_FragColor = vec4(x, v, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.25 0.5 0.25 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-min.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-min.shader_test new file mode 100644 index 000000000..bfee42f4f --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-min.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const double x = min(0.25lf, 0.5lf); + const dvec2 v = min(dvec2(0.25lf, 0.7lf), 0.5lf); + gl_FragColor = vec4(x, v, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.25 0.25 0.5 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-mod.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-mod.shader_test new file mode 100644 index 000000000..3ad4fc2bb --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-mod.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const dvec2 v1 = mod(dvec2(-3.0lf, 43.5lf), dvec2(0.9lf, -4.0lf)); /* (-0.5, 0.6) */ + const dvec2 v2 = mod(dvec2(0.2lf, 6.0lf), 1.3lf); + gl_FragColor = vec4(v1.x + v1.y, v2, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.1 0.2 0.8 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-notEqual.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-notEqual.shader_test new file mode 100644 index 000000000..6fa4ea69c --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-notEqual.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() { + const dvec3 small = dvec3(1.0lf, 2.0lf, 3.0lf); + const dvec3 large = dvec3(0.5lf, 2.0lf, 6.0lf); + const bvec3 result = notEqual(large, small); + gl_FragColor = vec4(result, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 1.0 0.0 1.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-roundEven.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-roundEven.shader_test new file mode 100644 index 000000000..b7b8a2621 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-roundEven.shader_test @@ -0,0 +1,31 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + /* Divide by 10 to get a decimal part */ + double x = gl_FragCoord.x / 10.0lf; + + /* Divide by 25.0 to bring it into the [0, 1] range. */ + gl_FragColor = vec4(roundEven(x) / 25.0lf, -roundEven(-x) / 25.0lf, 0.0lf, 1.0lf); +} + +[test] +clear color 0.0 0.0 0.0 0.0 +clear +ortho +draw rect 0 0 250 250 +probe rgb 1 1 0.00 0.00 0 +probe rgb 14 14 0.04 0.04 0 +probe rgb 15 15 0.08 0.08 0 +probe rgb 16 16 0.08 0.08 0 +probe rgb 63 63 0.24 0.24 0 +probe rgb 124 124 0.48 0.48 0 +probe rgb 126 126 0.52 0.52 0 +probe rgb 249 249 1.00 1.00 0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-sign.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-sign.shader_test new file mode 100644 index 000000000..2ac10479d --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-sign.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const dvec3 signs = sign(dvec3(0.0lf, -42.9lf, 55.7lf)); + const float one = float(signs.x == signs.y + signs.z); + gl_FragColor = vec4(0.0, one, 0.0, one); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.0 1.0 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-sqrt.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-sqrt.shader_test new file mode 100644 index 000000000..7f124f2de --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-sqrt.shader_test @@ -0,0 +1,18 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const double one_half = sqrt(16.0lf) - 3.5; + gl_FragColor = vec4(0.0, one_half, 0.0, 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.0 0.5 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-trunc.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-trunc.shader_test new file mode 100644 index 000000000..92fd2210f --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-builtin-trunc.shader_test @@ -0,0 +1,27 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + /* Divide by 10 to get a decimal part */ + double x = gl_FragCoord.x / 10.0lf; + + /* Divide by 25.0 to bring it into the [0, 1] range. */ + gl_FragColor = vec4(trunc(x) / 25.0lf, -trunc(-x) / 25.0lf, 0.0lf, 1.0lf); +} + +[test] +clear color 0.0 0.0 0.0 0.0 +clear +ortho +draw rect 0 0 250 250 +probe rgb 1 1 0.00 0.00 0 +probe rgb 63 63 0.24 0.24 0 +probe rgb 125 125 0.48 0.48 0 +probe rgb 249 249 0.96 0.96 0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-expr-vector-extract.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-expr-vector-extract.shader_test new file mode 100644 index 000000000..fee131b83 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-expr-vector-extract.shader_test @@ -0,0 +1,21 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + const dvec4 a = dvec4(0.1, 0.0, 0.0, 1.0); + const dvec4 b = dvec4(0.0, 0.0, 0.2, 1.0); + const dvec4 c = dvec4(0.9, 1.0, 0.0, 1.0); + const dmat4 dm = dmat4(a, b, c, c); + gl_FragColor = vec4(dm[0][0], dm[1][2], dm[2][0], 1.0); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0.1 0.2 0.9 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-expr-vector-insert.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-expr-vector-insert.shader_test new file mode 100644 index 000000000..344da6151 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-const-expr-vector-insert.shader_test @@ -0,0 +1,19 @@ +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + dvec4 red = dvec4(0.1, 0.0, 0.0, 1.0); + red[0] = 1.0; + gl_FragColor = vec4(red); +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 1.0 0.0 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-conversion-constructor-01.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-conversion-constructor-01.shader_test new file mode 100644 index 000000000..d730a6ff1 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-conversion-constructor-01.shader_test @@ -0,0 +1,22 @@ +# +# Test that we can construct vec4 from 2nd column of dmat4 +# +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + double one = 1.0lf; + dmat4 mat = dmat4(one); + gl_FragColor = vec4(mat[1]); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-conversion-constructor-02.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-conversion-constructor-02.shader_test new file mode 100644 index 000000000..1e5925a67 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/glsl-double-conversion-constructor-02.shader_test @@ -0,0 +1,22 @@ +# +# Test that we can construct vec4 from dmat4 (1st column) +# +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader_fp64 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader_fp64 : enable +void main() +{ + double one = 1.0lf; + dmat4 mat = dmat4(one); + gl_FragColor = vec4(mat); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 1.0 0.0 0.0 0.0 |