So it actually doesn't depend on those patches at all. :) This series might have some minor conflicts with that series, but we should simply deal with those once they actually happen; it's entirely possible for this series to go in first.
Yes. Although, I am not sure if you mean that I should drop the first patch, that just renames VKD3D_SM4_SWIZZLE_MASK4 to VKD3D_SM4_SWIZZLE_NONE. Note that this renaming is only a subset of the first patch by Conor. I think that the new name is more appropriate.
You should update the prototype in hlsl.h as well.
Done.
I don't dislike this, but it does seem like somewhat of a separate change.
I split it as a separate patch.
We'd typically add something like VKD3D_SM4_REGISTER_TYPE_COUNT. E.g., VKD3D_SHADER_TYPE_COUNT.
I changed it, seems better.
Yeah. I'd go with the second option.
I implemented the second option. It requires the lookup tables to be in both struct hlsl_ctx and struct vkd3d_shader_sm4_parser, and passing the context or the lookup tables in a lot of functions in tpf.c, which may make option 3 more preferable. A good thing though is that these changes would allow to use the same strategy to speed up get_opcode_info().
Do we really need this? We use it in register_type_table[] for VKD3DSPR_IMMCONST and VKD3DSPR_IMMCONST64, but then overwrite it for VKD3DSPR_IMMCONST. I'm not sure it adds that much over using e.g. VKD3D_SM4_DIMENSION_NONE or VKD3D_SM4_DIMENSION_VEC4 for these.
Good point. VKD3D_SM4_DIMENSION_INVALID was to remind that the dimension depends on the circumstances and should be overwritten by them. I changed it to VKD3D_SM4_DIMENSION_NONE, but I wrote it in the table as a mere 0, as a reminder of that.
VKD3D_SM4_DIMENSION_INVALID was also meant to trigger an assertion fail in case we were emitting a VKD3DSPR_IMMCONST64 because we didn't have code were we were explicitly setting the dimension for this register type. After some tests, I see that VKD3DSPR_IMMCONST64 always uses VKD3D_SM4_DIMENSION_VEC4, even for scalar doubles, so I just put that in the table.