ebiten/internal/shader/testdata/issue1701.go
Hajime Hoshi 853c1f2b92 internal/shaderir/glsl: Bug fix: Remove uncalled functions
Some built-in functions like dFdx is not available in a vertex shader,
then a function that calls such built-in function should not be in
a vertex shader.

Closes #1701
2021-07-09 20:22:40 +09:00

36 lines
280 B
Go

package main
func Foo() {
Bar()
Baz()
}
func Bar() {
Baz()
Quux()
}
func Baz() {
}
func Quux() {
Baz()
}
func NeverCalled() {
Foo()
Bar()
Baz()
Quux()
}
func Vertex(pos vec2) vec4 {
Foo()
return vec4(0)
}
func Fragment(pos vec4) vec4 {
Quux()
return vec4(0)
}