From fcec789963b25a49a187e2df248d80e1287ebc44 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 24 Feb 2021 00:03:31 +0200 Subject: [PATCH] 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. --- source/glsl/generate.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.45.2