csyonghe / Spire

Other
174 stars 22 forks source link

Relinquish out-of-order component definition #60

Closed csyonghe closed 7 years ago

csyonghe commented 7 years ago

Current compiler implementation performs dependency sorting on the components, giving shader authors the flexibility to define components out-of-order. However this feature is rarely used in practice and the compiler sorting process some times introduces surprises as the component definition order may differ from source code after the sorting. This becomes an issue when the engine assumes the order of input/output components in shader source code, and forces the user to specify layout(location=x) attributes.

csyonghe commented 7 years ago

this issue is addressed by generating record types before dependency sorting.