gpu: make Buffers immutable

The GPU implementation only uses immutable buffers so far, so let's
make it easy and performant for the backends.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-16 17:48:58 +01:00
parent 49365dbcc5
commit f62725ea77
4 changed files with 11 additions and 28 deletions
+3 -3
View File
@@ -380,14 +380,14 @@ func newBlitter(ctx Backend) *blitter {
if err != nil {
panic(err)
}
quadVerts := ctx.NewBuffer(BufferTypeData)
quadVerts.Upload(BufferUsageStaticDraw,
quadVerts := ctx.NewBuffer(BufferTypeData,
gunsafe.BytesView([]float32{
-1, +1, 0, 0,
+1, +1, 1, 0,
-1, -1, 0, 1,
+1, -1, 1, 1,
}))
}),
)
b := &blitter{
ctx: ctx,
prog: prog,