Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/tpf.c:
+ { + if (reg->idx[i].offset == 0) + return VKD3D_SM4_ADDRESSING_RELATIVE; + else + return VKD3D_SM4_ADDRESSING_RELATIVE | VKD3D_SM4_ADDRESSING_OFFSET; + } + + return 0; +} + static uint32_t sm4_encode_register(const struct tpf_writer *tpf, const struct vkd3d_shader_register *reg, enum vkd3d_sm4_swizzle_type sm4_swizzle_type, uint32_t sm4_swizzle) { + unsigned int idx0_addressing = sm4_get_index_addressing_from_reg(reg, 0); + unsigned int idx1_addressing = sm4_get_index_addressing_from_reg(reg, 1); + unsigned int idx2_addressing = sm4_get_index_addressing_from_reg(reg, 2); Not really important, but it doesn't look like you need to create three variables for these. Just inline the call to `sm4_get_index_addressing_from_reg()` below.
-- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/435#note_50627