mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-09-26 20:11:28 +08:00
ebiten: skip DrawTriangles(Shader)32 when len(indices) == 0
Updates #3275
This commit is contained in:
8
image.go
8
image.go
@@ -611,6 +611,10 @@ func (i *Image) DrawTriangles32(vertices []Vertex, indices []uint32, img *Image,
|
||||
return
|
||||
}
|
||||
|
||||
if len(indices) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
i.invokeUsageCallbacks()
|
||||
img.invokeUsageCallbacks()
|
||||
|
||||
@@ -822,6 +826,10 @@ func (i *Image) DrawTrianglesShader32(vertices []Vertex, indices []uint32, shade
|
||||
panic("ebiten: the given shader to DrawTrianglesShader must not be disposed")
|
||||
}
|
||||
|
||||
if len(indices) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
i.invokeUsageCallbacks()
|
||||
if options != nil {
|
||||
for _, img := range options.Images {
|
||||
|
Reference in New Issue
Block a user