shaderir: Remove bultin functions for bvec

This commit is contained in:
Hajime Hoshi 2020-08-05 01:41:06 +09:00
parent fb59901609
commit c22ec580bc
2 changed files with 45 additions and 73 deletions

View File

@ -65,16 +65,6 @@ func basicTypeString(t shaderir.BasicType) string {
func builtinFuncString(f shaderir.BuiltinFunc) string {
switch f {
case shaderir.LessThan:
return "lessThan"
case shaderir.LessThanEqual:
return "lessThanEqual"
case shaderir.GreaterThan:
return "greaterThan"
case shaderir.GreaterThanEqual:
return "greaterThanEqual"
case shaderir.NotEqual:
return "notEqual"
case shaderir.Dfdx:
return "dFdx"
case shaderir.Dfdy:

View File

@ -196,60 +196,51 @@ func OpFromToken(t token.Token) (Op, bool) {
type BuiltinFunc string
const (
Vec2F BuiltinFunc = "vec2"
Vec3F BuiltinFunc = "vec3"
Vec4F BuiltinFunc = "vec4"
Mat2F BuiltinFunc = "mat2"
Mat3F BuiltinFunc = "mat3"
Mat4F BuiltinFunc = "mat4"
Radians BuiltinFunc = "radians"
Degrees BuiltinFunc = "degrees"
Sin BuiltinFunc = "sin"
Cos BuiltinFunc = "cos"
Tan BuiltinFunc = "tan"
Asin BuiltinFunc = "asin"
Acos BuiltinFunc = "acos"
Atan BuiltinFunc = "atan"
Pow BuiltinFunc = "pow"
Exp BuiltinFunc = "exp"
Log BuiltinFunc = "log"
Exp2 BuiltinFunc = "exp2"
Log2 BuiltinFunc = "log2"
Sqrt BuiltinFunc = "sqrt"
Inversesqrt BuiltinFunc = "inversesqrt"
Abs BuiltinFunc = "abs"
Sign BuiltinFunc = "sign"
Floor BuiltinFunc = "floor"
Ceil BuiltinFunc = "ceil"
Fract BuiltinFunc = "fract"
Mod BuiltinFunc = "mod"
Min BuiltinFunc = "min"
Max BuiltinFunc = "max"
Clamp BuiltinFunc = "clamp"
Mix BuiltinFunc = "mix"
Step BuiltinFunc = "step"
Smoothstep BuiltinFunc = "smoothstep"
Length BuiltinFunc = "length"
Distance BuiltinFunc = "distance"
Dot BuiltinFunc = "dot"
Cross BuiltinFunc = "cross"
Normalize BuiltinFunc = "normalize"
Faceforward BuiltinFunc = "faceforward"
Reflect BuiltinFunc = "reflect"
Transpose BuiltinFunc = "transpose"
LessThan BuiltinFunc = "lessthan"
LessThanEqual BuiltinFunc = "lessthanequal"
GreaterThan BuiltinFunc = "greaterthan"
GreaterThanEqual BuiltinFunc = "greaterthanequal"
Equal BuiltinFunc = "equal"
NotEqual BuiltinFunc = "notequal"
Any BuiltinFunc = "any"
All BuiltinFunc = "all"
Not BuiltinFunc = "not"
Texture2DF BuiltinFunc = "texture2D"
Dfdx BuiltinFunc = "dfdx"
Dfdy BuiltinFunc = "dfdy"
Fwidth BuiltinFunc = "fwidth"
Vec2F BuiltinFunc = "vec2"
Vec3F BuiltinFunc = "vec3"
Vec4F BuiltinFunc = "vec4"
Mat2F BuiltinFunc = "mat2"
Mat3F BuiltinFunc = "mat3"
Mat4F BuiltinFunc = "mat4"
Radians BuiltinFunc = "radians"
Degrees BuiltinFunc = "degrees"
Sin BuiltinFunc = "sin"
Cos BuiltinFunc = "cos"
Tan BuiltinFunc = "tan"
Asin BuiltinFunc = "asin"
Acos BuiltinFunc = "acos"
Atan BuiltinFunc = "atan"
Pow BuiltinFunc = "pow"
Exp BuiltinFunc = "exp"
Log BuiltinFunc = "log"
Exp2 BuiltinFunc = "exp2"
Log2 BuiltinFunc = "log2"
Sqrt BuiltinFunc = "sqrt"
Inversesqrt BuiltinFunc = "inversesqrt"
Abs BuiltinFunc = "abs"
Sign BuiltinFunc = "sign"
Floor BuiltinFunc = "floor"
Ceil BuiltinFunc = "ceil"
Fract BuiltinFunc = "fract"
Mod BuiltinFunc = "mod"
Min BuiltinFunc = "min"
Max BuiltinFunc = "max"
Clamp BuiltinFunc = "clamp"
Mix BuiltinFunc = "mix"
Step BuiltinFunc = "step"
Smoothstep BuiltinFunc = "smoothstep"
Length BuiltinFunc = "length"
Distance BuiltinFunc = "distance"
Dot BuiltinFunc = "dot"
Cross BuiltinFunc = "cross"
Normalize BuiltinFunc = "normalize"
Faceforward BuiltinFunc = "faceforward"
Reflect BuiltinFunc = "reflect"
Transpose BuiltinFunc = "transpose"
Texture2DF BuiltinFunc = "texture2D"
Dfdx BuiltinFunc = "dfdx"
Dfdy BuiltinFunc = "dfdy"
Fwidth BuiltinFunc = "fwidth"
)
func ParseBuiltinFunc(str string) (BuiltinFunc, bool) {
@ -295,15 +286,6 @@ func ParseBuiltinFunc(str string) (BuiltinFunc, bool) {
Faceforward,
Reflect,
Transpose,
LessThan,
LessThanEqual,
GreaterThan,
GreaterThanEqual,
Equal,
NotEqual,
Any,
All,
Not,
Texture2DF,
Dfdx,
Dfdy,