mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
shaderir: Add new lines
This commit is contained in:
parent
f4a1f90d92
commit
29dbad28f9
@ -90,6 +90,7 @@ func (p *Program) Glsl() string {
|
||||
|
||||
// Vertex func
|
||||
if len(p.VertexFunc.Block.Stmts) > 0 {
|
||||
lines = append(lines, "")
|
||||
lines = append(lines, "#if defined(COMPILING_VERTEX_SHADER)")
|
||||
lines = append(lines, "void main(void) {")
|
||||
lines = append(lines, p.glslBlock(&p.VertexFunc.Block, 0, 0)...)
|
||||
@ -99,6 +100,7 @@ func (p *Program) Glsl() string {
|
||||
|
||||
// Fragment func
|
||||
if len(p.FragmentFunc.Block.Stmts) > 0 {
|
||||
lines = append(lines, "")
|
||||
lines = append(lines, "#if defined(COMPILING_FRAGMENT_SHADER)")
|
||||
lines = append(lines, "void main(void) {")
|
||||
lines = append(lines, p.glslBlock(&p.FragmentFunc.Block, 0, 0)...)
|
||||
|
@ -610,6 +610,7 @@ attribute float A1;
|
||||
attribute vec2 A2;
|
||||
varying float V0;
|
||||
varying vec2 V1;
|
||||
|
||||
#if defined(COMPILING_VERTEX_SHADER)
|
||||
void main(void) {
|
||||
gl_Position = A0;
|
||||
@ -678,6 +679,7 @@ attribute float A1;
|
||||
attribute vec2 A2;
|
||||
varying float V0;
|
||||
varying vec2 V1;
|
||||
|
||||
#if defined(COMPILING_VERTEX_SHADER)
|
||||
void main(void) {
|
||||
gl_Position = A0;
|
||||
@ -685,6 +687,7 @@ void main(void) {
|
||||
V1 = A2;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COMPILING_FRAGMENT_SHADER)
|
||||
void main(void) {
|
||||
vec2 l0;
|
||||
|
Loading…
Reference in New Issue
Block a user