Documentation ¶
Overview ¶
Package glsl contains routines for manipulation of OpenGL ES Shading Language programs.
It exposes functions for parsing, serializing and evaluating GLES Shading Language programs. While this package contains a number of sub-packages, the only sub-package which is expected to be imported directly is the ast package, which contains the definitions of the AST of the parsed program. The main functionality of the other packages is exposed through the functions of this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Analyze ¶
func Analyze(program interface{}) (err []error)
Analyze performs semantic analysis on the parsed program AST. It computes the types of all program expression, array sizes and values of constant variables. Any encountered errors are returned as a result.
func Formatter ¶
Formatter is a helper function which turns any AST node into something that can be printed with %v. The returned object's default format will print the tree under the ast node in a reindented form. The alternate format flag (%#v) will print the node while preserving original whitespace, if this is present in the ***Cst nodes of the tree.
Types ¶
type Version ¶
type Version struct {
Major, Minor, Point int
}
Version describes a GLSL shader version.
func Parse ¶
func Parse(src string, lang ast.Language) (program interface{}, version Version, extensions []pp.Extension, err []error)
Parse preprocesses and parses an OpenGL ES Shading language program present in the first argument. The second argument specifies the language, whose syntax to employ during parsing. The parsed AST is returned in the first result. If any parsing errors are encountered, they are returned in the second result.
func ParseVersion ¶
ParseVersion parses and returns the Version from the string s.
func (Version) GreaterThan ¶
GreaterThan returns true if this Version is greater than Version{major, minor}.
Directories ¶
Path | Synopsis |
---|---|
Package ast defines the abstract syntax tree of OpenGL ES Shading Language programs.
|
Package ast defines the abstract syntax tree of OpenGL ES Shading Language programs. |
Package builtins contains the definitions of all OpenGL ES Shading Language builtin functions.
|
Package builtins contains the definitions of all OpenGL ES Shading Language builtin functions. |
Package evaluator is responsible for evaluating expressions in OpenGL ES Shading Language programs.
|
Package evaluator is responsible for evaluating expressions in OpenGL ES Shading Language programs. |
Package parser implements parsing and serializing an OpenGL ES Shading Language programs.
|
Package parser implements parsing and serializing an OpenGL ES Shading Language programs. |
Package preprocessor defines the preprocessor for the OpenGL ES Shading Language.
|
Package preprocessor defines the preprocessor for the OpenGL ES Shading Language. |
Package sema performs semantic checking of OpenGL ES Shading Language programs.
|
Package sema performs semantic checking of OpenGL ES Shading Language programs. |