From 191caa5f7893075ff375ee46f067f85b5c674293 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 8 Dec 2024 23:40:37 +0900 Subject: [PATCH] internal/builtinshader: add a comment to the generated file --- internal/builtinshader/defs.go | 4 ++++ internal/builtinshader/gen.go | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/internal/builtinshader/defs.go b/internal/builtinshader/defs.go index 0683fea87..3c94fe4e1 100644 --- a/internal/builtinshader/defs.go +++ b/internal/builtinshader/defs.go @@ -14,6 +14,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +// This file is intended for precompiled shaders that will be introduced in the future. +// All constant names are underscores and not actually used, +// so they do not affect the binary file size. + package builtinshader //ebitengine:shader diff --git a/internal/builtinshader/gen.go b/internal/builtinshader/gen.go index 993f9197f..2b81df832 100644 --- a/internal/builtinshader/gen.go +++ b/internal/builtinshader/gen.go @@ -46,6 +46,11 @@ const license = `// Copyright 2024 The Ebitengine Authors // limitations under the License. ` +const note = `// This file is intended for precompiled shaders that will be introduced in the future. +// All constant names are underscores and not actually used, +// so they do not affect the binary file size. +` + func xmain() error { f, err := os.Create("defs.go") if err != nil { @@ -61,6 +66,12 @@ func xmain() error { if _, err := w.WriteString(license); err != nil { return err } + if _, err := w.WriteString("\n"); err != nil { + return err + } + if _, err := w.WriteString(note); err != nil { + return err + } if _, err := w.WriteString("\npackage builtinshader\n"); err != nil { return err }