On Mon Jun 19 13:25:33 2023 +0000, Giovanni Mascellani wrote:
Why not using something like:
enum hlsl_regset regset = (var->data_type->class == HLSL_CLASS_STRUCT ? HLSL_REGSET_NUMERIC : hlsl_type_get_regset(var->data_type));
possibly with a comment? It seems simpler and it better conveys the fact that variables in SM1 are still essentially considered to have a single regset. Not that your solution is bad.
I am trying to get rid of hlsl_type_get_regset() at some point, to discourage using it and having to consider exceptions such as this.
Perhaps the alternative would be making a sm1-exclusive sm1_type_get_regset() that is defined for structs, but using these `for`s also works.