[Piglit] [PATCH] glsl-es-3.00: Verify various UTF-8 clarifications from Khronos
Ian Romanick
idr at freedesktop.org
Wed Dec 2 08:42:37 PST 2015
From: Ian Romanick <ian.d.romanick at intel.com>
Further discussion in Khronos has determined that UTF-8 in unused
preprocessor defines as well.
See Khronos internal bug #14939.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
.../glsl-es-3.00/compiler/utf8-unused-define.vert | 26 +++++++++++++++++++++
.../glsl-es-3.00/compiler/utf8-used-define.vert | 27 ++++++++++++++++++++++
2 files changed, 53 insertions(+)
create mode 100644 tests/spec/glsl-es-3.00/compiler/utf8-unused-define.vert
create mode 100644 tests/spec/glsl-es-3.00/compiler/utf8-used-define.vert
diff --git a/tests/spec/glsl-es-3.00/compiler/utf8-unused-define.vert b/tests/spec/glsl-es-3.00/compiler/utf8-unused-define.vert
new file mode 100644
index 0000000..69cde74
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/utf8-unused-define.vert
@@ -0,0 +1,26 @@
+#version 300 es
+
+/* [config]
+ * expect_result: pass
+ * glsl_version: 3.00
+ * [end config]
+ *
+ * Page 8 (page 14 of the PDF) of the OpenGL ES Shading Language 3.00 spec
+ * says:
+ *
+ * "Inside comments, the character set is extended to allow any byte
+ * values to be used but with the exception that a byte with the value
+ * zero is always interpreted as the end of the string. The character
+ * encoding is assumed to be UTF-8 but no checking is performed for
+ * invalid characters."
+ *
+ * Further discussion in Khronos has determined that UTF-8 in unused
+ * preprocessor defines as well.
+ */
+
+#define eat_sushi_using_chopsticks 寿司使用して箸を食べます。
+
+void main()
+{
+ gl_Position = vec4(0);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/utf8-used-define.vert b/tests/spec/glsl-es-3.00/compiler/utf8-used-define.vert
new file mode 100644
index 0000000..7bc04e6
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/utf8-used-define.vert
@@ -0,0 +1,27 @@
+#version 300 es
+
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.00
+ * [end config]
+ *
+ * Page 8 (page 14 of the PDF) of the OpenGL ES Shading Language 3.00 spec
+ * says:
+ *
+ * "Inside comments, the character set is extended to allow any byte
+ * values to be used but with the exception that a byte with the value
+ * zero is always interpreted as the end of the string. The character
+ * encoding is assumed to be UTF-8 but no checking is performed for
+ * invalid characters."
+ *
+ * Further discussion in Khronos has determined that UTF-8 in unused
+ * preprocessor defines as well.
+ */
+
+#define eat_sushi_using_chopsticks 寿司使用して箸を食べます
+
+void main()
+{
+ float eat_sushi_using_chopsticks = 0;
+ gl_Position = vec4(eat_sushi_using_chopsticks);
+}
--
2.5.0
More information about the Piglit
mailing list