summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-01-28 15:47:00 -0700
committerBrian Paul <brianp@vmware.com>2010-01-28 15:47:24 -0700
commita8c1616d47cdef46c3031edfb769a9155bc44b5c (patch)
treee8c228526ec4a5f0662e30773fdeb80c25ac8c5e
parent64d5acce575ccee99f73efad7dbd5d5671a3047e (diff)
glsl1: added some comment parsing tests
-rw-r--r--src/glean/tglsl1.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/glean/tglsl1.cpp b/src/glean/tglsl1.cpp
index 1f2f73c..1a9e803 100644
--- a/src/glean/tglsl1.cpp
+++ b/src/glean/tglsl1.cpp
@@ -2946,6 +2946,70 @@ static const ShaderProgram Programs[] = {
FLAG_NONE
},
+ {
+ "Comment test (1)",
+ NO_VERTEX_SHADER,
+ "/* this is\n"
+ "a multi-line\n"
+ "comment*/\n"
+ "void main() { \n"
+ " gl_FragColor = vec4(0.5); \n"
+ "} \n",
+ { 0.5, 0.5, 0.5, 0.5 },
+ DONT_CARE_Z,
+ FLAG_NONE
+ },
+
+ {
+ "Comment test (2)",
+ NO_VERTEX_SHADER,
+ "// another comment test\n"
+ "void main() { \n"
+ " gl_FragColor = vec4(0.5); //comment \n"
+ "} \n",
+ { 0.5, 0.5, 0.5, 0.5 },
+ DONT_CARE_Z,
+ FLAG_NONE
+ },
+
+ {
+ "Comment test (3)",
+ NO_VERTEX_SHADER,
+ "#define HALF 0.5 // half\n"
+ "void main() { \n"
+ " gl_FragColor = vec4(HALF); \n"
+ "} \n",
+ { 0.5, 0.5, 0.5, 0.5 },
+ DONT_CARE_Z,
+ FLAG_NONE
+ },
+
+ {
+ "Comment test (4)",
+ NO_VERTEX_SHADER,
+ "#define HALF 0.5 /* half */\n"
+ "void main() { \n"
+ " gl_FragColor = vec4(HALF); \n"
+ "} \n",
+ { 0.5, 0.5, 0.5, 0.5 },
+ DONT_CARE_Z,
+ FLAG_NONE
+ },
+
+ {
+ "Comment test (5)",
+ NO_VERTEX_SHADER,
+ "void main() { \n"
+ "/*}*/\n"
+ " gl_FragColor = /*;*/ vec4(0.5); \n"
+ "/*}*/\n"
+ "} \n",
+ { 0.5, 0.5, 0.5, 0.5 },
+ DONT_CARE_Z,
+ FLAG_NONE
+ },
+
+
// Illegal shaders ==================================================
{
"undefined variable",