mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
shader: Indexing with non-consntat value should be allowed
This commit is contained in:
parent
5dc0d4e1a4
commit
eacc9fac6a
@ -513,11 +513,9 @@ func (cs *compileState) parseExpr(block *block, expr ast.Expr) ([]shaderir.Expr,
|
|||||||
return nil, nil, nil, false
|
return nil, nil, nil, false
|
||||||
}
|
}
|
||||||
idx := exprs[0]
|
idx := exprs[0]
|
||||||
if idx.Type != shaderir.NumberExpr {
|
if idx.Type == shaderir.NumberExpr {
|
||||||
cs.addError(e.Pos(), fmt.Sprintf("an index must be a constant number"))
|
idx.ConstType = shaderir.ConstTypeInt
|
||||||
return nil, nil, nil, false
|
|
||||||
}
|
}
|
||||||
idx.ConstType = shaderir.ConstTypeInt
|
|
||||||
|
|
||||||
exprs, ts, ss, ok := cs.parseExpr(block, e.X)
|
exprs, ts, ss, ok := cs.parseExpr(block, e.X)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user