From: Mikko Rasa Date: Tue, 23 Feb 2021 22:03:31 +0000 (+0200) Subject: Avoid incorrectly matching interfaces in certain cases X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=fcec789963b25a49a187e2df248d80e1287ebc44;p=libs%2Fgl.git Avoid incorrectly matching interfaces in certain cases I removed this in ab5f2e6, thinking it was unnecessary. But if a stage declares a local output variable of the same name as an output variable in the previous stage, this is needed to avoid a mismatch. --- diff --git a/source/glsl/generate.cpp b/source/glsl/generate.cpp index ca4d41e6..952f1f0b 100644 --- a/source/glsl/generate.cpp +++ b/source/glsl/generate.cpp @@ -358,6 +358,10 @@ void InterfaceGenerator::visit(VariableReference &var) { if(var.declaration || !stage->previous) return; + /* Don't pull a variable from previous stage if we just generated an out + interface in this stage */ + if(stage->out_variables.count(var.name)) + return; const map &prev_out = stage->previous->out_variables; map::const_iterator i = prev_out.find(var.name);