X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.cpp;h=4c8c1d03d893d277395b2f64b5def34aa7e55168;hb=77f6973f58167d94059d3f324c29ab2ca8de4544;hp=0e26a16353b46bf1ae73876fc08be92b20621b2d;hpb=0d5ff7918d50092d8cf2e1b8f7af1d7d29b6eb9b;p=libs%2Fgl.git diff --git a/source/glsl/compiler.cpp b/source/glsl/compiler.cpp index 0e26a163..4c8c1d03 100644 --- a/source/glsl/compiler.cpp +++ b/source/glsl/compiler.cpp @@ -93,6 +93,11 @@ void Compiler::compile(Mode mode) for(Stage &s: module->stages) ConstantSpecializer().apply(s, spec_values); } + if(mode==PROGRAM) + { + for(Stage &s: module->stages) + DepthRangeConverter().apply(s, features); + } for(auto i=module->stages.begin(); i!=module->stages.end(); ) { OptimizeResult result = optimize(*i); @@ -209,11 +214,11 @@ const SourceMap &Compiler::get_source_map() const return module->source_map; } -string Compiler::get_stage_debug(Stage::Type stage_type) const +string Compiler::get_stage_debug(Stage::Type stage_type, bool use_colors) const { auto i = find_member(module->stages, stage_type, &Stage::type); if(i!=module->stages.end()) - return DumpTree().apply(*i); + return DumpTree(use_colors).apply(*i); throw key_error(Stage::get_stage_name(stage_type)); } @@ -299,6 +304,9 @@ void Compiler::generate(Stage &stage) variables through interfaces. */ InterfaceGenerator().apply(stage); resolve(stage, RESOLVE_BLOCKS|RESOLVE_TYPES|RESOLVE_VARIABLES); + + ArraySizer().apply(stage); + resolve(stage, RESOLVE_EXPRESSIONS); } template