mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
internal/shaderir: refactoring
This commit is contained in:
parent
ceb2bfc89c
commit
befe990562
@ -449,7 +449,11 @@ func (p *Program) appendReachableUniformVariablesFromBlock(indices []int, block
|
||||
f = func(expr *Expr) {
|
||||
switch expr.Type {
|
||||
case UniformVariable:
|
||||
if _, ok := indicesSet[expr.Index]; ok {
|
||||
return
|
||||
}
|
||||
indicesSet[expr.Index] = struct{}{}
|
||||
indices = append(indices, expr.Index)
|
||||
case FunctionExpr:
|
||||
if _, ok := visitedFuncs[expr.Index]; ok {
|
||||
return
|
||||
@ -460,9 +464,6 @@ func (p *Program) appendReachableUniformVariablesFromBlock(indices []int, block
|
||||
}
|
||||
walkExprs(f, block)
|
||||
|
||||
for i := range indicesSet {
|
||||
indices = append(indices, i)
|
||||
}
|
||||
return indices
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user