Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/spirv.c:
condition_id = spirv_compiler_emit_load_src(compiler, &src[0], VKD3DSP_WRITEMASK_0); condition_id = spirv_compiler_emit_int_to_bool(compiler, instruction->flags, 1, condition_id); /* Emit the merge immediately before the branch instruction. */
- spirv_compiler_emit_merge(compiler, src[2].reg.idx[0].offset);
- spirv_compiler_emit_merge(compiler, src[2].reg.idx[0].offset, src[2].reg.idx[1].offset);
`idx[1]` is not guaranteed to be valid. Well, technically it is, because we always have three of them, but I think we should keep the rule that indices exceeding `idx_count` are never touched, and `idx_count` could be 1 here. So IMO either you decide to always set `idx_count == 2` for the merge and continue register, or you check `idx_count` before reading the continue label.