On Thu Apr 6 01:03:37 2023 +0000, Zebediah Figura wrote:
Can we hlsl_note() with the previous variable's location?
This made me realize that I am emitting this error `n - 1` times when the semantic is used `n` times. I fixed that using a new flag for the semantic variable.
Now, regarding the reporting the previous variable's location. It begs the question of what to do when there are more than 2 repetitions. If we do this, we probably would want to report all locations where the semantic is used, and also find a way of reporting when a semantic is used more than once in a single location that doesn't imply printing the location as many times as it is repeated (consider a very large array of structs with the semantic in a field).
I spent some time thinking about this, but I can't see a way that wouldn't require storing all the reported locations. So, IMO, the additional complexity doesn't overweight the benefit. But if you think that it is important enough, I will do it.