On Wed Jan 17 20:02:59 2024 +0000, Nikolay Sivov wrote:
Why would I produce blocks for e.g. assigning state object fields? It means that first you get instruction lists that you later have to iterate over again to figure out what to do with them. For example, for a matrix it's enough to simplify each element individually and then write them all together. Using blocks has an advantage of easily evaluating constant expressions, but then to write actual result for any type that's not a scalar, you'll have to sort of interpret such blocks. Then for strings, it will produce a string constant load, without string constants supported anywhere else.
Oh, I see, you mean that it produces a single block.
It's not unworkable or even necessarily complex with a single block (consider e.g. emitting a load per component, adding a hlsl_src, then running copy-prop), but it may indeed be easier to work from the parse_variable_def list. But at the same time that probably means we're going to duplicate a lot of code. I'd have to see the code in question.
In any case it doesn't really affect this merge request enough to block it, so I'll set it aside for now.