mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 16:35:36 +00:00
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:
+1
-7
@@ -22,7 +22,7 @@ type Backend interface {
|
||||
DefaultFramebuffer() Framebuffer
|
||||
NilTexture() Texture
|
||||
NewFramebuffer() Framebuffer
|
||||
NewBuffer(typ BufferType) Buffer
|
||||
NewBuffer(typ BufferType, data []byte) Buffer
|
||||
NewProgram(vertexShader, fragmentShader string, attribMap []string) (Program, error)
|
||||
SetupVertexArray(slot int, size int, dataType DataType, stride, offset int)
|
||||
|
||||
@@ -49,7 +49,6 @@ type TextureFilter uint8
|
||||
type TextureFormat uint8
|
||||
|
||||
type BufferType uint8
|
||||
type BufferUsage uint8
|
||||
|
||||
type DataType uint8
|
||||
|
||||
@@ -76,7 +75,6 @@ type Uniform interface{}
|
||||
|
||||
type Buffer interface {
|
||||
Bind()
|
||||
Upload(usage BufferUsage, data []byte)
|
||||
Release()
|
||||
}
|
||||
|
||||
@@ -116,10 +114,6 @@ const (
|
||||
DataTypeShort
|
||||
)
|
||||
|
||||
const (
|
||||
BufferUsageStaticDraw BufferUsage = iota
|
||||
)
|
||||
|
||||
const (
|
||||
BufferTypeIndices BufferType = iota
|
||||
BufferTypeData
|
||||
|
||||
Reference in New Issue
Block a user