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:
Elias Naur
2021-08-22 13:48:12 +02:00
parent 1d7ed55c29
commit 06ffa42d16
2 changed files with 563 additions and 424 deletions
+558 -423
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -6,6 +6,7 @@ package scene
import (
"fmt"
"image"
"image/color"
"math"
"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{
0: uint32(OpFillImage),
1: uint32(index),
2: uint32(uint16(x)) | uint32(uint16(y))<<16,
}
}