mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
parent
b1048025d9
commit
39aaf7fe37
4
image.go
4
image.go
@ -38,10 +38,10 @@ type Image struct {
|
|||||||
original *Image
|
original *Image
|
||||||
bounds image.Rectangle
|
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
|
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
|
tmpUniforms []uint32
|
||||||
|
|
||||||
// Do not add a 'buffering' member that are resolved lazily.
|
// 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.tmpNumVertexFloats += len(vertices)
|
||||||
q.tmpNumIndices += len(indices)
|
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)
|
uniforms = q.prependPreservedUniforms(uniforms, shader, dst, srcs, offsets, dstRegion, srcRegion)
|
||||||
|
|
||||||
// Remove unused uniform variables so that more commands can be merged.
|
// Remove unused uniform variables so that more commands can be merged.
|
||||||
|
Loading…
Reference in New Issue
Block a user