shaders

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VERBOSITY = 0
)

Functions

func TranspileWebGLShaders

func TranspileWebGLShaders(callerPath string, vertexPath *js.Word, vertexConsts map[string]jsv.Value,
	fragmentPath *js.Word, fragmentConsts map[string]jsv.Value) (string, string, error)

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 (b *ShaderBundle) InjectConsts(rtName string, consts map[string]jsv.Value, ctx context.Context) error

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

func (*ShaderBundle) Write

func (b *ShaderBundle) Write(nl string, tab string) (string, 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 (s *ShaderFileData) CollectVersion(version *glsl.Word) (*glsl.Word, error)

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

func (*ShaderFileData) Write

func (s *ShaderFileData) Write(usage glsl.Usage, nl string, tab string) (string, 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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL