mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
shaderir: Add space lines between functions
This commit is contained in:
parent
84fb951729
commit
399bb93044
@ -202,6 +202,7 @@ func Bar(x vec2) vec2 {
|
||||
l1 = l2;
|
||||
return;
|
||||
}
|
||||
|
||||
void F1(in vec2 l0, out vec2 l1) {
|
||||
l1 = l0;
|
||||
return;
|
||||
@ -230,6 +231,7 @@ func Bar(x float) (float, float) {
|
||||
l1 = vec2(l4, l5);
|
||||
return;
|
||||
}
|
||||
|
||||
void F1(in float l0, out float l1, out float l2) {
|
||||
l1 = l0;
|
||||
l2 = l0;
|
||||
|
@ -86,15 +86,17 @@ func (p *Program) Glsl() (vertexShader, fragmentShader string) {
|
||||
for i, t := range p.Varyings {
|
||||
vslines = append(vslines, fmt.Sprintf("varying %s;", p.glslVarDecl(&t, fmt.Sprintf("V%d", i))))
|
||||
}
|
||||
if len(vslines) > 0 && len(p.Funcs) > 0 {
|
||||
vslines = append(vslines, "")
|
||||
}
|
||||
for _, f := range p.Funcs {
|
||||
if len(vslines) > 0 {
|
||||
vslines = append(vslines, "")
|
||||
}
|
||||
vslines = append(vslines, p.glslFunc(&f)...)
|
||||
}
|
||||
|
||||
if len(p.VertexFunc.Block.Stmts) > 0 {
|
||||
vslines = append(vslines, "")
|
||||
if len(vslines) > 0 {
|
||||
vslines = append(vslines, "")
|
||||
}
|
||||
vslines = append(vslines, "void main(void) {")
|
||||
vslines = append(vslines, p.glslBlock(&p.VertexFunc.Block, 0, 0)...)
|
||||
vslines = append(vslines, "}")
|
||||
|
Loading…
Reference in New Issue
Block a user