Hi,
Il 22/04/22 16:11, Francisco Casas ha scritto:
I am not completely in love with the additional runtime complexity of this solution, but it's true that it's quite clean.
I have a couple of ideas for lowering the complexity:
a) Add a "component_count" field to hlsl_type in order to store/cache the result of hlsl_type_component_count(). Which would also speed up other parts of the compiler.
b) Add a "comp_offsets" array to "hlsl_type.e" so that the right field that has a given component can be selected in hlsl_compute_component_reg_offset() using a binary search.
I can make new patches for these.
Actually, that was just a random remark, I don't think it is really worth the additional complexity to do the changes you mention.
Giovanni.