mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +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:
|
||||
return string(e.BuiltinFunc)
|
||||
case SwizzlingExpr:
|
||||
if !isValidSwizzling(e.Swizzling) {
|
||||
return fmt.Sprintf("?(unexpected swizzling: %s)", e.Swizzling)
|
||||
if !isValidSwizzling(e.Ident) {
|
||||
return fmt.Sprintf("?(unexpected swizzling: %s)", e.Ident)
|
||||
}
|
||||
return e.Swizzling
|
||||
return e.Ident
|
||||
case Ident:
|
||||
return e.Ident
|
||||
case Unary:
|
||||
|
@ -100,8 +100,8 @@ func builtinFuncExpr(f BuiltinFunc) Expr {
|
||||
|
||||
func swizzlingExpr(swizzling string) Expr {
|
||||
return Expr{
|
||||
Type: SwizzlingExpr,
|
||||
Swizzling: swizzling,
|
||||
Type: SwizzlingExpr,
|
||||
Ident: swizzling,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,6 @@ type Expr struct {
|
||||
Int int32
|
||||
Float float32
|
||||
BuiltinFunc BuiltinFunc
|
||||
Swizzling string
|
||||
Ident string
|
||||
Op Op
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user