mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +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)))
|
gl.uniformMatrix4fv.Invoke(js.Value(l), false, arr.Call("subarray", 0, len(v)))
|
||||||
}
|
}
|
||||||
default:
|
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
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user