X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fglsl%2Fcompiler.cpp;h=ca6c58057022b8b3a9f69373433c0f6c54a2e35d;hb=b30777959d8e2ab2caf489e32f40390f60a75fcb;hp=4a7a19e29759770966db8ae105c0967bdd5c4f9b;hpb=c0be4e4ae1a8b6ac31ff6b7080e2242c13d947ff;p=libs%2Fgl.git diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index 4a7a19e2..ca6c5805 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -3,6 +3,7 @@ #include #include "compatibility.h" #include "compiler.h" +#include "debug.h" #include "error.h" #include "generate.h" #include "optimize.h" @@ -132,6 +133,14 @@ const SourceMap &Compiler::get_source_map() const return module->source_map; } +string Compiler::get_stage_debug(Stage::Type stage_type) const +{ + for(list::iterator i=module->stages.begin(); i!=module->stages.end(); ++i) + if(i->type==stage_type) + return DumpTree().apply(*i); + throw key_error(Stage::get_stage_name(stage_type)); +} + void Compiler::append_module(Module &mod, DataFile::Collection *res) { module->source_map.merge_from(mod.source_map);