mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
internal/shader: change the naming convention: Num -> Count
This commit is contained in:
parent
afed6a83c6
commit
dce34d2306
@ -517,7 +517,7 @@ func (cs *compileState) parseExpr(block *block, expr ast.Expr, markLocalVariable
|
|||||||
|
|
||||||
var outParams []int
|
var outParams []int
|
||||||
for _, p := range f.ir.OutParams {
|
for _, p := range f.ir.OutParams {
|
||||||
idx := block.totalLocalVariableNum()
|
idx := block.totalLocalVariableCount()
|
||||||
block.vars = append(block.vars, variable{
|
block.vars = append(block.vars, variable{
|
||||||
typ: p,
|
typ: p,
|
||||||
})
|
})
|
||||||
@ -736,7 +736,7 @@ func (cs *compileState) parseExpr(block *block, expr ast.Expr, markLocalVariable
|
|||||||
t.Length = len(e.Elts)
|
t.Length = len(e.Elts)
|
||||||
}
|
}
|
||||||
|
|
||||||
idx := block.totalLocalVariableNum()
|
idx := block.totalLocalVariableCount()
|
||||||
block.vars = append(block.vars, variable{
|
block.vars = append(block.vars, variable{
|
||||||
typ: t,
|
typ: t,
|
||||||
})
|
})
|
||||||
|
@ -95,10 +95,10 @@ type block struct {
|
|||||||
ir *shaderir.Block
|
ir *shaderir.Block
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *block) totalLocalVariableNum() int {
|
func (b *block) totalLocalVariableCount() int {
|
||||||
c := len(b.vars)
|
c := len(b.vars)
|
||||||
if b.outer != nil {
|
if b.outer != nil {
|
||||||
c += b.outer.totalLocalVariableNum()
|
c += b.outer.totalLocalVariableCount()
|
||||||
}
|
}
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@ func (cs *compileState) parseDecl(b *block, d ast.Decl) ([]shaderir.Stmt, bool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// base must be obtained before adding the variables.
|
// base must be obtained before adding the variables.
|
||||||
base := b.totalLocalVariableNum()
|
base := b.totalLocalVariableCount()
|
||||||
for _, v := range vs {
|
for _, v := range vs {
|
||||||
b.addNamedLocalVariable(v.name, v.typ, d.Pos())
|
b.addNamedLocalVariable(v.name, v.typ, d.Pos())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user