aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/opt_dead_code_local.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-08-19 09:07:37 +0200
committermarha <marha@users.sourceforge.net>2013-08-19 09:07:37 +0200
commit2d042f719910c5aa1ba9f4a47b21009c729c345e (patch)
tree2b20d89d5f1ca342ca6f1d817c18b324adf7086f /mesalib/src/glsl/opt_dead_code_local.cpp
parentc3d3ea464f7f4e53e8fe3e11ecada36cb209ba4d (diff)
parent854ec4da20ddff9b830be0a7d5b81d8cb4774132 (diff)
downloadvcxsrv-2d042f719910c5aa1ba9f4a47b21009c729c345e.tar.gz
vcxsrv-2d042f719910c5aa1ba9f4a47b21009c729c345e.tar.bz2
vcxsrv-2d042f719910c5aa1ba9f4a47b21009c729c345e.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig libX11 libXdmcp libxcb xkeyboard-config mesa pixman xserver git update 19 aug 2013 Conflicts: fontconfig/src/fccache.c
Diffstat (limited to 'mesalib/src/glsl/opt_dead_code_local.cpp')
-rw-r--r--mesalib/src/glsl/opt_dead_code_local.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/mesalib/src/glsl/opt_dead_code_local.cpp b/mesalib/src/glsl/opt_dead_code_local.cpp
index 8c31802a6..42a30b3d8 100644
--- a/mesalib/src/glsl/opt_dead_code_local.cpp
+++ b/mesalib/src/glsl/opt_dead_code_local.cpp
@@ -114,6 +114,23 @@ public:
return visit_continue_with_parent;
}
+ virtual ir_visitor_status visit(ir_emit_vertex *ir)
+ {
+ /* For the purpose of dead code elimination, emitting a vertex counts as
+ * "reading" all of the currently assigned output variables.
+ */
+ foreach_iter(exec_list_iterator, iter, *this->assignments) {
+ assignment_entry *entry = (assignment_entry *)iter.get();
+ if (entry->lhs->mode == ir_var_shader_out) {
+ if (debug)
+ printf("kill %s\n", entry->lhs->name);
+ entry->remove();
+ }
+ }
+
+ return visit_continue;
+ }
+
private:
exec_list *assignments;
};