-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathbind_rust.go
More file actions
69 lines (60 loc) · 1.42 KB
/
Copy pathbind_rust.go
File metadata and controls
69 lines (60 loc) · 1.42 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//go:build rust
package wgpu
import rwgpu "github.com/go-webgpu/webgpu/wgpu"
// BindGroupLayout defines the structure of resource bindings for shaders.
// On Rust backend, this wraps go-webgpu/webgpu BindGroupLayout.
type BindGroupLayout struct {
r *rwgpu.BindGroupLayout
device *Device
released bool
}
// Release destroys the bind group layout.
func (l *BindGroupLayout) Release() {
if l.released {
return
}
l.released = true
if l.r != nil {
l.r.Release()
}
}
// PipelineLayout defines the bind group layout arrangement for a pipeline.
// On Rust backend, this wraps go-webgpu/webgpu PipelineLayout.
type PipelineLayout struct {
r *rwgpu.PipelineLayout
device *Device
released bool
}
// Release destroys the pipeline layout.
func (l *PipelineLayout) Release() {
if l.released {
return
}
l.released = true
if l.r != nil {
l.r.Release()
}
}
// LateBufferBindingInfo records the actual buffer binding size for a layout entry
// with MinBindingSize == 0.
type LateBufferBindingInfo struct {
BindingIndex uint32
Size uint64
}
// BindGroup represents bound GPU resources for shader access.
// On Rust backend, this wraps go-webgpu/webgpu BindGroup.
type BindGroup struct {
r *rwgpu.BindGroup
device *Device
released bool
}
// Release marks the bind group for destruction.
func (g *BindGroup) Release() {
if g.released {
return
}
g.released = true
if g.r != nil {
g.r.Release()
}
}