]> git.tdb.fi Git - libs/gl.git/commitdiff
Reorder declarations right after injecting the shared scope
authorMikko Rasa <tdb@tdb.fi>
Sat, 10 Dec 2016 17:28:42 +0000 (19:28 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 10 Dec 2016 17:28:42 +0000 (19:28 +0200)
This is necesary for InterfaceGenerator to recognize additional inputs in
shaders that import a main function with passthrough in it.  Otherwise no
passthroughs would be generated and those inputs would be unusable in
later stages.

source/programcompiler.cpp

index 5f8c6f9b91f612c218992ff8553620803b1f269a..14c9d3d3ced42958e539e7ef27a6623f297e41cb 100644 (file)
@@ -160,6 +160,7 @@ void ProgramCompiler::generate(Stage &stage)
 {
        inject_block(stage.content, module->shared.content);
 
+       apply<DeclarationReorderer>(stage);
        apply<FunctionResolver>(stage);
        apply<VariableResolver>(stage);
        apply<InterfaceGenerator>(stage);