]> git.tdb.fi Git - libs/gl.git/commitdiff
Rename and rearrange a few things
authorMikko Rasa <tdb@tdb.fi>
Tue, 9 Mar 2021 17:27:58 +0000 (19:27 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 9 Mar 2021 20:26:19 +0000 (22:26 +0200)
source/glsl/debug.cpp
source/glsl/generate.cpp
source/glsl/optimize.cpp

index dd9db2f8ff760bdd92cd8e37fa24baa8141ee865..68615ed6e06d67c7491a2e88ce10bce360b1685d 100644 (file)
@@ -366,28 +366,28 @@ void DumpTree::visit(VariableDeclaration &var)
        append_subtree(branches);
 }
 
        append_subtree(branches);
 }
 
-void DumpTree::visit(InterfaceBlock &block)
+void DumpTree::visit(InterfaceBlock &iface)
 {
        string head;
 {
        string head;
-       if(!block.instance_name.empty())
-               head += format("%%%d ", get_label(block));
-       head += format("%s %s", block.interface, block.name);
-       if(!block.instance_name.empty())
-               head += format(" %s", block.instance_name);
-       if(block.array)
+       if(!iface.instance_name.empty())
+               head += format("%%%d ", get_label(iface));
+       head += format("%s %s", iface.interface, iface.name);
+       if(!iface.instance_name.empty())
+               head += format(" %s", iface.instance_name);
+       if(iface.array)
                head += "[]";
                head += "[]";
-       if(block.source==BUILTIN_SOURCE)
+       if(iface.source==BUILTIN_SOURCE)
                head += " (builtin)";
                head += " (builtin)";
-       else if(block.linked_block)
+       else if(iface.linked_block)
                head += " (linked)";
        append(head);
 
        begin_sub();
        last_branch();
                head += " (linked)";
        append(head);
 
        begin_sub();
        last_branch();
-       if(block.type_declaration)
-               append(format("Type: %%%d %s", get_label(*block.type_declaration), block.type_declaration->name));
-       else if(block.members)
-               block.members->visit(*this);
+       if(iface.type_declaration)
+               append(format("Type: %%%d %s", get_label(*iface.type_declaration), iface.type_declaration->name));
+       else if(iface.members)
+               iface.members->visit(*this);
        end_sub();
 }
 
        end_sub();
 }
 
index 29d52364c1506f1dc151aad780c584dc13b0eab6..09a776afb7f60bb61d2bdc47d0a8f3fb9e470b3e 100644 (file)
@@ -591,11 +591,11 @@ void ExpressionResolver::convert_to(RefPtr<Expression> &expr, BasicTypeDeclarati
 
 bool ExpressionResolver::convert_to_element(RefPtr<Expression> &expr, BasicTypeDeclaration &elem_type)
 {
 
 bool ExpressionResolver::convert_to_element(RefPtr<Expression> &expr, BasicTypeDeclaration &elem_type)
 {
-       if(BasicTypeDeclaration *expr_type = dynamic_cast<BasicTypeDeclaration *>(expr->type))
+       if(BasicTypeDeclaration *expr_basic = dynamic_cast<BasicTypeDeclaration *>(expr->type))
        {
                BasicTypeDeclaration *to_type = &elem_type;
        {
                BasicTypeDeclaration *to_type = &elem_type;
-               if(is_vector_or_matrix(*expr_type))
-                       to_type = find_type(elem_type, expr_type->kind, expr_type->size);
+               if(is_vector_or_matrix(*expr_basic))
+                       to_type = find_type(elem_type, expr_basic->kind, expr_basic->size);
                if(to_type)
                {
                        convert_to(expr, *to_type);
                if(to_type)
                {
                        convert_to(expr, *to_type);
index be6cf7b6e456257bb8b46c6fc27f3781189eb1b2..7f60e67cc9c4ff58bfd46d452d407106b30d2315 100644 (file)
@@ -558,15 +558,6 @@ void ConstantConditionEliminator::visit(Iteration &iter)
 }
 
 
 }
 
 
-UnusedVariableRemover::VariableInfo::VariableInfo():
-       local(false),
-       output(false),
-       conditionally_assigned(false),
-       referenced(false),
-       interface_block(0)
-{ }
-
-
 bool UnusedTypeRemover::apply(Stage &stage)
 {
        stage.content.visit(*this);
 bool UnusedTypeRemover::apply(Stage &stage)
 {
        stage.content.visit(*this);
@@ -634,6 +625,15 @@ void UnusedTypeRemover::visit(FunctionDeclaration &func)
 }
 
 
 }
 
 
+UnusedVariableRemover::VariableInfo::VariableInfo():
+       local(false),
+       output(false),
+       conditionally_assigned(false),
+       referenced(false),
+       interface_block(0)
+{ }
+
+
 UnusedVariableRemover::UnusedVariableRemover():
        stage(0),
        interface_block(0),
 UnusedVariableRemover::UnusedVariableRemover():
        stage(0),
        interface_block(0),