summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-11-17 21:55:38 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-24 16:34:41 +0000
commit63e2bb2f36f4d51bc6223ed22da6aac1766868a4 (patch)
treea262c722036323b50efe0f8f6b73ce64a19e638d
parent3d5b40fa763acb7c1564f9b4d0785f582210927b (diff)
downloadexternal_mesa3d-63e2bb2f36f4d51bc6223ed22da6aac1766868a4.zip
external_mesa3d-63e2bb2f36f4d51bc6223ed22da6aac1766868a4.tar.gz
external_mesa3d-63e2bb2f36f4d51bc6223ed22da6aac1766868a4.tar.bz2
glsl/lower_output_reads: fix geometry shader output handling with conditional emit
Consider a geometry shader that contains code like this: some_out = expr; if (cond) { ... EmitVertex(); } else { ... EmitVertex(); } Both branches should see the correct value of some_out. Since this is a rather subtle and rare case, I'm submitting a piglit test for this as well. GLSL says that the values of output variables are undefined after EmitVertex(). With this change, the values will now be defined and unmodified. This may reduce optimization opportunities in the probably quite rare case where subsequent compiler passes cannot prove that the value of the output variable is overwritten. Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit 0d383a79a8f13bb00ed5e5d84f41071b43c7e92d)
-rw-r--r--src/compiler/glsl/lower_output_reads.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/compiler/glsl/lower_output_reads.cpp b/src/compiler/glsl/lower_output_reads.cpp
index 732f4d3..8a375ac 100644
--- a/src/compiler/glsl/lower_output_reads.cpp
+++ b/src/compiler/glsl/lower_output_reads.cpp
@@ -157,7 +157,6 @@ ir_visitor_status
output_read_remover::visit_leave(ir_emit_vertex *ir)
{
hash_table_call_foreach(replacements, emit_return_copy, ir);
- _mesa_hash_table_clear(replacements, NULL);
return visit_continue;
}