From cb346e228aeb500cd61ec86644c034c238332d3b Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 8 Sep 2014 23:27:52 +0200 Subject: xkeyboard-config mesa git update 8 Sep 2014 xkeyboard-config commit 1b9901151cdb22e413319e6fca80fbbfc5e51502 mesa commit 12fb74fe895fe9954df127ca0ec6e4422fffb156 --- mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp | 2 +- mesalib/src/glsl/opt_copy_propagation_elements.cpp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'mesalib/src/glsl') diff --git a/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp b/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp index 7c5d80f43..d878cb078 100644 --- a/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp +++ b/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp @@ -76,7 +76,7 @@ compare_index_block(exec_list *instructions, ir_variable *index, ir_rvalue *broadcast_index = new(mem_ctx) ir_dereference_variable(index); assert(index->type->is_scalar()); - assert(index->type->base_type == GLSL_TYPE_INT); + assert(index->type->base_type == GLSL_TYPE_INT || index->type->base_type == GLSL_TYPE_UINT); assert(components >= 1 && components <= 4); if (components > 1) { diff --git a/mesalib/src/glsl/opt_copy_propagation_elements.cpp b/mesalib/src/glsl/opt_copy_propagation_elements.cpp index f5f59b7d3..c3e55bcd1 100644 --- a/mesalib/src/glsl/opt_copy_propagation_elements.cpp +++ b/mesalib/src/glsl/opt_copy_propagation_elements.cpp @@ -207,8 +207,9 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) int swizzle_chan[4]; ir_dereference_variable *deref_var; ir_variable *source[4] = {NULL, NULL, NULL, NULL}; - int source_chan[4]; + int source_chan[4] = {0, 0, 0, 0}; int chans; + bool noop_swizzle = true; if (!*ir) return; @@ -250,6 +251,9 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) if (entry->write_mask & (1 << swizzle_chan[c])) { source[c] = entry->rhs; source_chan[c] = entry->swizzle[swizzle_chan[c]]; + + if (source_chan[c] != swizzle_chan[c]) + noop_swizzle = false; } } } @@ -266,6 +270,12 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) if (!shader_mem_ctx) shader_mem_ctx = ralloc_parent(deref_var); + /* Don't pointlessly replace the rvalue with itself (or a noop swizzle + * of itself, which would just be deleted by opt_noop_swizzle). + */ + if (source[0] == var && noop_swizzle) + return; + if (debug) { printf("Copy propagation from:\n"); (*ir)->print(); @@ -278,6 +288,7 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) source_chan[2], source_chan[3], chans); + progress = true; if (debug) { printf("to:\n"); -- cgit v1.2.3