Documentation ¶
Index ¶
- Variables
- func TranspileWebGLShaders(callerPath string, vertexPath *js.Word, vertexConsts map[string]jsv.Value, ...) (string, string, error)
- type InitShaderFile
- type ShaderBundle
- func (b *ShaderBundle) Append(s ShaderFile)
- func (b *ShaderBundle) CollectVaryings(varyings map[string]string) error
- func (b *ShaderBundle) CollectVersion() error
- func (b *ShaderBundle) EvalTypes() error
- func (b *ShaderBundle) Finalize() error
- func (b *ShaderBundle) FindExportedConst(name string) *glsl.Const
- func (b *ShaderBundle) InjectConsts(rtName string, consts map[string]jsv.Value, ctx context.Context) error
- func (b *ShaderBundle) ResolveActivity() error
- func (b *ShaderBundle) ResolveDependencies() error
- func (b *ShaderBundle) ResolveNames() error
- func (b *ShaderBundle) UniqueNames() error
- func (b *ShaderBundle) Write(nl string, tab string) (string, error)
- type ShaderBundleScope
- func (bs *ShaderBundleScope) GetFunction() *glsl.Function
- func (bs *ShaderBundleScope) GetModule(absPath string) (glsl.Module, error)
- func (bs *ShaderBundleScope) GetVariable(name string) (glsl.Variable, error)
- func (bs *ShaderBundleScope) HasVariable(name string) bool
- func (bs *ShaderBundleScope) Parent() glsl.Scope
- func (bs *ShaderBundleScope) SetVariable(name string, v glsl.Variable) error
- type ShaderFile
- type ShaderFileData
- func (s *ShaderFileData) CollectVaryings(varyings map[string]string) error
- func (s *ShaderFileData) CollectVersion(version *glsl.Word) (*glsl.Word, error)
- func (s *ShaderFileData) Dependencies() []files.PathLang
- func (s *ShaderFileData) EvalTypes() error
- func (s *ShaderFileData) FinalizeInjected(usage glsl.Usage) error
- func (s *ShaderFileData) FindExportedConst(name string) *glsl.Const
- func (s *ShaderFileData) Module() glsl.Module
- func (s *ShaderFileData) Path() string
- func (s *ShaderFileData) ResolveActivity(usage glsl.Usage) error
- func (s *ShaderFileData) ResolveNames(scope glsl.GlobalScope) error
- func (s *ShaderFileData) UniqueEntryPointNames(ns glsl.Namespace) error
- func (s *ShaderFileData) UniqueNames(ns glsl.Namespace) error
- func (s *ShaderFileData) Write(usage glsl.Usage, nl string, tab string) (string, error)
- type ShaderFileSorter
Constants ¶
This section is empty.
Variables ¶
View Source
var (
VERBOSITY = 0
)
Functions ¶
Types ¶
type InitShaderFile ¶
type InitShaderFile struct { ShaderFileData // contains filtered or unexported fields }
func NewInitShaderFile ¶
func NewInitShaderFile(path string) (*InitShaderFile, error)
func (*InitShaderFile) FindExportedConst ¶
func (s *InitShaderFile) FindExportedConst(name string) *glsl.Const
func (*InitShaderFile) ResolveActivity ¶
func (s *InitShaderFile) ResolveActivity(usage glsl.Usage) error
func (*InitShaderFile) ResolveNames ¶
func (s *InitShaderFile) ResolveNames(scope glsl.GlobalScope) error
func (*InitShaderFile) UniqueEntryPointNames ¶
func (s *InitShaderFile) UniqueEntryPointNames(ns glsl.Namespace) error
type ShaderBundle ¶
type ShaderBundle struct {
// contains filtered or unexported fields
}
func NewShaderBundle ¶
func NewShaderBundle() *ShaderBundle
func (*ShaderBundle) Append ¶
func (b *ShaderBundle) Append(s ShaderFile)
func (*ShaderBundle) CollectVaryings ¶
func (b *ShaderBundle) CollectVaryings(varyings map[string]string) error
func (*ShaderBundle) CollectVersion ¶
func (b *ShaderBundle) CollectVersion() error
func (*ShaderBundle) EvalTypes ¶
func (b *ShaderBundle) EvalTypes() error
func (*ShaderBundle) Finalize ¶
func (b *ShaderBundle) Finalize() error
func (*ShaderBundle) FindExportedConst ¶
func (b *ShaderBundle) FindExportedConst(name string) *glsl.Const
func (*ShaderBundle) InjectConsts ¶
func (*ShaderBundle) ResolveActivity ¶
func (b *ShaderBundle) ResolveActivity() error
func (*ShaderBundle) ResolveDependencies ¶
func (b *ShaderBundle) ResolveDependencies() error
func (*ShaderBundle) ResolveNames ¶
func (b *ShaderBundle) ResolveNames() error
func (*ShaderBundle) UniqueNames ¶
func (b *ShaderBundle) UniqueNames() error
type ShaderBundleScope ¶
type ShaderBundleScope struct {
// contains filtered or unexported fields
}
func (*ShaderBundleScope) GetFunction ¶
func (bs *ShaderBundleScope) GetFunction() *glsl.Function
func (*ShaderBundleScope) GetModule ¶
func (bs *ShaderBundleScope) GetModule(absPath string) (glsl.Module, error)
caller can be taken from a context
func (*ShaderBundleScope) GetVariable ¶
func (bs *ShaderBundleScope) GetVariable(name string) (glsl.Variable, error)
func (*ShaderBundleScope) HasVariable ¶
func (bs *ShaderBundleScope) HasVariable(name string) bool
func (*ShaderBundleScope) Parent ¶
func (bs *ShaderBundleScope) Parent() glsl.Scope
func (*ShaderBundleScope) SetVariable ¶
func (bs *ShaderBundleScope) SetVariable(name string, v glsl.Variable) error
type ShaderFile ¶
type ShaderFile interface { Write(usage glsl.Usage, nl string, tab string) (string, error) Dependencies() []files.PathLang // src fields in script or call ResolveNames(scope glsl.GlobalScope) error EvalTypes() error ResolveActivity(usage glsl.Usage) error FinalizeInjected(usage glsl.Usage) error UniqueEntryPointNames(ns glsl.Namespace) error UniqueNames(ns glsl.Namespace) error CollectVersion(version *glsl.Word) (*glsl.Word, error) CollectVaryings(varyings map[string]string) error FindExportedConst(name string) *glsl.Const Module() glsl.Module Path() string }
func NewShaderFile ¶
func NewShaderFile(absPath string) (ShaderFile, error)
type ShaderFileData ¶
type ShaderFileData struct {
// contains filtered or unexported fields
}
func (*ShaderFileData) CollectVaryings ¶
func (s *ShaderFileData) CollectVaryings(varyings map[string]string) error
func (*ShaderFileData) CollectVersion ¶
func (*ShaderFileData) Dependencies ¶
func (s *ShaderFileData) Dependencies() []files.PathLang
func (*ShaderFileData) EvalTypes ¶
func (s *ShaderFileData) EvalTypes() error
func (*ShaderFileData) FinalizeInjected ¶
func (s *ShaderFileData) FinalizeInjected(usage glsl.Usage) error
func (*ShaderFileData) FindExportedConst ¶
func (s *ShaderFileData) FindExportedConst(name string) *glsl.Const
func (*ShaderFileData) Module ¶
func (s *ShaderFileData) Module() glsl.Module
func (*ShaderFileData) Path ¶
func (s *ShaderFileData) Path() string
func (*ShaderFileData) ResolveActivity ¶
func (s *ShaderFileData) ResolveActivity(usage glsl.Usage) error
func (*ShaderFileData) ResolveNames ¶
func (s *ShaderFileData) ResolveNames(scope glsl.GlobalScope) error
func (*ShaderFileData) UniqueEntryPointNames ¶
func (s *ShaderFileData) UniqueEntryPointNames(ns glsl.Namespace) error
func (*ShaderFileData) UniqueNames ¶
func (s *ShaderFileData) UniqueNames(ns glsl.Namespace) error
type ShaderFileSorter ¶
type ShaderFileSorter struct {
// contains filtered or unexported fields
}
func NewShaderFileSorter ¶
func NewShaderFileSorter(fs []ShaderFile) *ShaderFileSorter
func (*ShaderFileSorter) Len ¶
func (fss *ShaderFileSorter) Len() int
func (*ShaderFileSorter) Less ¶
func (fss *ShaderFileSorter) Less(i, j int) bool
func (*ShaderFileSorter) Result ¶
func (fss *ShaderFileSorter) Result() []ShaderFile
func (*ShaderFileSorter) Swap ¶
func (fss *ShaderFileSorter) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.