summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndres Gomez <agomez@igalia.com>2016-02-25 12:44:48 +0200
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>2016-02-25 13:08:29 +0100
commit0393d5eac42e70982c0cf41b787224cdfb13c916 (patch)
treed089876c6352be08600443eae1db8259ebab681a /tests
parentafc4a93b93bc62dfc4e041c72d88d7a5139c8e2f (diff)
arb_gpu_shader_fp64: Explicit conversion from double to float
Double and float derived types also need explicit conversions. Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/spec/arb_gpu_shader_fp64/compiler/double-loop-iterator.vert4
-rw-r--r--tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert30
-rw-r--r--tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-double-float-bad.vert20
-rw-r--r--tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec2-vec2-bad.vert20
-rw-r--r--tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec3-vec3-bad.vert20
-rw-r--r--tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec4-vec4-bad.vert20
-rw-r--r--tests/spec/arb_vertex_attrib_64bit/execution/check-explicit-location.c2
7 files changed, 83 insertions, 33 deletions
diff --git a/tests/spec/arb_gpu_shader_fp64/compiler/double-loop-iterator.vert b/tests/spec/arb_gpu_shader_fp64/compiler/double-loop-iterator.vert
index 7756c8bf4..9c691f03e 100644
--- a/tests/spec/arb_gpu_shader_fp64/compiler/double-loop-iterator.vert
+++ b/tests/spec/arb_gpu_shader_fp64/compiler/double-loop-iterator.vert
@@ -12,11 +12,11 @@
void test() {
double k;
- vec4 vertex;
+ dvec4 vertex;
for (k = 0.0lf; k < 1.0lf; k += 0.1lf) {
vertex.x += k;
}
- gl_Position = vertex;
+ gl_Position = vec4(vertex);
}
diff --git a/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert
deleted file mode 100644
index 95b85c80b..000000000
--- a/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert
+++ /dev/null
@@ -1,30 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.50
-// require_extensions: GL_ARB_gpu_shader_fp64
-// [end config]
-//
-// Test double -> float implicit conversion doesn't happen
-// this tests a bug in mesa
-
-#version 150
-#extension GL_ARB_gpu_shader_fp64 : enable
-
-float _float = 0.0f;
-vec2 _vec2 = vec2(0.0f);
-vec3 _vec3 = vec3(0.0f);
-vec4 _vec4 = vec4(0.0f);
-
-double _double = 0.0lf;
-dvec2 _dvec2 = dvec2(0.0lf);
-dvec3 _dvec3 = dvec3(0.0lf);
-dvec4 _dvec4 = dvec4(0.0lf);
-
-void test() {
-
- /* int can be converted to double (and for vectors of same) */
- _float = _double;
- _vec2 = _dvec2;
- _vec3 = _dvec3;
- _vec4 = _dvec4;
-}
diff --git a/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-double-float-bad.vert b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-double-float-bad.vert
new file mode 100644
index 000000000..3e2b15a59
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-double-float-bad.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader_fp64
+// [end config]
+//
+// Test double -> float implicit conversion doesn't happen
+
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+float _float = 0.0f;
+
+double _double = 0.0lf;
+
+void test() {
+
+ /* double cannot be converted to float (and for vectors of same) */
+ _float = _double;
+}
diff --git a/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec2-vec2-bad.vert b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec2-vec2-bad.vert
new file mode 100644
index 000000000..225636d41
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec2-vec2-bad.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader_fp64
+// [end config]
+//
+// Test double -> float implicit conversion doesn't happen
+
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+vec2 _vec2 = vec2(0.0f);
+
+dvec2 _dvec2 = dvec2(0.0lf);
+
+void test() {
+
+ /* double cannot be converted to float (and for vectors of same) */
+ _vec2 = _dvec2;
+}
diff --git a/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec3-vec3-bad.vert b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec3-vec3-bad.vert
new file mode 100644
index 000000000..cf8583ebb
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec3-vec3-bad.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader_fp64
+// [end config]
+//
+// Test double -> float implicit conversion doesn't happen
+
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+vec3 _vec3 = vec3(0.0f);
+
+dvec3 _dvec3 = dvec3(0.0lf);
+
+void test() {
+
+ /* double cannot be converted to float (and for vectors of same) */
+ _vec3 = _dvec3;
+}
diff --git a/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec4-vec4-bad.vert b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec4-vec4-bad.vert
new file mode 100644
index 000000000..dd394e5f1
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-dvec4-vec4-bad.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader_fp64
+// [end config]
+//
+// Test double -> float implicit conversion doesn't happen
+
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+vec4 _vec4 = vec4(0.0f);
+
+dvec4 _dvec4 = dvec4(0.0lf);
+
+void test() {
+
+ /* double cannot be converted to float (and for vectors of same) */
+ _vec4 = _dvec4;
+}
diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/check-explicit-location.c b/tests/spec/arb_vertex_attrib_64bit/execution/check-explicit-location.c
index 599ac8abb..509f60bc3 100644
--- a/tests/spec/arb_vertex_attrib_64bit/execution/check-explicit-location.c
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/check-explicit-location.c
@@ -50,7 +50,7 @@ const char *vs_text =
"flat out dvec4 fscolor;\n"
"void main()\n"
"{\n"
- "gl_Position = vertex;\n"
+ "gl_Position = vec4(vertex);\n"
"fscolor = vcolor;\n"
"}\n";