mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
shader: Bug fix: a blank identifier lhs and += cannot work
This commit is contained in:
parent
fd51abfb0d
commit
e1d8629189
@ -81,7 +81,7 @@ func (cs *compileState) parseStmt(block *block, fname string, stmt ast.Stmt, inP
|
|||||||
}
|
}
|
||||||
stmts = append(stmts, ss...)
|
stmts = append(stmts, ss...)
|
||||||
|
|
||||||
lhs, ts, ss, ok := cs.parseExpr(block, stmt.Lhs[0], false)
|
lhs, ts, ss, ok := cs.parseExpr(block, stmt.Lhs[0], true)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
@ -642,6 +642,16 @@ func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
|||||||
_++
|
_++
|
||||||
return vec4(0)
|
return vec4(0)
|
||||||
}
|
}
|
||||||
|
`)); err == nil {
|
||||||
|
t.Errorf("error must be non-nil but was nil")
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := NewShader([]byte(`package main
|
||||||
|
|
||||||
|
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||||
|
_ += 1
|
||||||
|
return vec4(0)
|
||||||
|
}
|
||||||
`)); err == nil {
|
`)); err == nil {
|
||||||
t.Errorf("error must be non-nil but was nil")
|
t.Errorf("error must be non-nil but was nil")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user