Commit b40a6d6b by Thomas Perl

Use version/profile from first compilation stage

When linking multiple compilation units per shader stage, the code creates a new intermediate, but fails to set its version and profile. This change makes it so that the new intermediate inherits the version and profile of the first compilation unit, so that two ES SL compilation units can be combined.
parent 63d4794e
......@@ -1530,10 +1530,13 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
// Be efficient for the common single compilation unit per stage case,
// reusing it's TIntermediate instead of merging into a new one.
//
TIntermediate *firstIntermediate = stages[stage].front()->intermediate;
if (stages[stage].size() == 1)
intermediate[stage] = stages[stage].front()->intermediate;
intermediate[stage] = firstIntermediate;
else {
intermediate[stage] = new TIntermediate(stage);
intermediate[stage] = new TIntermediate(stage,
firstIntermediate->getVersion(),
firstIntermediate->getProfile());
newedIntermediate[stage] = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment