X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fbuiltin.cpp;h=b9fe487c7bb2f810360918167df628d05a5acbfb;hb=f901fcf41d8ca544085f448227f84bc6f966660d;hp=9e0244df1cbd71efe3acb6c915fdda33d8e7ea64;hpb=78f43047696fbb629e4bc9cfb1068e3fef77cb0a;p=libs%2Fgl.git diff --git a/source/glsl/builtin.cpp b/source/glsl/builtin.cpp index 9e0244df..b9fe487c 100644 --- a/source/glsl/builtin.cpp +++ b/source/glsl/builtin.cpp @@ -2,7 +2,6 @@ #include #include "builtin.h" #include "parser.h" -#include "visitor.h" using namespace std; @@ -29,8 +28,9 @@ Module *get_builtins_module() if(!io) return 0; - Parser parser; - Module *module = new Module(parser.parse(*io, "", BUILTIN_SOURCE)); + RefPtr module = new Module; + Parser parser(0); + parser.parse(*module, *io, "", BUILTIN_SOURCE); NodeList &shared_body = module->shared.content.body; NodeList::iterator insert_point = shared_body.begin(); @@ -55,6 +55,14 @@ Module *get_builtins_module() type->kind = BasicTypeDeclaration::INT; shared_body.insert(insert_point, type); + type = new BasicTypeDeclaration; + type->source = BUILTIN_SOURCE; + type->name = "uint"; + type->size = 32; + type->sign = false; + type->kind = BasicTypeDeclaration::INT; + shared_body.insert(insert_point, type); + type = new BasicTypeDeclaration; type->source = BUILTIN_SOURCE; type->name = "float"; @@ -66,7 +74,7 @@ Module *get_builtins_module() for(list::iterator i=module->stages.begin(); i!=module->stages.end(); ++i) populate_types(*i); - builtins_module = module; + builtins_module = module.release(); } return builtins_module.get(); }