Keegan McAllister
Keegan McAllister
So that, for example, we only declare uniforms once.
I presume each driver has its own error format, but it can't be that hard to find a line and column number. Related to #4.
e.g. ``` rust const UNIFORMS: Uniforms; fn vertex(v: Attributes) -> (vec4, Varyings) { ... } fn fragment(v: Varyings) -> vec4 { ... } ``` where those struct definitions are lifted...
The translation runs in a separate thread from rustc, in order to catch errors. So we may not be able to share libsyntax data structures. If that's the case, maybe...
@eddyb suggested ``` rust static color: vec3 = varying; ```
We only support a tiny subset of Rust. It could be nice to have a 100 line grammar for shader programs instead of the grammar being the 6,000 line Rust...
More ambitious version of #5.
Perhaps using a pretty-printing library similar to Haskell's [Text.PrettyPrint](https://hackage.haskell.org/package/pretty-1.1.2.1/docs/Text-PrettyPrint.html). We should indent code properly, and also elide parentheses when possible (especially around assignment).