mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/graphicsdriver/opengl: Optimization: Avoid heap allocations
This commit is contained in:
parent
7b7791156c
commit
b74a4a0275
@ -517,7 +517,9 @@ func (c *context) uniformFloats(p program, location string, v []float32, typ sha
|
||||
gl.uniformMatrix4fv.Invoke(js.Value(l), false, arr.Call("subarray", 0, len(v)))
|
||||
}
|
||||
default:
|
||||
panic(fmt.Sprintf("opengl: unexpected type: %s", typ.String()))
|
||||
// Copy shaderir.Type value to avoid heap allocation of typ.
|
||||
t := typ
|
||||
panic(fmt.Sprintf("opengl: unexpected type: %s", t.String()))
|
||||
}
|
||||
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user