summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_hv_accept.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-07-01 10:09:58 -0700
committerEric Anholt <[email protected]>2010-07-01 11:07:23 -0700
commit8a1f186cc55979bb9df0a88b48da8d81460c3e7c (patch)
tree7a39126f77b75f94c09f441fdbca6c2be57d34cb /src/glsl/ir_hv_accept.cpp
parent9acf618f24428eba72650c0e328e7ed52986728e (diff)
glsl2: Add a pass to convert mod(a, b) to b * fract(a/b).
This is used by the Mesa IR backend to implement mod, fixing glsl-fs-mod.
Diffstat (limited to 'src/glsl/ir_hv_accept.cpp')
-rw-r--r--src/glsl/ir_hv_accept.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/glsl/ir_hv_accept.cpp b/src/glsl/ir_hv_accept.cpp
index 7b5cc5234c5..e772018a458 100644
--- a/src/glsl/ir_hv_accept.cpp
+++ b/src/glsl/ir_hv_accept.cpp
@@ -37,20 +37,23 @@
* from list. However, if nodes are added to the list after the node being
* processed, some of the added noded may not be processed.
*/
-static ir_visitor_status
+ir_visitor_status
visit_list_elements(ir_hierarchical_visitor *v, exec_list *l)
{
exec_node *next;
+ ir_instruction *prev_base_ir = v->base_ir;
for (exec_node *n = l->head; n->next != NULL; n = next) {
next = n->next;
ir_instruction *const ir = (ir_instruction *) n;
+ v->base_ir = ir;
ir_visitor_status s = ir->accept(v);
if (s != visit_continue)
return s;
}
+ v->base_ir = prev_base_ir;
return visit_continue;
}