-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuffer.go
More file actions
34 lines (25 loc) · 906 Bytes
/
buffer.go
File metadata and controls
34 lines (25 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package webgpu
import "github.com/bluescreen10/webgpu-go/driver"
// Specifies the options to use to create a Buffer
type BufferDescriptor = driver.BufferDescriptor
// A buffer represents a block of memory that can be used in GPU operations.
// Corrensponds to: https://www.w3.org/TR/webgpu/#gpubuffer.
type Buffer struct {
size uint64
usage BufferUsage
mapState MapState
buffer driver.Buffer
}
// // Returns the size of the buffer.
// Size() uint64
// // Returns the usage flags of the buffer.
// Usage() BufferUsage
// // Returns the current map state of the buffer.
// MapState() MapState
// // Returns the mapped range of this buffer
// GetMappedRange(offset, size uint64) []byte
// // Unmaps the mapped range of the GPUBuffer and makes its contents available for use by the GPU again.
// Unmap()
// // Destroys the buffer and releases gpu resources.
// Destroy()
// }