aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/compiler
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2020-02-04 14:58:17 +0200
committerMarge Bot <[email protected]>2020-02-07 09:06:18 +0000
commitda76dfb5159c2ca8ee24d64a5f85a68f28b70c65 (patch)
treef8e19fac5e5a0b383189914de00636d947d4e190 /src/intel/compiler
parent1572e8f3e136affb429e34ec2e8e10e206e0f3cd (diff)
intel/vec4: fix valgrind errors with vf_values array
Fixes valgrind errors introduced since commit a8ec4082. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2346 Fixes: a8ec4082 ("nir+vtn: vec8+vec16 support") Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Matt Turner <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3691> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3691>
Diffstat (limited to 'src/intel/compiler')
-rw-r--r--src/intel/compiler/brw_vec4_nir.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/intel/compiler/brw_vec4_nir.cpp b/src/intel/compiler/brw_vec4_nir.cpp
index d32f65a9dbe..31219b4b584 100644
--- a/src/intel/compiler/brw_vec4_nir.cpp
+++ b/src/intel/compiler/brw_vec4_nir.cpp
@@ -1030,7 +1030,8 @@ try_immediate_source(const nir_alu_instr *instr, src_reg *op,
} else {
uint8_t vf_values[4] = { 0, 0, 0, 0 };
- for (unsigned i = 0; i < NIR_MAX_VEC_COMPONENTS; i++) {
+ for (unsigned i = 0; i < ARRAY_SIZE(vf_values); i++) {
+
if (op[idx].abs)
f[i] = fabs(f[i]);