glsl: a shader storage buffer must be smaller than the maximum size allowed
[mesa.git] / src / glsl / lower_discard.cpp
index cafd2dd3b44defdeb46a5c75b97f6db0473b147a..b44d2a6d28da0cf3248fc8393210d6ee88dbb653 100644 (file)
 #include "glsl_types.h"
 #include "ir.h"
 
+namespace {
+
 class lower_discard_visitor : public ir_hierarchical_visitor {
 public:
    lower_discard_visitor()
@@ -120,6 +122,7 @@ public:
    bool progress;
 };
 
+} /* anonymous namespace */
 
 bool
 lower_discard(exec_list *instructions)
@@ -135,8 +138,8 @@ lower_discard(exec_list *instructions)
 static ir_discard *
 find_discard(exec_list &instructions)
 {
-   foreach_list(n, &instructions) {
-      ir_discard *ir = ((ir_instruction *) n)->as_discard();
+   foreach_in_list(ir_instruction, node, &instructions) {
+      ir_discard *ir = node->as_discard();
       if (ir != NULL)
         return ir;
    }