mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 03:02:49 +01:00
shaderir: Bug fix: Wrong function names for some bulitin funcs
This commit is contained in:
parent
776de77744
commit
aecd29325e
@ -307,7 +307,7 @@ func (p *Program) glslBlock(topBlock, block *Block, level int, localVarIndex int
|
|||||||
case StructMember:
|
case StructMember:
|
||||||
return fmt.Sprintf("M%d", e.Index)
|
return fmt.Sprintf("M%d", e.Index)
|
||||||
case BuiltinFuncExpr:
|
case BuiltinFuncExpr:
|
||||||
return string(e.BuiltinFunc)
|
return e.BuiltinFunc.Glsl()
|
||||||
case SwizzlingExpr:
|
case SwizzlingExpr:
|
||||||
if !isValidSwizzling(e.Swizzling) {
|
if !isValidSwizzling(e.Swizzling) {
|
||||||
return fmt.Sprintf("?(unexpected swizzling: %s)", e.Swizzling)
|
return fmt.Sprintf("?(unexpected swizzling: %s)", e.Swizzling)
|
||||||
|
@ -307,3 +307,20 @@ func ParseBuiltinFunc(str string) (BuiltinFunc, bool) {
|
|||||||
}
|
}
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f BuiltinFunc) Glsl() string {
|
||||||
|
switch f {
|
||||||
|
case LessThan:
|
||||||
|
return "lessThan"
|
||||||
|
case LessThanEqual:
|
||||||
|
return "lessThanEqual"
|
||||||
|
case GreaterThan:
|
||||||
|
return "greaterThan"
|
||||||
|
case GreaterThanEqual:
|
||||||
|
return "greaterThanEqual"
|
||||||
|
case NotEqual:
|
||||||
|
return "notEqual"
|
||||||
|
default:
|
||||||
|
return string(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user