draw/gs: make sure geometry shaders don't overflow
[mesa.git] / src / glsl / lower_if_to_cond_assign.cpp
index 94b24db1b29adaa2c0cea25307c3d41ac9f1f070..2c5d5612d0d805783ef8ad895c9ba0b80cebfb6b 100644 (file)
@@ -79,6 +79,9 @@ public:
 bool
 lower_if_to_cond_assign(exec_list *instructions, unsigned max_depth)
 {
+   if (max_depth == UINT_MAX)
+      return false;
+
    ir_if_to_cond_assign_visitor v(max_depth);
 
    visit_list_elements(&v, instructions);
@@ -169,7 +172,6 @@ ir_if_to_cond_assign_visitor::visit_leave(ir_if *ir)
 
    bool found_control_flow = false;
    ir_assignment *assign;
-   ir_dereference_variable *deref;
 
    /* Check that both blocks don't contain anything we can't support. */
    foreach_iter(exec_list_iterator, then_iter, ir->then_instructions) {