diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-12-31 07:12:27 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-12-31 07:12:27 +0000 |
commit | 051645c92924bf915d82bf219f2ed67309b5577a (patch) | |
tree | 4aae126dd8e5a18c6a9926a5468d1561e6038a07 /lib/mesa/src/compiler/glsl/lower_output_reads.cpp | |
parent | 2dae6fe6f74cf7fb9fd65285302c0331d9786b00 (diff) |
Merge Mesa 17.2.8
Diffstat (limited to 'lib/mesa/src/compiler/glsl/lower_output_reads.cpp')
-rw-r--r-- | lib/mesa/src/compiler/glsl/lower_output_reads.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/mesa/src/compiler/glsl/lower_output_reads.cpp b/lib/mesa/src/compiler/glsl/lower_output_reads.cpp index 8a375ac0a..bd3accb3d 100644 --- a/lib/mesa/src/compiler/glsl/lower_output_reads.cpp +++ b/lib/mesa/src/compiler/glsl/lower_output_reads.cpp @@ -47,8 +47,6 @@ protected: */ hash_table *replacements; - void *mem_ctx; - unsigned stage; public: output_read_remover(unsigned stage); @@ -80,7 +78,6 @@ hash_table_var_hash(const void *key) output_read_remover::output_read_remover(unsigned stage) { this->stage = stage; - mem_ctx = ralloc_context(NULL); replacements = _mesa_hash_table_create(NULL, hash_table_var_hash, _mesa_key_pointer_equal); } @@ -88,15 +85,12 @@ output_read_remover::output_read_remover(unsigned stage) output_read_remover::~output_read_remover() { _mesa_hash_table_destroy(replacements, NULL); - ralloc_free(mem_ctx); } ir_visitor_status output_read_remover::visit(ir_dereference_variable *ir) { - if (ir->var->data.mode != ir_var_shader_out) - return visit_continue; - if (stage == MESA_SHADER_TESS_CTRL) + if (ir->var->data.mode != ir_var_shader_out || ir->var->data.fb_fetch_output) return visit_continue; hash_entry *entry = _mesa_hash_table_search(replacements, ir->var); @@ -173,6 +167,12 @@ output_read_remover::visit_leave(ir_function_signature *sig) void lower_output_reads(unsigned stage, exec_list *instructions) { + /* Due to the possible interactions between multiple tessellation control + * shader invocations, we leave output variables as-is. + */ + if (stage == MESA_SHADER_TESS_CTRL) + return; + output_read_remover v(stage); visit_list_elements(&v, instructions); } |