mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 10:42:42 +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:
|
||||
return fmt.Sprintf("M%d", e.Index)
|
||||
case BuiltinFuncExpr:
|
||||
return string(e.BuiltinFunc)
|
||||
return e.BuiltinFunc.Glsl()
|
||||
case SwizzlingExpr:
|
||||
if !isValidSwizzling(e.Swizzling) {
|
||||
return fmt.Sprintf("?(unexpected swizzling: %s)", e.Swizzling)
|
||||
|
@ -307,3 +307,20 @@ func ParseBuiltinFunc(str string) (BuiltinFunc, bool) {
|
||||
}
|
||||
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