mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-28 03:32:45 +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
|
// Vertex func
|
||||||
if len(p.VertexFunc.Block.Stmts) > 0 {
|
if len(p.VertexFunc.Block.Stmts) > 0 {
|
||||||
|
lines = append(lines, "")
|
||||||
lines = append(lines, "#if defined(COMPILING_VERTEX_SHADER)")
|
lines = append(lines, "#if defined(COMPILING_VERTEX_SHADER)")
|
||||||
lines = append(lines, "void main(void) {")
|
lines = append(lines, "void main(void) {")
|
||||||
lines = append(lines, p.glslBlock(&p.VertexFunc.Block, 0, 0)...)
|
lines = append(lines, p.glslBlock(&p.VertexFunc.Block, 0, 0)...)
|
||||||
@ -99,6 +100,7 @@ func (p *Program) Glsl() string {
|
|||||||
|
|
||||||
// Fragment func
|
// Fragment func
|
||||||
if len(p.FragmentFunc.Block.Stmts) > 0 {
|
if len(p.FragmentFunc.Block.Stmts) > 0 {
|
||||||
|
lines = append(lines, "")
|
||||||
lines = append(lines, "#if defined(COMPILING_FRAGMENT_SHADER)")
|
lines = append(lines, "#if defined(COMPILING_FRAGMENT_SHADER)")
|
||||||
lines = append(lines, "void main(void) {")
|
lines = append(lines, "void main(void) {")
|
||||||
lines = append(lines, p.glslBlock(&p.FragmentFunc.Block, 0, 0)...)
|
lines = append(lines, p.glslBlock(&p.FragmentFunc.Block, 0, 0)...)
|
||||||
|
@ -610,6 +610,7 @@ attribute float A1;
|
|||||||
attribute vec2 A2;
|
attribute vec2 A2;
|
||||||
varying float V0;
|
varying float V0;
|
||||||
varying vec2 V1;
|
varying vec2 V1;
|
||||||
|
|
||||||
#if defined(COMPILING_VERTEX_SHADER)
|
#if defined(COMPILING_VERTEX_SHADER)
|
||||||
void main(void) {
|
void main(void) {
|
||||||
gl_Position = A0;
|
gl_Position = A0;
|
||||||
@ -678,6 +679,7 @@ attribute float A1;
|
|||||||
attribute vec2 A2;
|
attribute vec2 A2;
|
||||||
varying float V0;
|
varying float V0;
|
||||||
varying vec2 V1;
|
varying vec2 V1;
|
||||||
|
|
||||||
#if defined(COMPILING_VERTEX_SHADER)
|
#if defined(COMPILING_VERTEX_SHADER)
|
||||||
void main(void) {
|
void main(void) {
|
||||||
gl_Position = A0;
|
gl_Position = A0;
|
||||||
@ -685,6 +687,7 @@ void main(void) {
|
|||||||
V1 = A2;
|
V1 = A2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(COMPILING_FRAGMENT_SHADER)
|
#if defined(COMPILING_FRAGMENT_SHADER)
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec2 l0;
|
vec2 l0;
|
||||||
|
Loading…
Reference in New Issue
Block a user