9 const char builtins_src[] =
10 "#pragma MSP stage(vertex)\n"
11 "out gl_PerVertex {\n"
12 " vec4 gl_Position;\n"
13 " float gl_ClipDistance[];\n"
15 "#pragma MSP stage(geometry)\n"
17 " vec4 gl_Position;\n"
18 " float gl_ClipDistance[];\n"
20 "out gl_PerVertex {\n"
21 " vec4 gl_Position;\n"
22 " float gl_ClipDistance[];\n"
31 Module *get_builtins_module()
33 static RefPtr<Module> builtins_module;
34 static bool initialized = false;
40 Module *module = new Module(parser.parse(builtins_src, "<builtin>"));
41 for(list<Stage>::iterator i=module->stages.begin(); i!=module->stages.end(); ++i)
43 VariableResolver().apply(*i);
44 for(map<string, VariableDeclaration *>::iterator j=i->content.variables.begin(); j!=i->content.variables.end(); ++j)
45 j->second->linked_declaration = j->second;
48 builtins_module = module;
50 return builtins_module.get();
53 Stage *get_builtins(Stage::Type type)
55 Module *module = get_builtins_module();
59 for(list<Stage>::iterator i=module->stages.begin(); i!=module->stages.end(); ++i)