X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fgenerate.cpp;h=f3c57a2f0f9190352860bc5f7bc22ff634433123;hp=69a8dfb16d1eb62cccfbbba342418c0868bff69a;hb=1fa69bb8eec3070f5da296d6dd0bd67aea62d3bf;hpb=a93a69e53263005709fa172845b01f81cd1c074c diff --git a/source/glsl/generate.cpp b/source/glsl/generate.cpp index 69a8dfb1..f3c57a2f 100644 --- a/source/glsl/generate.cpp +++ b/source/glsl/generate.cpp @@ -78,13 +78,12 @@ VariableResolver::VariableResolver(): self_referencing(false) { } -void VariableResolver::apply(Stage &s) +void VariableResolver::apply(Stage &stage) { - SetForScope set(stage, &s); - Stage *builtins = get_builtins(stage->type); + Stage *builtins = get_builtins(stage.type); if(builtins) blocks.push_back(&builtins->content); - stage->content.visit(*this); + visit(stage.content); if(builtins) blocks.pop_back(); } @@ -240,6 +239,7 @@ void FunctionResolver::visit(FunctionDeclaration &func) InterfaceGenerator::InterfaceGenerator(): + stage(0), scope_level(0) { } @@ -259,7 +259,7 @@ void InterfaceGenerator::apply(Stage &s) if(stage->previous) in_prefix = get_out_prefix(stage->previous->type); out_prefix = get_out_prefix(stage->type); - stage->content.visit(*this); + visit(s.content); } void InterfaceGenerator::visit(Block &block) @@ -471,7 +471,7 @@ void DeclarationReorderer::visit(Block &block) { SetForScope set(scope_level, scope_level+1); if(scope_level>1) - return StageVisitor::visit(block); + return TraversingVisitor::visit(block); NodeList::iterator struct_insert_point = block.body.end(); NodeList::iterator variable_insert_point = block.body.end(); @@ -547,7 +547,7 @@ void DeclarationReorderer::visit(Block &block) void DeclarationReorderer::visit(VariableDeclaration &var) { - StageVisitor::visit(var); + TraversingVisitor::visit(var); kind = VARIABLE; }