From 27cb20f9957d23666baf93eddfcb2b32e6435d9f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 10 Feb 2010 08:09:36 -0700 Subject: glsl1: additional GLSL preprocessor tests --- src/glean/tglsl1.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/src/glean/tglsl1.cpp b/src/glean/tglsl1.cpp index ffd9280..1e6b04e 100644 --- a/src/glean/tglsl1.cpp +++ b/src/glean/tglsl1.cpp @@ -3000,6 +3000,70 @@ static const ShaderProgram Programs[] = { FLAG_NONE }, + { + "Preprocessor test (8)", + NO_VERTEX_SHADER, + "#define FOO \n" + "void main() { \n" + "#ifdef FOO \n" + " gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0); \n" + "#else \n" + " gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0); \n" + "#endif \n" + "} \n", + { 0.0, 1.0, 0.0, 0.0 }, + DONT_CARE_Z, + FLAG_NONE + }, + + { + "Preprocessor test (9)", + NO_VERTEX_SHADER, + "#define FOO \n" + "void main() { \n" + "#ifndef FOO \n" + " gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0); \n" + "#else \n" + " gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0); \n" + "#endif \n" + "} \n", + { 1.0, 0.0, 0.0, 0.0 }, + DONT_CARE_Z, + FLAG_NONE + }, + + { + "Preprocessor test (10)", + NO_VERTEX_SHADER, + "#define FOO \n" + "void main() { \n" + "#if defined(FOO) \n" + " gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0); \n" + "#else \n" + " gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0); \n" + "#endif \n" + "} \n", + { 0.0, 1.0, 0.0, 0.0 }, + DONT_CARE_Z, + FLAG_NONE + }, + + { + "Preprocessor test (11)", + NO_VERTEX_SHADER, + "#define FOO \n" + "void main() { \n" + "#if !defined(FOO) \n" + " gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0); \n" + "#else \n" + " gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0); \n" + "#endif \n" + "} \n", + { 1.0, 0.0, 0.0, 0.0 }, + DONT_CARE_Z, + FLAG_NONE + }, + { "Comment test (1)", NO_VERTEX_SHADER, -- cgit v1.2.3