graphics: Bug fix: invalid calc of num of quads

This commit is contained in:
Hajime Hoshi 2016-11-02 02:08:12 +09:00
parent 34e85b0041
commit b2be6681d4

View File

@ -133,7 +133,7 @@ func (q *commandQueue) Flush(context *opengl.Context) error {
}
// NOTE: WebGL doesn't seem to have Check gl.MAX_ELEMENTS_VERTICES or gl.MAX_ELEMENTS_INDICES so far.
// Let's use them to compare to len(quads) in the future.
if maxQuads < len(vertices)/QuadVertexSizeInBytes() {
if maxQuads < len(vertices)*2/QuadVertexSizeInBytes() {
return fmt.Errorf("len(quads) must be equal to or less than %d", maxQuads)
}
numc := len(g)