Create a gist now

Instantly share code, notes, and snippets.

@phaazon /ast.rs Secret
Created Jul 30, 2017

What would you like to do?
Done(
[],
[
Declaration(
InitDeclaratorList(
InitDeclaratorList {
head: SingleDeclaration {
ty: FullySpecifiedType {
qualifier: Some(
TypeQualifier {
qualifiers: [
Storage(
Uniform
)
]
}
),
ty: Float
},
name: Some(
"t"
),
array_specifier: None,
initializer: None
},
tail: []
}
)
),
FunctionDefinition(
FunctionDefinition {
prototype: FunctionPrototype {
ty: FullySpecifiedType {
qualifier: None,
ty: TypeName(
"void"
)
},
name: "main",
parameters: []
},
statement: CompoundStatement {
statement_list: [
Simple(
Expression(
Some(
Assignment(
Variable(
"gl_FragCoord"
),
Equal,
FunCall(
TypeSpecifier(
Vec4
),
[
FunCall(
TypeSpecifier(
TypeName(
"cos"
)
),
[
Variable(
"t"
)
]
),
FunCall(
TypeSpecifier(
TypeName(
"sin"
)
),
[
Variable(
"t"
)
]
),
DoubleConst(
0.8
),
DoubleConst(
1
)
]
)
)
)
)
)
]
}
}
)
]
)
uniform float t;
void main() {
gl_FragCoord = vec4(cos(t), sin(t), .8, 1.);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment