-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconst.go
More file actions
338 lines (285 loc) · 8.75 KB
/
Copy pathconst.go
File metadata and controls
338 lines (285 loc) · 8.75 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
package webgpu
import "github.com/bluescreen10/webgpu-go/driver"
type TextureFormat = driver.TextureFormat
const (
// 8-bit formats
R8UnormTextureFormat = TextureFormat(iota)
R8SnormTextureFormat
R8UintTextureFormat
R8SintTextureFormat
// 16-bit formats
R16UnormTextureFormat
R16SnormTextureFormat
R16UintTextureFormat
R16SintTextureFormat
R16FloatTextureFormat
RG8UnormTextureFormat
RG8SnormTextureFormat
RG8UintTextureFormat
RG8SintTextureFormat
// 32-bit formats
R32UintTextureFormat
R32SintTextureFormat
R32FloatTextureFormat
RG16UnormTextureFormat
RG16SnormTextureFormat
RG16UintTextureFormat
RG16SintTextureFormat
RG16FloatTextureFormat
RGBA8UnormTextureFormat
RGBA8UnormSRGBTextureFormat
RGBA8SnormTextureFormat
RGBA8UintTextureFormat
RGBA8SintTextureFormat
BGRA8UnormTextureFormat
BGRA8UnormSRGBTextureFormat
// Packed 32-bit formats
RGB9E5UFloatTextureFormat
RGB10A2UintTextureFormat
RGB10A2UnormTextureFormat
RG11B10UFloatTextureFormat
// 64-bit formats
RG32UintTextureFormat
RG32SintTextureFormat
RG32FloatTextureFormat
RGBA16UnormTextureFormat
RGBA16SnormTextureFormat
RGBA16UintTextureFormat
RGBA16SintTextureFormat
RGBA16FloatTextureFormat
// 128-bit formats
RGBA32UintTextureFormat
RGBA32SintTextureFormat
RGBA32FloatTextureFormat
// Depth/Stencil formats
Stencil8TextureFormat
Depth16UnormTextureFormat
Depth24PlusTextureFormat
Depth24PlusStencil8TextureFormat
Depth32FloatTextureFormat
// Depth32float-Stencil8 feature
Depth32floatStencil8TextureFormat
// BC compressed formats usable if texture-compression-bc is both
// supported by the device/user agent and enabled in requestDevice.
BC1RGBAUnormTextureFormat
BC1RGBAUnormSRGBTextureFormat
BC2RGBAUnormTextureFormat
BC2RGBAUnormSRGBTextureFormat
BC3RGBAUnormTextureFormat
BC3RGBAUnormSRGBTextureFormat
BC4RUnormTextureFormat
bC4RSnormTextureFormat
BC5RGUnormTextureFormat
bc5RGSnormTextureFormat
BC6HRGBUfloatTextureFormat
BC6HRGBFloatTextureFormat
BC7RGBAUnormTextureFormat
BC7RGBAUnormSRGBTextureFormat
// ETC2 compressed formats usable if texture-compression-etc2 is both
// supported by the device/user agent and enabled in requestDevice.
ETC2RGB8UnormTextureFormat
ETC2RGB8UnormSRGBTextureFormat
ETC2RGB8A1UnormTextureFormat
ETC2RGB8A1UnormSRGBTextureFormat
ETC2RGBA8UnormTextureFormat
ETC2RGBA8UnormSRGBTextureFormat
EACR11UnormTextureFormat
EACR11SnormTextureFormat
EACRG11UnormTextureFormat
EACRG11SnormTextureFormat
// ASTC compressed formats usable if texture-compression-astc is both
// supported by the device/user agent and enabled in requestDevice.
ASTC4x4UnormTextureFormat
ASTC4x4UnormSRGBTextureFormat
ASTC5x4UnormTextureFormat
ASTC5x4UnormSRGBTextureFormat
ASTC5x5UnormTextureFormat
ASTC5x5UnormSRGBTextureFormat
ASTC6x5UnormTextureFormat
ASTC6x5UnormSRGBTextureFormat
ASTC6x6UnormTextureFormat
ASTC6x6UnormSRGBTextureFormat
ASTC8x5UnormTextureFormat
ASTC8x5UnormSRGBTextureFormat
ASTC8x6UnormTextureFormat
ASTC8x6UnormSRGBTextureFormat
ASTC8x8UnormTextureFormat
ASTC8x8UnormSRGBTextureFormat
ASTC10x5UnormTextureFormat
ASTC10x5UnormSRGBTextureFormat
ASTC10x6UnormTextureFormat
ASTC10x6UnormSRGBTextureFormat
ASTC10x8UnormTextureFormat
ASTC10x8UnormSRGBTextureFormat
ASTC10x10UnormTextureFormat
ASTC10x10UnormSRGBTextureFormat
ASTC12x10UnormTextureFormat
ASTC12x10UnormSRGBTextureFormat
ASTC12x12UnormTextureFormat
ASTC12x12UnormSRGBTextureFormat
)
type FeatureName = driver.FeatureName
const (
CoreFeaturesAndLimitsFeature = FeatureName(iota)
DepthClipControlFeature
Depth32floatStencil8Feature
TextureCompressionBCFeature
TextureCompressionBCSliced3DFeature
TextureCompressionETC2Feature
TextureCompressionASTCFeature
TextureCompressionASTCSliced3DFeature
TimestampQueryFeature
IndirectFirstInstanceFeature
ShaderF16Feature
RG11B10UFloatRenderableFeature
BGRA8UnormStorageFeature
Float32FilterableFeature
Float32BlendableFeature
ClipDistancesFeature
DualSourceBlendingFeature
SubgroupsFeature
TextureFormatsTier1Feature
TextureFormatsTier2Feature
PrimitiveIndexFeature
TextureComponentSwizzleFeature
)
// Power preferences hints for requesting an adapter
type PowerPreference uint8
const (
// No power preference
UndefinedPowerPreference = PowerPreference(iota)
// Prioritize an aapter with low power consumption
LowPower
// Prioritize performance over power consumption
HighPerformance
)
// Lowest feature level supported hint for requesting an adapter.
// Reference: https://www.w3.org/TR/webgpu/#limit-compatibility-mode-default
type FeatureLevel uint8
const (
// Default limits.
CoreFeatureLevel = iota
// Compatibility mode limits.
CompatibilityFeatureLevel
)
type AdapterState uint8
const (
AdapterStateValid = AdapterState(iota)
AdapterStateConsumed
AdapterStateExpired
AdapterStateInvalid
)
type BufferUsage = driver.BufferUsage
const (
// Invalid buffer usage. No buffer should have this
InvalidBufferUsage = BufferUsage(1 << iota)
// The buffer can be mapped for reading.
MapReadBufferUsage
// The buffer can be mapped for writing.
MapWriteBufferUsage
// The buffer can be used as the source of a copy operation.
CopySrcBufferUsage
// The buffer can be used as the destination of a copy or write operation.
CopyDstBufferUsage
// The buffer can be used as an index buffer.
IndexBufferUsage
// The buffer can be used as a vertex buffer.
VertexBufferUsage
// The buffer can be used as a uniform buffer.
UniformBufferUsage
// The buffer can be used as a storage buffer.
StorageBufferUsage
// The buffer can be used as to store indirect command arguments.
IndirectBufferUsage
// The buffer can be used to capture query results.
QueryResolveBufferUsage
)
type MapState uint8
const (
UnmappedMapState = MapState(iota)
PendingMapState
MappedMapState
)
// TODO
const (
LoadOpClear = LoadOp(iota)
)
// TODO
const (
StoreOpStore = StoreOp(iota)
)
const (
ColorWriteMaskNone ColorWriteMask = 0x00000000
ColorWriteMaskRed ColorWriteMask = 0x00000001
ColorWriteMaskGreen ColorWriteMask = 0x00000002
ColorWriteMaskBlue ColorWriteMask = 0x00000004
ColorWriteMaskAlpha ColorWriteMask = 0x00000008
ColorWriteMaskAll ColorWriteMask = 0x0000000F
)
const (
BlendFactorZero BlendFactor = 0x00000000
BlendFactorOne BlendFactor = 0x00000001
BlendFactorSrc BlendFactor = 0x00000002
BlendFactorOneMinusSrc BlendFactor = 0x00000003
BlendFactorSrcAlpha BlendFactor = 0x00000004
BlendFactorOneMinusSrcAlpha BlendFactor = 0x00000005
BlendFactorDst BlendFactor = 0x00000006
BlendFactorOneMinusDst BlendFactor = 0x00000007
BlendFactorDstAlpha BlendFactor = 0x00000008
BlendFactorOneMinusDstAlpha BlendFactor = 0x00000009
BlendFactorSrcAlphaSaturated BlendFactor = 0x0000000A
BlendFactorConstant BlendFactor = 0x0000000B
BlendFactorOneMinusConstant BlendFactor = 0x0000000C
)
const (
BlendOperationAdd BlendOperation = 0x00000000
BlendOperationSubtract BlendOperation = 0x00000001
BlendOperationReverseSubtract BlendOperation = 0x00000002
BlendOperationMin BlendOperation = 0x00000003
BlendOperationMax BlendOperation = 0x00000004
)
const (
PrimitiveTopologyPointList PrimitiveTopology = 0x00000000
PrimitiveTopologyLineList PrimitiveTopology = 0x00000001
PrimitiveTopologyLineStrip PrimitiveTopology = 0x00000002
PrimitiveTopologyTriangleList PrimitiveTopology = 0x00000003
PrimitiveTopologyTriangleStrip PrimitiveTopology = 0x00000004
)
const (
IndexFormatUndefined IndexFormat = 0x00000000
IndexFormatUint16 IndexFormat = 0x00000001
IndexFormatUint32 IndexFormat = 0x00000002
)
const (
FrontFaceCCW FrontFace = 0x00000000
FrontFaceCW FrontFace = 0x00000001
)
const (
CullModeNone CullMode = 0x00000000
CullModeFront CullMode = 0x00000001
CullModeBack CullMode = 0x00000002
)
type CompositeAlphaMode uint32
const (
CompositeAlphaModeAuto CompositeAlphaMode = 0x00000000
CompositeAlphaModeOpaque CompositeAlphaMode = 0x00000001
CompositeAlphaModePremultiplied CompositeAlphaMode = 0x00000002
CompositeAlphaModeUnpremultiplied CompositeAlphaMode = 0x00000003
CompositeAlphaModeInherit CompositeAlphaMode = 0x00000004
)
type PresentMode uint32
const (
PresentModeFifo PresentMode = 0x00000000
PresentModeFifoRelaxed PresentMode = 0x00000001
PresentModeImmediate PresentMode = 0x00000002
PresentModeMailbox PresentMode = 0x00000003
)
type TextureUsage uint32
const (
TextureUsageNone TextureUsage = 0x00000000
TextureUsageCopySrc TextureUsage = 0x00000001
TextureUsageCopyDst TextureUsage = 0x00000002
TextureUsageTextureBinding TextureUsage = 0x00000004
TextureUsageStorageBinding TextureUsage = 0x00000008
TextureUsageRenderAttachment TextureUsage = 0x00000010
)