mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
shaderir: Refactoring
This commit is contained in:
parent
e1d0800f19
commit
8a6140a92f
@ -228,10 +228,10 @@ func (p *Program) glslBlock(b *Block, level int, localVarIndex int) []string {
|
|||||||
case BuiltinFuncExpr:
|
case BuiltinFuncExpr:
|
||||||
return string(e.BuiltinFunc)
|
return string(e.BuiltinFunc)
|
||||||
case SwizzlingExpr:
|
case SwizzlingExpr:
|
||||||
if !isValidSwizzling(e.Swizzling) {
|
if !isValidSwizzling(e.Ident) {
|
||||||
return fmt.Sprintf("?(unexpected swizzling: %s)", e.Swizzling)
|
return fmt.Sprintf("?(unexpected swizzling: %s)", e.Ident)
|
||||||
}
|
}
|
||||||
return e.Swizzling
|
return e.Ident
|
||||||
case Ident:
|
case Ident:
|
||||||
return e.Ident
|
return e.Ident
|
||||||
case Unary:
|
case Unary:
|
||||||
|
@ -101,7 +101,7 @@ func builtinFuncExpr(f BuiltinFunc) Expr {
|
|||||||
func swizzlingExpr(swizzling string) Expr {
|
func swizzlingExpr(swizzling string) Expr {
|
||||||
return Expr{
|
return Expr{
|
||||||
Type: SwizzlingExpr,
|
Type: SwizzlingExpr,
|
||||||
Swizzling: swizzling,
|
Ident: swizzling,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,6 @@ type Expr struct {
|
|||||||
Int int32
|
Int int32
|
||||||
Float float32
|
Float float32
|
||||||
BuiltinFunc BuiltinFunc
|
BuiltinFunc BuiltinFunc
|
||||||
Swizzling string
|
|
||||||
Ident string
|
Ident string
|
||||||
Op Op
|
Op Op
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user