[Piglit] [PATCH] GLSL ES: Verify that fragment shaders have no default float precision.
Paul Berry
stereotype441 at gmail.com
Thu Feb 14 11:23:27 PST 2013
Tested on the nVidia proprietary driver for Linux.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60737
---
.../no-default-float-precision.frag | 21 +++++++++++++++++++++
.../compiler/no-default-float-precision.frag | 21 +++++++++++++++++++++
2 files changed, 42 insertions(+)
create mode 100644 tests/spec/glsl-1.00/compiler/precision-qualifiers/no-default-float-precision.frag
create mode 100644 tests/spec/glsl-es-3.00/compiler/no-default-float-precision.frag
diff --git a/tests/spec/glsl-1.00/compiler/precision-qualifiers/no-default-float-precision.frag b/tests/spec/glsl-1.00/compiler/precision-qualifiers/no-default-float-precision.frag
new file mode 100644
index 0000000..1d8890c
--- /dev/null
+++ b/tests/spec/glsl-1.00/compiler/precision-qualifiers/no-default-float-precision.frag
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.00
+// check_link: true
+// [end config]
+//
+// From section 4.5.3 ("Default Precision Qualifiers") of the GLSL ES
+// 1.00 spec:
+//
+// "The fragment language has no default precision qualifier for
+// floating point types. Hence for float, floating point vector
+// and matrix variable declarations, either the declaration must
+// include a precision qualifier or the default float precision
+// must have been previously declared."
+
+#version 100
+
+void main()
+{
+ float f = 1.0;
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/no-default-float-precision.frag b/tests/spec/glsl-es-3.00/compiler/no-default-float-precision.frag
new file mode 100644
index 0000000..ebfa325
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/no-default-float-precision.frag
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.00
+// check_link: true
+// [end config]
+//
+// From section 4.5.4 ("Default Precision Qualifiers") of the GLSL ES
+// 3.00 spec:
+//
+// "The fragment language has no default precision qualifier for
+// floating point types. Hence for float, floating point vector
+// and matrix variable declarations, either the declaration must
+// include a precision qualifier or the default float precision
+// must have been previously declared."
+
+#version 300 es
+
+void main()
+{
+ float f = 1.0;
+}
--
1.8.1.3
More information about the Piglit
mailing list