target = &*i;
}
- if(target->content.body.empty())
- {
- Stage *builtins = get_builtins(stage.type);
- if(builtins && builtins!=&stage)
- append_stage(*builtins);
- }
-
if(stage.required_features.glsl_version>target->required_features.glsl_version)
target->required_features.glsl_version = stage.required_features.glsl_version;
for(NodeList<Statement>::iterator i=stage.content.body.begin(); i!=stage.content.body.end(); ++i)
stage.required_features.gl_api = features.gl_api;
if(module->shared.required_features.glsl_version>stage.required_features.glsl_version)
stage.required_features.glsl_version = module->shared.required_features.glsl_version;
+
inject_block(stage.content, module->shared.content);
+ if(Stage *builtins = get_builtins(stage.type))
+ inject_block(stage.content, builtins->content);
+ if(Stage *builtins = get_builtins(Stage::SHARED))
+ inject_block(stage.content, builtins->content);
// Initial resolving pass
BlockHierarchyResolver().apply(stage);