mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 07:57:29 +00:00
gpu/gl: fix offset calculation in DrawElements
The offset argument to DrawElements is in 16-bit shorts, while the underlying DrawElements use byte offsets. No users of DrawElements use a non-zero offset, so nothing changed. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-1
@@ -274,7 +274,9 @@ func (b *Backend) SetBlend(enable bool) {
|
||||
|
||||
func (b *Backend) DrawElements(mode gpu.DrawMode, off, count int) {
|
||||
b.prepareDraw()
|
||||
b.funcs.DrawElements(toGLDrawMode(mode), count, UNSIGNED_SHORT, off)
|
||||
// off is in 16-bit indices, but DrawElements take a byte offset.
|
||||
byteOff := off * 2
|
||||
b.funcs.DrawElements(toGLDrawMode(mode), count, UNSIGNED_SHORT, byteOff)
|
||||
}
|
||||
|
||||
func (b *Backend) DrawArrays(mode gpu.DrawMode, off, count int) {
|
||||
|
||||
Reference in New Issue
Block a user