glsl: Fix up some comments in structure splitting, based on array-split work.
authorEric Anholt <eric@anholt.net>
Mon, 16 Apr 2012 16:52:45 +0000 (09:52 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 19 Apr 2012 23:33:28 +0000 (16:33 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/opt_structure_splitting.cpp

index 2c1f6bb..6dd228e 100644 (file)
@@ -61,7 +61,11 @@ public:
    /** Number of times the variable is referenced, including assignments. */
    unsigned whole_structure_access;
 
-   bool declaration; /* If the variable had a decl in the instruction stream */
+   /* If the variable had a decl we can work with in the instruction
+    * stream.  We can't do splitting on function arguments, which
+    * don't get this variable set.
+    */
+   bool declaration;
 
    ir_variable **components;
 
@@ -171,8 +175,9 @@ ir_structure_reference_visitor::visit_enter(ir_assignment *ir)
 ir_visitor_status
 ir_structure_reference_visitor::visit_enter(ir_function_signature *ir)
 {
-   /* We don't want to descend into the function parameters and
-    * dead-code eliminate them, so just accept the body here.
+   /* We don't have logic for structure-splitting function arguments,
+    * so just look at the body instructions and not the parameter
+    * declarations.
     */
    visit_list_elements(this, &ir->body);
    return visit_continue_with_parent;