-
Notifications
You must be signed in to change notification settings - Fork 1
/
primitive.go
106 lines (86 loc) · 2.65 KB
/
primitive.go
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package wasmgpu
// GPUBufferDynamicOffset as described:
// https://gpuweb.github.io/gpuweb/#typedefdef-gpubufferdynamicoffset
type GPUBufferDynamicOffset uint32
// ToJS converts this type to one that can be passed as an argument
// to JavaScript.
func (g GPUBufferDynamicOffset) ToJS() any {
return uint32(g)
}
// GPUSize64 as described:
// https://gpuweb.github.io/gpuweb/#typedefdef-gpusize64
type GPUSize64 uint64
// ToJS converts this type to one that can be passed as an argument
// to JavaScript.
func (g GPUSize64) ToJS() any {
return uint64(g)
}
// GPUIntegerCoordinate as described:
// https://gpuweb.github.io/gpuweb/#typedefdef-gpuintegercoordinate
type GPUIntegerCoordinate uint32
// ToJS converts this type to one that can be passed as an argument
// to JavaScript.
func (g GPUIntegerCoordinate) ToJS() any {
return uint32(g)
}
// GPUIndex32 as described:
// https://gpuweb.github.io/gpuweb/#typedefdef-gpuindex32
type GPUIndex32 uint32
// ToJS converts this type to one that can be passed as an argument
// to JavaScript.
func (g GPUIndex32) ToJS() any {
return uint32(g)
}
// GPUSize32 as described:
// https://gpuweb.github.io/gpuweb/#typedefdef-gpusize32
type GPUSize32 uint32
// ToJS converts this type to one that can be passed as an argument
// to JavaScript.
func (g GPUSize32) ToJS() any {
return uint32(g)
}
// GPUColor as described:
// https://gpuweb.github.io/gpuweb/#typedefdef-gpucolor
type GPUColor struct {
R float64
G float64
B float64
A float64
}
// ToJS converts this type to one that can be passed as an argument
// to JavaScript.
func (g GPUColor) ToJS() any {
return []any{g.R, g.G, g.B, g.A}
}
// GPUFlagsConstant as described:
// https://gpuweb.github.io/gpuweb/#typedefdef-gpuflagsconstant
type GPUFlagsConstant uint32
// ToJS converts this type to one that can be passed as an argument
// to JavaScript.
func (g GPUFlagsConstant) ToJS() any {
return uint32(g)
}
// GPUStencilValue as described:
// https://gpuweb.github.io/gpuweb/#typedefdef-gpustencilvalue
type GPUStencilValue uint32
// ToJS converts this type to one that can be passed as an argument
// to JavaScript.
func (g GPUStencilValue) ToJS() any {
return uint32(g)
}
// GPUDepthBias as described:
// https://gpuweb.github.io/gpuweb/#typedefdef-gpudepthbias
type GPUDepthBias int32
// ToJS converts this type to one that can be passed as an argument
// to JavaScript.
func (g GPUDepthBias) ToJS() any {
return int32(g)
}
// GPUSampleMask as described:
// https://gpuweb.github.io/gpuweb/#typedefdef-gpusamplemask
type GPUSampleMask uint32
// ToJS converts this type to one that can be passed as an argument
// to JavaScript.
func (g GPUSampleMask) ToJS() any {
return uint32(g)
}