diff --git a/taichi/backends/vulkan/spirv_ir_builder.h b/taichi/backends/vulkan/spirv_ir_builder.h index 333ab38f15934..33c0f3db846b4 100644 --- a/taichi/backends/vulkan/spirv_ir_builder.h +++ b/taichi/backends/vulkan/spirv_ir_builder.h @@ -460,9 +460,24 @@ class IRBuilder { // glsl 450 extension Value ext_glsl450_; // Special cached types - bool support_int8_, support_int16_, support_int64_, support_fp64_; - SType t_bool_, t_int8_, t_int16_, t_int32_, t_int64_, t_uint8_, t_uint16_, - t_uint32_, t_uint64_, t_fp32_, t_fp64_, t_void_, t_void_func_; + bool support_int8_{false}; + bool support_int16_{false}; + bool support_int64_{false}; + bool support_fp64_{false}; + + SType t_bool_; + SType t_int8_; + SType t_int16_; + SType t_int32_; + SType t_int64_; + SType t_uint8_; + SType t_uint16_; + SType t_uint32_; + SType t_uint64_; + SType t_fp32_; + SType t_fp64_; + SType t_void_; + SType t_void_func_; // gl compute shader related type(s) and variables SType t_v3_uint_; Value gl_global_invocation_id; @@ -472,8 +487,11 @@ class IRBuilder { // Float type atomic add function Value float_atomic_add_; // Random function and variables - bool init_rand_; - Value _rand_x_, _rand_y_, _rand_z_, _rand_w_; // per-thread local variable + bool init_rand_{false}; + Value _rand_x_; + Value _rand_y_; + Value _rand_z_; + Value _rand_w_; // per-thread local variable // map from value to its pointer type std::map, SType> pointer_type_tbl_;