[Mesa-dev] [PATCH] glsl: Avoid delaying output write when there is no output read

Vincent Lejeune vljn at ovi.com
Thu Feb 23 06:46:55 PST 2012


This fix bug #46004
---
 src/glsl/lower_output_reads.cpp |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/glsl/lower_output_reads.cpp b/src/glsl/lower_output_reads.cpp
index 415b541..119d45a 100644
--- a/src/glsl/lower_output_reads.cpp
+++ b/src/glsl/lower_output_reads.cpp
@@ -52,6 +52,7 @@ public:
    virtual ir_visitor_status visit(class ir_dereference_variable *);
    virtual ir_visitor_status visit_leave(class ir_return *);
    virtual ir_visitor_status visit_leave(class ir_function_signature *);
+   virtual ir_visitor_status visit_enter(ir_assignment *ir);
 };
 
 output_read_remover::output_read_remover()
@@ -68,6 +69,13 @@ output_read_remover::~output_read_remover()
 }
 
 ir_visitor_status
+output_read_remover::visit_enter(ir_assignment *ir)
+{
+   ir->rhs->accept(this);
+   return visit_continue_with_parent;
+}
+
+ir_visitor_status
 output_read_remover::visit(ir_dereference_variable *ir)
 {
    if (ir->var->mode != ir_var_out)
-- 
1.7.7



More information about the mesa-dev mailing list