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) {
|
f = func(expr *Expr) {
|
||||||
switch expr.Type {
|
switch expr.Type {
|
||||||
case UniformVariable:
|
case UniformVariable:
|
||||||
|
if _, ok := indicesSet[expr.Index]; ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
indicesSet[expr.Index] = struct{}{}
|
indicesSet[expr.Index] = struct{}{}
|
||||||
|
indices = append(indices, expr.Index)
|
||||||
case FunctionExpr:
|
case FunctionExpr:
|
||||||
if _, ok := visitedFuncs[expr.Index]; ok {
|
if _, ok := visitedFuncs[expr.Index]; ok {
|
||||||
return
|
return
|
||||||
@ -460,9 +464,6 @@ func (p *Program) appendReachableUniformVariablesFromBlock(indices []int, block
|
|||||||
}
|
}
|
||||||
walkExprs(f, block)
|
walkExprs(f, block)
|
||||||
|
|
||||||
for i := range indicesSet {
|
|
||||||
indices = append(indices, i)
|
|
||||||
}
|
|
||||||
return indices
|
return indices
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user