[Mesa-dev] [PATCH 2.5/4] glsl: Reduce overhead in conditional discard optimization
Thomas Helland
thomashelland90 at gmail.com
Wed May 17 19:15:18 UTC 2017
Don't descend into assignments. This is the same optimization
that is already done in opt_if_simplification.
---
src/compiler/glsl/opt_conditional_discard.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/compiler/glsl/opt_conditional_discard.cpp b/src/compiler/glsl/opt_conditional_discard.cpp
index 6d8a23460d..d7cb2069ed 100644
--- a/src/compiler/glsl/opt_conditional_discard.cpp
+++ b/src/compiler/glsl/opt_conditional_discard.cpp
@@ -46,12 +46,23 @@ public:
}
ir_visitor_status visit_leave(ir_if *);
+ ir_visitor_status visit_enter(ir_assignment *);
bool progress;
};
} /* anonymous namespace */
+/* We only care about the top level "if" instructions, so don't
+ * descend into expressions.
+ */
+ir_visitor_status
+opt_conditional_discard_visitor::visit_enter(ir_assignment *ir)
+{
+ (void) ir;
+ return visit_continue_with_parent;
+}
+
bool
opt_conditional_discard(exec_list *instructions)
{
--
2.12.2
More information about the mesa-dev
mailing list