nir: Avoid C99 field initializers.

As they are not standard C++ and are not supported by MSVC C++ compiler.

Just have nir_imm_double match nir_imm_float above.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
This commit is contained in:
Jose Fonseca
2016-04-28 12:17:42 +01:00
parent a609da60c0
commit f7854d8227

View File

@@ -117,9 +117,12 @@ nir_imm_float(nir_builder *build, float x)
static inline nir_ssa_def * static inline nir_ssa_def *
nir_imm_double(nir_builder *build, double x) nir_imm_double(nir_builder *build, double x)
{ {
nir_const_value v = { { .f64 = {x, 0, 0, 0} } }; nir_const_value v;
nir_ssa_def *def = nir_build_imm(build, 1, 64, v);
return def; memset(&v, 0, sizeof(v));
v.f64[0] = x;
return nir_build_imm(build, 1, 64, v);
} }
static inline nir_ssa_def * static inline nir_ssa_def *