]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix passthroughs being generated for non-output variables
authorMikko Rasa <tdb@tdb.fi>
Wed, 3 Mar 2021 15:10:03 +0000 (17:10 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 3 Mar 2021 16:50:12 +0000 (18:50 +0200)
source/glsl/generate.cpp

index 38eda220cee20533db6936e1b79d0831c01aefff..9adfb93d5cbfab11984c6bcf5f5a6a8315f6d494 100644 (file)
@@ -606,11 +606,10 @@ void InterfaceGenerator::visit(Passthrough &pass)
                const map<string, VariableDeclaration *> &prev_vars = stage->previous->content.variables;
                for(map<string, VariableDeclaration *>::const_iterator i=prev_vars.begin(); i!=prev_vars.end(); ++i)
                {
-                       bool linked = false;
-                       for(vector<VariableDeclaration *>::const_iterator j=pass_vars.begin(); (!linked && j!=pass_vars.end()); ++j)
-                               linked = ((*j)->linked_declaration==i->second);
+                       if(i->second->interface!="out")
+                               continue;
 
-                       if(!linked && generate_interface(*i->second, "in", i->second->name))
+                       if(!i->second->linked_declaration && generate_interface(*i->second, "in", i->second->name))
                                pass_vars.push_back(i->second);
                }
        }