mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
internal/builtinshader: refactoring
This commit is contained in:
parent
d021209d84
commit
de1ef0bec8
@ -65,7 +65,10 @@ func xmain() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, s := range builtinshader.AppendShaderSources(nil) {
|
for filter := builtinshader.Filter(0); filter < builtinshader.FilterCount; filter++ {
|
||||||
|
for address := builtinshader.Address(0); address < builtinshader.AddressCount; address++ {
|
||||||
|
for _, useColorM := range []bool{false, true} {
|
||||||
|
s := builtinshader.ShaderSource(filter, address, useColorM)
|
||||||
if _, err := w.WriteString("\n"); err != nil {
|
if _, err := w.WriteString("\n"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -76,6 +79,8 @@ func xmain() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := w.Flush(); err != nil {
|
if err := w.Flush(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -200,12 +200,3 @@ func Fragment() vec4 {
|
|||||||
return vec4(0)
|
return vec4(0)
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
func AppendShaderSources(sources [][]byte) [][]byte {
|
|
||||||
for filter := Filter(0); filter < FilterCount; filter++ {
|
|
||||||
for address := Address(0); address < AddressCount; address++ {
|
|
||||||
sources = append(sources, ShaderSource(filter, address, false), ShaderSource(filter, address, true))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sources
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user