gfx-rs/gfx-rs — pull request #467 by serpis (2014-12-01 22:22:45+00:00)
Title: Add OUTPUTS: to shader! macro for specifying fragment shader outputs.

Provides a way to specify multiple outputs from a fragment shader. The names will be bound to indices according to their place in the OUTPUTS array.

Used like this:

```
static MY_FRAGMENT_SRC: gfx::ShaderSource<'static> = shaders! {
GLSL_150: b"
#version 150 core
...
out vec4 o_Color;
out vec4 o_Emittance;
...
void main() {
o_Diffuse = texture(u_Tex0, v_TexCoord);
o_Emittance = texture(u_Tex1, v_TexCoord);
}
"
OUTPUTS: ["o_Diffuse", "o_Emittance", "", ""]
};
```

I couldn't figure out how to make OUTPUTS an array of variable length. Perhaps somebody with better rust-fu can help with that.