|
@@ -15,10 +15,9 @@ import (
|
|
|
"strconv"
|
|
"strconv"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
-const GLSL_VERSION = "330 core"
|
|
|
|
|
-
|
|
|
|
|
// Regular expression to parse #include <name> [quantity] directive
|
|
// Regular expression to parse #include <name> [quantity] directive
|
|
|
var rexInclude *regexp.Regexp
|
|
var rexInclude *regexp.Regexp
|
|
|
|
|
+
|
|
|
const indexParameter = "{i}"
|
|
const indexParameter = "{i}"
|
|
|
|
|
|
|
|
func init() {
|
|
func init() {
|
|
@@ -245,7 +244,6 @@ func (sm *Shaman) GenProgram(specs *ShaderSpecs) (*gls.Program, error) {
|
|
|
return prog, nil
|
|
return prog, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
func (sm *Shaman) preprocess(source string, defines map[string]string) (string, error) {
|
|
func (sm *Shaman) preprocess(source string, defines map[string]string) (string, error) {
|
|
|
|
|
|
|
|
// If defines map supplied, generate prefix with glsl version directive first,
|
|
// If defines map supplied, generate prefix with glsl version directive first,
|
|
@@ -258,10 +256,9 @@ func (sm *Shaman) preprocess(source string, defines map[string]string) (string,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return sm.processIncludes(prefix + source, defines)
|
|
|
|
|
|
|
+ return sm.processIncludes(prefix+source, defines)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// preprocess preprocesses the specified source prefixing it with optional defines directives
|
|
// preprocess preprocesses the specified source prefixing it with optional defines directives
|
|
|
// contained in "defines" parameter and replaces '#include <name>' directives
|
|
// contained in "defines" parameter and replaces '#include <name>' directives
|
|
|
// by the respective source code of include chunk of the specified name.
|
|
// by the respective source code of include chunk of the specified name.
|