diff options
author | Jason Ekstrand <[email protected]> | 2015-04-21 18:00:21 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-05-08 17:16:13 -0700 |
commit | 300d72943675a49091ecb49597b56f7bdfefd22d (patch) | |
tree | 9efa3cfdbeeed2f59a99432681b503c4c965ecc1 /src/glsl/nir/nir_builder.h | |
parent | 6702ebce5760aae0eb15f410c2a83b6e893b005c (diff) |
nir: Add and use initializer #defines for nir_src and nir_dest
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_builder.h')
-rw-r--r-- | src/glsl/nir/nir_builder.h | 6 |
1 files changed, 2 insertions, 4 deletions
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; |