mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-12 22:17:26 +01:00
Revert "internal/graphicscommand: clear the queue regardless of an error"
This reverts commit e21636fbb9
.
Reason: Simply this is no longer needed. We gave up testing when an error
occurs in a graphics command queue.
This commit is contained in:
parent
31104c4e79
commit
5e973ab419
@ -224,23 +224,6 @@ func (q *commandQueue) flush(graphicsDriver graphicsdriver.Graphics) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
|
||||||
// Release the commands explicitly (#1803).
|
|
||||||
// Apparently, the part of a slice between len and cap-1 still holds references.
|
|
||||||
// Then, resetting the length by [:0] doesn't release the references.
|
|
||||||
for i, c := range q.commands {
|
|
||||||
if c, ok := c.(*drawTrianglesCommand); ok {
|
|
||||||
q.drawTrianglesCommandPool.put(c)
|
|
||||||
}
|
|
||||||
q.commands[i] = nil
|
|
||||||
}
|
|
||||||
q.commands = q.commands[:0]
|
|
||||||
q.nvertices = 0
|
|
||||||
q.nindices = 0
|
|
||||||
q.tmpNumVertexFloats = 0
|
|
||||||
q.tmpNumIndices = 0
|
|
||||||
}()
|
|
||||||
|
|
||||||
es := q.indices
|
es := q.indices
|
||||||
vs := q.vertices
|
vs := q.vertices
|
||||||
debug.Logf("Graphics commands:\n")
|
debug.Logf("Graphics commands:\n")
|
||||||
@ -340,6 +323,21 @@ func (q *commandQueue) flush(graphicsDriver graphicsdriver.Graphics) error {
|
|||||||
cs = cs[nc:]
|
cs = cs[nc:]
|
||||||
}
|
}
|
||||||
graphicsDriver.End(present)
|
graphicsDriver.End(present)
|
||||||
|
|
||||||
|
// Release the commands explicitly (#1803).
|
||||||
|
// Apparently, the part of a slice between len and cap-1 still holds references.
|
||||||
|
// Then, resetting the length by [:0] doesn't release the references.
|
||||||
|
for i, c := range q.commands {
|
||||||
|
if c, ok := c.(*drawTrianglesCommand); ok {
|
||||||
|
q.drawTrianglesCommandPool.put(c)
|
||||||
|
}
|
||||||
|
q.commands[i] = nil
|
||||||
|
}
|
||||||
|
q.commands = q.commands[:0]
|
||||||
|
q.nvertices = 0
|
||||||
|
q.nindices = 0
|
||||||
|
q.tmpNumVertexFloats = 0
|
||||||
|
q.tmpNumIndices = 0
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user