On 12/3/21 02:52, Giovanni Mascellani wrote:
Hi,
On 02/12/21 17:17, Zebediah Figura wrote:
If this pass is going to be hard to write, I'm fine enough with using this patch as a temporary solution. It's not clear to me that the pass *is* hard to write, but it probably won't make it into 1.3 if that's going to be released soon. Of course, it's also not clear to me that we really *need* a temporary solution...
For sure we don't need it, but as much as we probably don't need most of the other optimization passes we have, including copy propagation as a whole (except for the bit about uniform objects). Whatever code we compile to, it will eventually be re-compiled by a few other compilers, at least one of which is probably better than ours and, more importantly, knows about which hardware it is compiling for.
To me, optimization passes are currently mostly helpful to produce code that can reasonably read by a human to verify that compilation is correct. To this end, I think 4/17 is useful (as it will be a vectorization pass, as soon as it will exist).
Well, we do sort of need copy-propagation so that we can deal with object variables (including e.g. object variables returned from a function, which I've seen in actual shaders). We can't translate those load/store instrs to actual DXBC, because there's no such thing as an object-typed temp.