Module glsl::writer::glsl
[−]
[src]
A GLSL450 writer that takes a syntax tree and writes it as a plain raw GLSL String
.
This module exports several functions that just transforms a part of a syntax tree into its raw
GLSL String
representation.
Important note: this module – and actually, any
writer::*
module – is not responsible in optimizing the syntax tree nor semantically check its validity. This is done in other stages of the compilation process.
In order to achieve that purpose, you could:
- for each elements in the AST, return a
String
orCow<str>
; - insert the string representation via a formatter.
The second solution is better because it let the user handles the memory the way they want: they
might just use a dynamic buffer that implements Write
or simply pass a &mut String
. It’s up
to you.