Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/tpf.c:
- sm4_dst_from_node(&instr.dsts[0], dst);
- instr.dst_count = 1;
- if (load->level.node)
- {
sm4_src_from_node(&instr.srcs[0], load->level.node, VKD3DSP_WRITEMASK_ALL);
- }
- else
- {
instr.srcs[0].swizzle_type = VKD3D_SM4_SWIZZLE_NONE;
reg = &instr.srcs[0].reg;
reg->type = VKD3D_SM4_RT_IMMCONST;
reg->dim = VKD3D_SM4_DIMENSION_SCALAR;
reg->immconst_uint[0] = 0;
- }
I'd avoid having this kind of "default arguments" in the IR. Let the frontend stick something in `level`, instead of defaulting to zero in the IR.