aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-09-08 23:27:52 +0200
committermarha <marha@users.sourceforge.net>2014-09-08 23:27:52 +0200
commitcb346e228aeb500cd61ec86644c034c238332d3b (patch)
tree5902a043a3643391e689ebb146e6fd02af1c4b8e /mesalib/src/glsl
parent4aef26e36bc9aba4cd67c158e17f5fb93c9e018c (diff)
downloadvcxsrv-cb346e228aeb500cd61ec86644c034c238332d3b.tar.gz
vcxsrv-cb346e228aeb500cd61ec86644c034c238332d3b.tar.bz2
vcxsrv-cb346e228aeb500cd61ec86644c034c238332d3b.zip
xkeyboard-config mesa git update 8 Sep 2014
xkeyboard-config commit 1b9901151cdb22e413319e6fca80fbbfc5e51502 mesa commit 12fb74fe895fe9954df127ca0ec6e4422fffb156
Diffstat (limited to 'mesalib/src/glsl')
-rw-r--r--mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp2
-rw-r--r--mesalib/src/glsl/opt_copy_propagation_elements.cpp13
2 files changed, 13 insertions, 2 deletions
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");