mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
shader: Remove variable.init
This commit is contained in:
parent
147c82f212
commit
e14cd559b6
@ -27,7 +27,6 @@ import (
|
||||
type variable struct {
|
||||
name string
|
||||
typ typ
|
||||
init shaderir.Expr
|
||||
}
|
||||
|
||||
type constant struct {
|
||||
@ -255,10 +254,11 @@ func (s *compileState) parseVariable(block *block, vs *ast.ValueSpec) []variable
|
||||
if init != nil {
|
||||
e = s.parseExpr(block, init)
|
||||
}
|
||||
// TODO: Add an assign statement for e.
|
||||
_ = e
|
||||
vars = append(vars, variable{
|
||||
name: name,
|
||||
typ: t,
|
||||
init: e,
|
||||
})
|
||||
}
|
||||
return vars
|
||||
@ -430,14 +430,13 @@ func (cs *compileState) parseBlock(outer *block, b *ast.BlockStmt, inParams, out
|
||||
name: e.(*ast.Ident).Name,
|
||||
}
|
||||
v.typ = cs.detectType(block, l.Rhs[i])
|
||||
v.init = cs.parseExpr(block, l.Rhs[i])
|
||||
block.vars = append(block.vars, v)
|
||||
block.ir.LocalVars = append(block.ir.LocalVars, v.typ.ir)
|
||||
block.ir.Stmts = append(block.ir.Stmts, shaderir.Stmt{
|
||||
Type: shaderir.Assign,
|
||||
Exprs: []shaderir.Expr{
|
||||
cs.parseExpr(block, l.Lhs[i]),
|
||||
v.init,
|
||||
cs.parseExpr(block, l.Rhs[i]),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user