summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-01-21 15:32:48 -0800
committerEric Anholt <[email protected]>2015-01-22 13:52:19 -0800
commitfc6938d23e769497fd2acba7da0b59935ec9f1e4 (patch)
treed42250188b9e64ae5762ba0eb84984aaae5e91d2
parent534a4ec82f09fa37e2134c994082e71c79b7d5ec (diff)
nir: Fix setup of constant bool initializers.
brw_fs_nir has only seen scalar bools so far, thanks to vector splitting, and the ralloc of in glsl_to_nir.cpp will *usually* get you a 0-filled chunk of memory, so reading too large of a value will usually get you the right bool value. But once we start doing vector bools in a few commits, we end up getting bad values. Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/glsl/nir/nir_lower_vars_to_ssa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/nir/nir_lower_vars_to_ssa.c b/src/glsl/nir/nir_lower_vars_to_ssa.c
index 168a02595fc..8af75302986 100644
--- a/src/glsl/nir/nir_lower_vars_to_ssa.c
+++ b/src/glsl/nir/nir_lower_vars_to_ssa.c
@@ -600,7 +600,7 @@ get_const_initializer_load(const nir_deref_var *deref,
load->value.u[i] = constant->value.u[matrix_offset + i];
break;
case GLSL_TYPE_BOOL:
- load->value.u[i] = constant->value.u[matrix_offset + i] ?
+ load->value.u[i] = constant->value.b[matrix_offset + i] ?
NIR_TRUE : NIR_FALSE;
break;
default: