On Mon Jun 12 13:13:16 2023 +0000, Giovanni Mascellani wrote:
I'm not opposed in principle to migrating to `vkd3d_shader_instruction`, though I haven't considered precisely how much work it is. Surely reusing structures instead of defining a new variant has some value. OTOH, in this case we need much less than the whole `vkd3d_shader_register` structure. Currently I think we either use one constant register, or one constant and one dynamic register. Unless we already anticipate needing more, we could just design our structures around this.
Given that the `struct sm4_instruction` values don't leave the `write_sm4_*()` functions and are just used as input for `write_sm4_instruction()`, I don't see much value in using `vkd3d_shader_instruction` instead. Also, some translation functions may be required, for instance, the vkd3d swizzles are different from the SM4 swizzles.