vkd3d-shader/tpf: Combine struct sm4_dst_register and struct sm4_src_register.
This series is basically a single patch but that requires @cmccarthy's !225 (merged) first. So, the 2 patches from !225 (merged) are included as 1/3 and 2/3.
As can be implied from !225 (merged), in SM4 bytecode, all the information regarding whether the register uses a writemask, a swizzle, a dimension index, or none of these, is encoded in the register itself, and doesn't depend on the instruction nor argument position on which the register is used.
The possible register encodings are given by the following diagram:
Where the swizzle_type (MASK4, VEC4, or SCALAR) only matter when the dim is VEC4.
Thus, it makes sense to merge these two types of registers into a single data type as 3/3 does. This has the added benefit of removing additional writemask and swizzle_type arguments to be initialized by pointer in several helper functions.
Also, this would help me to simplify a new version of !229 (closed).
Merge request reports
Activity
requested review from @fcasas
mentioned in merge request !229 (closed)
This seem like the wrong way to go about it. In particular, I think this is what we should do:
-
Make struct sm4_register a proper subset of struct vkd3d_shader_register. E.g. by changing the "type" field from vkd3d_sm4_register_type to vkd3d_shader_register_type. It probably also implies moving some fields from struct sm4_register to struct sm4_dst_register/sm4_src_register.
-
Replace usage of struct sm4_register with usage of struct vkd3d_shader_register. That should be straightforward after the previous step.
-
Move up from there. I.e., doing the same thing for struct sm4_dst_register, struct sm4_src_register, and struct sm4_instruction. It's possible that this will require adding things to the vkd3d_shader_instruction structures; that's fine.
-
mentioned in merge request !281 (merged)
Superseded by !281 (merged)