internal/builtinshader: move a clearing shader to builtinshader

This commit is contained in:
Hajime Hoshi 2024-05-05 02:18:14 +09:00
parent ca9a80600d
commit d7df5ebcbd
2 changed files with 10 additions and 7 deletions

View File

@ -104,13 +104,7 @@ func init() {
return nil
})
wg.Go(func() error {
ir, err := graphics.CompileShader([]byte(`//kage:unit pixels
package main
func Fragment(dstPos vec4, srcPos vec2, color vec4) vec4 {
return vec4(0)
}`))
ir, err := graphics.CompileShader([]byte(builtinshader.ClearShaderSource))
if err != nil {
return fmt.Errorf("atlas: compiling the clear shader failed: %w", err)
}

View File

@ -188,3 +188,12 @@ func Fragment(dstPos vec4, srcPos vec2, color vec4) vec4 {
return mix(mix(c0, c1, rate.x), mix(c2, c3, rate.x), rate.y)
}
`)
var ClearShaderSource = []byte(`//kage:unit pixels
package main
func Fragment(dstPos vec4, srcPos vec2, color vec4) vec4 {
return vec4(0)
}
`)