From 300d72943675a49091ecb49597b56f7bdfefd22d Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 21 Apr 2015 18:00:21 -0700 Subject: nir: Add and use initializer #defines for nir_src and nir_dest Reviewed-by: Connor Abbott --- src/glsl/nir/nir_builder.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/glsl/nir/nir_builder.h') diff --git a/src/glsl/nir/nir_builder.h b/src/glsl/nir/nir_builder.h index d1419ee2114..9223e838095 100644 --- a/src/glsl/nir/nir_builder.h +++ b/src/glsl/nir/nir_builder.h @@ -231,8 +231,7 @@ static inline nir_ssa_def * nir_swizzle(nir_builder *build, nir_ssa_def *src, unsigned swiz[4], unsigned num_components, bool use_fmov) { - nir_alu_src alu_src; - memset(&alu_src, 0, sizeof(alu_src)); + nir_alu_src alu_src = { NIR_SRC_INIT }; alu_src.src = nir_src_for_ssa(src); for (int i = 0; i < 4; i++) alu_src.swizzle[i] = swiz[i]; @@ -251,8 +250,7 @@ nir_ssa_for_src(nir_builder *build, nir_src src, int num_components) if (src.is_ssa && src.ssa->num_components == num_components) return src.ssa; - nir_alu_src alu; - memset(&alu, 0, sizeof(alu)); + nir_alu_src alu = { NIR_SRC_INIT }; alu.src = src; for (int j = 0; j < 4; j++) alu.swizzle[j] = j; -- cgit v1.2.3