summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2017-08-16 22:18:39 -0400
committerEmil Velikov <[email protected]>2017-08-19 02:57:19 +0100
commitefb9b5740e1a0458e466d3ac280afb94a79b73c9 (patch)
tree852abe603b231d50a8f8f6761feacc8f01d3f69a
parente44393cb238329dcc4e0fc1324f68b52a86e5922 (diff)
glsl: add a few missing int64 constant propagation cases
Fixes KHR-GL45.shader_ballot_tests.ShaderBallotAvailability, which causes some silly swizzles to appear, triggering this optimization to get hit. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Cc: [email protected] (cherry picked from commit 9c8f017f77188d9048132a30d31f18b9690cbe04)
-rw-r--r--src/compiler/glsl/ir_constant_expression.cpp2
-rw-r--r--src/compiler/glsl/opt_constant_propagation.cpp6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/glsl/ir_constant_expression.cpp b/src/compiler/glsl/ir_constant_expression.cpp
index cd3cd1bb592..fe136741015 100644
--- a/src/compiler/glsl/ir_constant_expression.cpp
+++ b/src/compiler/glsl/ir_constant_expression.cpp
@@ -725,6 +725,8 @@ ir_swizzle::constant_expression_value(struct hash_table *variable_context)
case GLSL_TYPE_FLOAT: data.f[i] = v->value.f[swiz_idx[i]]; break;
case GLSL_TYPE_BOOL: data.b[i] = v->value.b[swiz_idx[i]]; break;
case GLSL_TYPE_DOUBLE:data.d[i] = v->value.d[swiz_idx[i]]; break;
+ case GLSL_TYPE_UINT64:data.u64[i] = v->value.u64[swiz_idx[i]]; break;
+ case GLSL_TYPE_INT64: data.i64[i] = v->value.i64[swiz_idx[i]]; break;
default: assert(!"Should not get here."); break;
}
}
diff --git a/src/compiler/glsl/opt_constant_propagation.cpp b/src/compiler/glsl/opt_constant_propagation.cpp
index 40395120974..c5baf988c2c 100644
--- a/src/compiler/glsl/opt_constant_propagation.cpp
+++ b/src/compiler/glsl/opt_constant_propagation.cpp
@@ -237,6 +237,12 @@ ir_constant_propagation_visitor::constant_propagation(ir_rvalue **rvalue) {
case GLSL_TYPE_BOOL:
data.b[i] = found->constant->value.b[rhs_channel];
break;
+ case GLSL_TYPE_UINT64:
+ data.u64[i] = found->constant->value.u64[rhs_channel];
+ break;
+ case GLSL_TYPE_INT64:
+ data.i64[i] = found->constant->value.i64[rhs_channel];
+ break;
default:
assert(!"not reached");
break;