mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
b1048025d9
commit
39aaf7fe37
4
image.go
4
image.go
@ -38,10 +38,10 @@ type Image struct {
|
||||
original *Image
|
||||
bounds image.Rectangle
|
||||
|
||||
// tmpVertices must not be reused until the vertices are sent to the graphics command queue.
|
||||
// tmpVertices must not be reused until ui.Image.Draw* is called.
|
||||
tmpVertices []float32
|
||||
|
||||
// tmpUniforms must not be reused until the vertices are sent to the graphics command queue.
|
||||
// tmpUniforms must not be reused until ui.Image.Draw* is called.
|
||||
tmpUniforms []uint32
|
||||
|
||||
// Do not add a 'buffering' member that are resolved lazily.
|
||||
|
@ -110,6 +110,9 @@ func (q *commandQueue) EnqueueDrawTrianglesCommand(dst *Image, srcs [graphics.Sh
|
||||
q.tmpNumVertexFloats += len(vertices)
|
||||
q.tmpNumIndices += len(indices)
|
||||
|
||||
// prependPreservedUniforms not only prepends values to the given slice but also creates a new slice.
|
||||
// Allocating a new slice is necessary to make EnqueueDrawTrianglesCommand safe so far.
|
||||
// TODO: This might cause a performance issue (#2601).
|
||||
uniforms = q.prependPreservedUniforms(uniforms, shader, dst, srcs, offsets, dstRegion, srcRegion)
|
||||
|
||||
// Remove unused uniform variables so that more commands can be merged.
|
||||
|
Loading…
Reference in New Issue
Block a user