Metal process caches shaders (with what appears to be text equality). Therefore, we should always generate the same Metal program for the same WHLSL shader. Currently, we don't do this for a few reasons, often because we rely on pointer hash tables and their iteration order. E.g, I know of at least: - We emit struct fields in different order - I think we do the same for enum - I think we might do the same for functions
It would be good to be able to dump the metal shaders in layout tests (much like we dump the render tree) for testing.
WHLSL is no longer relevant.