On Tue Jan 24 16:28:41 2023 +0000, Francisco Casas wrote:
It its technically possible but there we would be introducing some redudancy, repeating code in the calculation of the reg_size and in this function. For instance, we would have to write twice the fact that textures use either the regset S or the regset T, whether we are in SM1 or SM4. That last thing is also a reason why I am not too inclined to name the regsets HLSL_REGSET_SAMPLERS and HLSL_REGSET_TEXTURES instead of using a single letter (HLSL_REGSET_S and HLSL_REGSET_T) as now.
If we're concerned about duplication we can deduplicate the other way, i.e. use hlsl_type_get_regset() in hlsl_type_calculate_reg_size().
I'm not convinced we want to be tying the register set to the letter used in disassembly, though. We could use HLSL_REGSET_RESOURCE regardless of shader version. We get rid of all the HLSL_TYPE_SAMPLER variables for sm1 anyway.