mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
gpu: [compute] support unlimited number of materials and images
This change extends the atlas allocation machinery to images and materials. Updates gio#219 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+558
-423
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@ package scene
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
"math"
|
"math"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
@@ -179,10 +180,13 @@ func FillColor(col color.RGBA) Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func FillImage(index int) Command {
|
func FillImage(index int, offset image.Point) Command {
|
||||||
|
x := int16(offset.X)
|
||||||
|
y := int16(offset.Y)
|
||||||
return Command{
|
return Command{
|
||||||
0: uint32(OpFillImage),
|
0: uint32(OpFillImage),
|
||||||
1: uint32(index),
|
1: uint32(index),
|
||||||
|
2: uint32(uint16(x)) | uint32(uint16(y))<<16,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user