blob: be0062c994d3d8bcf46955b48a4f7256bb6203ae [file] [log] [blame]
Austin Eng376f1c62017-05-30 20:03:44 -04001{
2 "_comment": [
Corentin Wallez4a9ef4e2018-07-18 11:40:26 +02003 "Copyright 2017 The Dawn Authors",
Austin Eng376f1c62017-05-30 20:03:44 -04004 "",
5 "Licensed under the Apache License, Version 2.0 (the \"License\");",
6 "you may not use this file except in compliance with the License.",
7 "You may obtain a copy of the License at",
8 "",
9 " http://www.apache.org/licenses/LICENSE-2.0",
10 "",
11 "Unless required by applicable law or agreed to in writing, software",
12 "distributed under the License is distributed on an \"AS IS\" BASIS,",
13 "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
14 "See the License for the specific language governing permissions and",
15 "limitations under the License."
16 ],
Corentin Wallez6d0438c2021-03-24 20:29:42 +000017
18 "_doc": "See docs/codegen.md",
19
Corentin Wallezf12c9db2020-01-10 13:28:18 +000020 "adapter properties": {
21 "category": "structure",
22 "extensible": true,
23 "members": [
24 {"name": "device ID", "type": "uint32_t"},
25 {"name": "vendor ID", "type": "uint32_t"},
26 {"name": "name", "type": "char", "annotation": "const*"},
Corentin Wallez73b70222020-10-14 13:33:15 +000027 {"name": "driver description", "type": "char", "annotation": "const*"},
Corentin Wallezf12c9db2020-01-10 13:28:18 +000028 {"name": "adapter type", "type": "adapter type"},
29 {"name": "backend type", "type": "backend type"}
30 ]
31 },
32 "adapter type": {
33 "category": "enum",
Kai Ninomiya7b6246a2020-01-28 23:54:38 +000034 "javascript": false,
Corentin Wallezf12c9db2020-01-10 13:28:18 +000035 "values": [
36 {"value": 0, "name": "discrete GPU"},
37 {"value": 1, "name": "integrated GPU"},
38 {"value": 2, "name": "CPU"},
Corentin Walleza0afd312020-04-01 12:07:43 +000039 {"value": 3, "name": "unknown"}
Corentin Wallezf12c9db2020-01-10 13:28:18 +000040 ]
41 },
Corentin Walleza60799f2018-09-11 18:16:54 +000042 "address mode": {
43 "category": "enum",
44 "values": [
Yan, Shaobo93158eb2019-01-04 04:56:08 +000045 {"value": 0, "name": "repeat"},
Corentin Walleza0491c92019-07-08 09:36:31 +000046 {"value": 1, "name": "mirror repeat"},
Austin Eng5f1d2e12019-04-09 15:12:50 +000047 {"value": 2, "name": "clamp to edge"}
Corentin Walleza60799f2018-09-11 18:16:54 +000048 ]
Austin Eng10634392017-06-01 11:30:03 -040049 },
Corentin Wallezf12c9db2020-01-10 13:28:18 +000050 "backend type": {
51 "category": "enum",
Kai Ninomiya7b6246a2020-01-28 23:54:38 +000052 "javascript": false,
Corentin Wallezf12c9db2020-01-10 13:28:18 +000053 "values": [
Corentin Wallezf2ed2482020-01-21 08:44:25 +000054 {"value": 0, "name": "null"},
55 {"value": 1, "name": "D3D11"},
56 {"value": 2, "name": "D3D12"},
57 {"value": 3, "name": "metal"},
58 {"value": 4, "name": "vulkan"},
59 {"value": 5, "name": "openGL"},
60 {"value": 6, "name": "openGLES"}
Corentin Wallezf12c9db2020-01-10 13:28:18 +000061 ]
62 },
Austin Eng376f1c62017-05-30 20:03:44 -040063 "bind group": {
64 "category": "object"
65 },
Corentin Wallezc3c66942020-04-07 07:11:12 +000066 "bind group entry": {
Corentin Wallez6f9d21e2018-12-05 07:18:30 +000067 "category": "structure",
68 "extensible": false,
69 "members": [
70 {"name": "binding", "type": "uint32_t"},
Corentin Wallez6f0e1f92018-12-07 12:31:53 +000071 {"name": "buffer", "type": "buffer", "optional": true},
Corentin Wallez8f938712019-07-08 19:20:22 +000072 {"name": "offset", "type": "uint64_t", "default": "0"},
Austin Engcf52d712019-04-05 20:51:29 +000073 {"name": "size", "type": "uint64_t"},
Corentin Wallez6f9d21e2018-12-05 07:18:30 +000074 {"name": "sampler", "type": "sampler", "optional": true},
75 {"name": "texture view", "type": "texture view", "optional": true}
76 ]
77 },
78 "bind group descriptor": {
79 "category": "structure",
80 "extensible": true,
81 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +000082 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Corentin Wallez6f9d21e2018-12-05 07:18:30 +000083 {"name": "layout", "type": "bind group layout"},
Corentin Wallez84ae2bf2020-05-13 17:05:55 +000084 {"name": "entry count", "type": "uint32_t"},
Corentin Wallez3966eb12020-04-21 07:36:30 +000085 {"name": "entries", "type": "bind group entry", "annotation": "const*", "length": "entry count"}
Austin Eng376f1c62017-05-30 20:03:44 -040086 ]
87 },
Austin Eng376f1c62017-05-30 20:03:44 -040088 "bind group layout": {
89 "category": "object"
90 },
Brandon Jones9c52c2992020-12-12 02:09:56 +000091
92 "buffer binding type": {
93 "category": "enum",
94 "values": [
95 {"value": 0, "name": "undefined", "jsrepr": "undefined", "valid": false},
96 {"value": 1, "name": "uniform"},
97 {"value": 2, "name": "storage"},
98 {"value": 3, "name": "read only storage", "jsrepr": "readonly-storage"}
99 ]
100 },
101 "buffer binding layout": {
102 "category": "structure",
103 "extensible": true,
104 "members": [
105 {"name": "type", "type": "buffer binding type", "default": "undefined"},
106 {"name": "has dynamic offset", "type": "bool", "default": "false"},
107 {"name": "min binding size", "type": "uint64_t", "default": "0"}
108 ]
109 },
110
111 "sampler binding type": {
112 "category": "enum",
113 "values": [
114 {"value": 0, "name": "undefined", "jsrepr": "undefined", "valid": false},
115 {"value": 1, "name": "filtering"},
116 {"value": 2, "name": "non filtering"},
117 {"value": 3, "name": "comparison"}
118 ]
119 },
120 "sampler binding layout": {
121 "category": "structure",
122 "extensible": true,
123 "members": [
124 {"name": "type", "type": "sampler binding type", "default": "undefined"}
125 ]
126 },
127
128 "texture sample type": {
129 "category": "enum",
130 "values": [
131 {"value": 0, "name": "undefined", "jsrepr": "undefined", "valid": false},
132 {"value": 1, "name": "float"},
133 {"value": 2, "name": "unfilterable float"},
134 {"value": 3, "name": "depth"},
135 {"value": 4, "name": "sint"},
136 {"value": 5, "name": "uint"}
137 ]
138 },
139 "texture binding layout": {
140 "category": "structure",
141 "extensible": true,
142 "members": [
143 {"name": "sample type", "type": "texture sample type", "default": "undefined"},
144 {"name": "view dimension", "type": "texture view dimension", "default": "undefined"},
145 {"name": "multisampled", "type": "bool", "default": "false"}
146 ]
147 },
148
149 "storage texture access": {
150 "category": "enum",
151 "values": [
152 {"value": 0, "name": "undefined", "jsrepr": "undefined", "valid": false},
153 {"value": 1, "name": "read only", "jsrepr": "readonly"},
154 {"value": 2, "name": "write only", "jsrepr": "writeonly"}
155 ]
156 },
157 "storage texture binding layout": {
158 "category": "structure",
159 "extensible": true,
160 "members": [
161 {"name": "access", "type": "storage texture access", "default": "undefined"},
162 {"name": "format", "type": "texture format", "default": "undefined"},
163 {"name": "view dimension", "type": "texture view dimension", "default": "undefined"}
164 ]
165 },
166
Corentin Wallezc3c66942020-04-07 07:11:12 +0000167 "bind group layout entry": {
Kai Ninomiya234becf2018-07-10 12:23:50 -0700168 "category": "structure",
Corentin Wallezfc441f92021-01-29 19:08:15 +0000169 "extensible": true,
Kai Ninomiya234becf2018-07-10 12:23:50 -0700170 "members": [
171 {"name": "binding", "type": "uint32_t"},
Corentin Wallezb9b088f2019-08-27 08:42:29 +0000172 {"name": "visibility", "type": "shader stage"},
Brandon Jones9c52c2992020-12-12 02:09:56 +0000173
Brandon Jonesb35ae002020-12-15 17:32:59 +0000174 {"name": "type", "type": "binding type", "default": "undefined"},
François Beaufortc3b61322019-09-24 11:08:17 +0000175 {"name": "has dynamic offset", "type": "bool", "default": "false"},
Kai Ninomiya47968992020-07-09 20:49:43 +0000176 {"name": "min buffer binding size", "type": "uint64_t", "default": "0"},
Corentin Wallez98334df2020-04-20 08:10:10 +0000177 {"name": "view dimension", "type": "texture view dimension", "default": "undefined"},
Jiawei Shao971a6232020-03-17 10:28:07 +0000178 {"name": "texture component type", "type": "texture component type", "default": "float"},
Brandon Jones9c52c2992020-12-12 02:09:56 +0000179 {"name": "storage texture format", "type": "texture format", "default": "undefined"},
180
181 {"name": "buffer", "type": "buffer binding layout"},
182 {"name": "sampler", "type": "sampler binding layout"},
183 {"name": "texture", "type": "texture binding layout"},
184 {"name": "storage texture", "type": "storage texture binding layout"}
Kai Ninomiya234becf2018-07-10 12:23:50 -0700185 ]
186 },
187 "bind group layout descriptor": {
188 "category": "structure",
189 "extensible": true,
190 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +0000191 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Corentin Wallez84ae2bf2020-05-13 17:05:55 +0000192 {"name": "entry count", "type": "uint32_t"},
Corentin Wallez3966eb12020-04-21 07:36:30 +0000193 {"name": "entries", "type": "bind group layout entry", "annotation": "const*", "length": "entry count"}
Austin Eng376f1c62017-05-30 20:03:44 -0400194 ]
195 },
196 "binding type": {
197 "category": "enum",
198 "values": [
Brandon Jones9c52c2992020-12-12 02:09:56 +0000199 {"value": 0, "name": "undefined", "jsrepr": "undefined", "valid": false},
200 {"value": 1, "name": "uniform buffer"},
201 {"value": 2, "name": "storage buffer"},
202 {"value": 3, "name": "readonly storage buffer"},
203 {"value": 4, "name": "sampler"},
204 {"value": 5, "name": "comparison sampler"},
205 {"value": 6, "name": "sampled texture"},
206 {"value": 7, "name": "multisampled texture"},
207 {"value": 8, "name": "readonly storage texture"},
208 {"value": 9, "name": "writeonly storage texture"}
Austin Eng376f1c62017-05-30 20:03:44 -0400209 ]
210 },
Brandon Jones0702b702021-03-11 21:19:00 +0000211 "blend component": {
Yunchao Hec35103d2018-10-29 09:06:55 +0000212 "category": "structure",
213 "extensible": false,
214 "members": [
Corentin Wallez8f938712019-07-08 19:20:22 +0000215 {"name": "operation", "type": "blend operation", "default": "add"},
216 {"name": "src factor", "type": "blend factor", "default": "one"},
217 {"name": "dst factor", "type": "blend factor", "default": "zero"}
Yunchao Hec35103d2018-10-29 09:06:55 +0000218 ]
219 },
Brandon Jones0702b702021-03-11 21:19:00 +0000220 "blend descriptor": {
221 "category": "typedef",
222 "type": "blend component"
223 },
Austin Eng94bebe52017-07-26 16:59:53 -0400224 "blend factor": {
225 "category": "enum",
226 "values": [
227 {"value": 0, "name": "zero"},
228 {"value": 1, "name": "one"},
Brandon Jones22b923c2021-04-15 18:34:29 +0000229 {"value": 2, "name": "src"},
230 {"value": 3, "name": "one minus src"},
Austin Eng94bebe52017-07-26 16:59:53 -0400231 {"value": 4, "name": "src alpha"},
232 {"value": 5, "name": "one minus src alpha"},
Brandon Jones22b923c2021-04-15 18:34:29 +0000233 {"value": 6, "name": "dst"},
234 {"value": 7, "name": "one minus dst"},
Austin Eng94bebe52017-07-26 16:59:53 -0400235 {"value": 8, "name": "dst alpha"},
236 {"value": 9, "name": "one minus dst alpha"},
237 {"value": 10, "name": "src alpha saturated"},
Brandon Jones22b923c2021-04-15 18:34:29 +0000238 {"value": 11, "name": "constant"},
239 {"value": 12, "name": "one minus constant"},
240
241 {"value": 102, "name": "src color"},
242 {"value": 103, "name": "one minus src color"},
243 {"value": 106, "name": "dst color"},
244 {"value": 107, "name": "one minus dst color"},
245 {"value": 111, "name": "blend color"},
246 {"value": 112, "name": "one minus blend color"}
Austin Eng94bebe52017-07-26 16:59:53 -0400247 ]
248 },
249 "blend operation": {
250 "category": "enum",
251 "values": [
252 {"value": 0, "name": "add"},
253 {"value": 1, "name": "subtract"},
254 {"value": 2, "name": "reverse subtract"},
255 {"value": 3, "name": "min"},
256 {"value": 4, "name": "max"}
257 ]
258 },
Yunchao He108bcbd2019-02-15 02:20:57 +0000259 "color state descriptor": {
Yunchao He92700bf2018-12-27 06:32:31 +0000260 "category": "structure",
261 "extensible": true,
262 "members": [
Yunchao He108bcbd2019-02-15 02:20:57 +0000263 {"name": "format", "type": "texture format"},
Brandon Jones0702b702021-03-11 21:19:00 +0000264 {"name": "alpha blend", "type": "blend component"},
265 {"name": "color blend", "type": "blend component"},
Corentin Wallez8f938712019-07-08 19:20:22 +0000266 {"name": "write mask", "type": "color write mask", "default": "all"}
Austin Eng94bebe52017-07-26 16:59:53 -0400267 ]
268 },
Corentin Walleza60799f2018-09-11 18:16:54 +0000269 "bool": {
270 "category": "native"
271 },
Austin Eng376f1c62017-05-30 20:03:44 -0400272 "buffer": {
273 "category": "object",
274 "methods": [
275 {
Corentin Wallez0d52f802020-07-14 12:30:14 +0000276 "name": "map async",
277 "args": [
Corentin Wallez3ed44f52020-07-20 16:24:20 +0000278 {"name": "mode", "type": "map mode"},
Corentin Wallez0d52f802020-07-14 12:30:14 +0000279 {"name": "offset", "type": "size_t"},
280 {"name": "size", "type": "size_t"},
281 {"name": "callback", "type": "buffer map callback"},
282 {"name": "userdata", "type": "void", "annotation": "*"}
283 ]
284 },
285 {
Corentin Wallez1325ab12020-06-30 11:51:14 +0000286 "name": "get mapped range",
Corentin Wallezf6e70442020-07-17 18:50:37 +0000287 "returns": "void *",
288 "args": [
289 {"name": "offset", "type": "size_t", "default": 0},
290 {"name": "size", "type": "size_t", "default": 0}
291 ]
Corentin Wallez1325ab12020-06-30 11:51:14 +0000292 },
293 {
294 "name": "get const mapped range",
Corentin Wallezf6e70442020-07-17 18:50:37 +0000295 "returns": "void const *",
296 "args": [
297 {"name": "offset", "type": "size_t", "default": 0},
298 {"name": "size", "type": "size_t", "default": 0}
299 ]
Corentin Wallez1325ab12020-06-30 11:51:14 +0000300 },
301 {
Corentin Wallezb1c19ee2017-06-09 10:51:29 -0400302 "name": "unmap"
Austin Eng446ab442019-02-13 21:26:48 +0000303 },
304 {
305 "name": "destroy"
Austin Eng376f1c62017-05-30 20:03:44 -0400306 }
307 ]
308 },
Brandon Jonesac71e342018-11-28 17:54:13 +0000309 "buffer copy view": {
Corentin Wallez80915842021-03-04 18:13:45 +0000310 "category": "typedef",
311 "type": "image copy buffer"
Brandon Jonesac71e342018-11-28 17:54:13 +0000312 },
Corentin Wallez82b65732018-08-22 15:37:29 +0200313 "buffer descriptor": {
314 "category": "structure",
315 "extensible": true,
316 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +0000317 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Corentin Wallez9e9e29f2019-08-27 08:21:39 +0000318 {"name": "usage", "type": "buffer usage"},
Corentin Wallezb2ea1912020-07-07 11:21:51 +0000319 {"name": "size", "type": "uint64_t"},
320 {"name": "mapped at creation", "type": "bool", "default": "false"}
Corentin Wallez82b65732018-08-22 15:37:29 +0200321 ]
322 },
Corentin Wallez0d52f802020-07-14 12:30:14 +0000323 "buffer map callback": {
324 "category": "callback",
325 "args": [
326 {"name": "status", "type": "buffer map async status"},
327 {"name": "userdata", "type": "void", "annotation": "*"}
328 ]
329 },
Corentin Wallez8565e002018-03-20 19:48:54 -0400330 "buffer map async status": {
Corentin Wallezb1c19ee2017-06-09 10:51:29 -0400331 "category": "enum",
332 "values": [
333 {"value": 0, "name": "success"},
334 {"value": 1, "name": "error"},
335 {"value": 2, "name": "unknown"},
Jiawei Shaoed2b4652020-09-27 02:00:52 +0000336 {"value": 3, "name": "device lost"},
337 {"value": 4, "name": "destroyed before callback"},
338 {"value": 5, "name": "unmapped before callback"}
Corentin Wallezb1c19ee2017-06-09 10:51:29 -0400339 ]
340 },
Corentin Wallez9e9e29f2019-08-27 08:21:39 +0000341 "buffer usage": {
Austin Eng376f1c62017-05-30 20:03:44 -0400342 "category": "bitmask",
343 "values": [
344 {"value": 0, "name": "none"},
Corentin Wallezf45bdb82017-06-05 15:42:14 -0400345 {"value": 1, "name": "map read"},
Corentin Wallez769b00f2017-06-16 15:35:12 -0400346 {"value": 2, "name": "map write"},
Corentin Wallezec053552019-07-08 10:05:46 +0000347 {"value": 4, "name": "copy src"},
348 {"value": 8, "name": "copy dst"},
Corentin Wallez769b00f2017-06-16 15:35:12 -0400349 {"value": 16, "name": "index"},
350 {"value": 32, "name": "vertex"},
351 {"value": 64, "name": "uniform"},
Idan Raiter05f7ad52019-06-10 20:56:27 +0000352 {"value": 128, "name": "storage"},
Hao Li5c89c8d2020-07-17 09:02:46 +0000353 {"value": 256, "name": "indirect"},
354 {"value": 512, "name": "query resolve"}
Austin Eng376f1c62017-05-30 20:03:44 -0400355 ]
356 },
Austin Eng376f1c62017-05-30 20:03:44 -0400357 "char": {
358 "category": "native"
359 },
Jiawei Shao5e811ae2018-12-19 08:21:13 +0000360 "color": {
361 "category": "structure",
362 "members": [
Brandon Jones670858d2020-09-22 16:51:36 +0000363 {"name": "r", "type": "double"},
364 {"name": "g", "type": "double"},
365 {"name": "b", "type": "double"},
366 {"name": "a", "type": "double"}
Jiawei Shao5e811ae2018-12-19 08:21:13 +0000367 ]
368 },
Austin Eng94bebe52017-07-26 16:59:53 -0400369 "color write mask": {
370 "category": "bitmask",
371 "values": [
372 {"value": 0, "name": "none"},
373 {"value": 1, "name": "red"},
374 {"value": 2, "name": "green"},
375 {"value": 4, "name": "blue"},
376 {"value": 8, "name": "alpha"},
377 {"value": 15, "name": "all"}
378 ]
379 },
Austin Eng376f1c62017-05-30 20:03:44 -0400380 "command buffer": {
381 "category": "object"
382 },
Corentin Wallez4b90c472019-07-10 20:43:13 +0000383 "command buffer descriptor": {
384 "category": "structure",
385 "extensible": true,
François Beaufort6ac5a922019-09-25 13:56:48 +0000386 "members": [
387 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}
388 ]
Corentin Wallez4b90c472019-07-10 20:43:13 +0000389 },
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000390 "command encoder": {
391 "category": "object",
392 "methods": [
393 {
394 "name": "finish",
Corentin Wallez4b90c472019-07-10 20:43:13 +0000395 "returns": "command buffer",
396 "args": [
397 {"name": "descriptor", "type": "command buffer descriptor", "annotation": "const*", "optional": true}
398 ]
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000399 },
400 {
401 "name": "begin compute pass",
Corentin Wallez4b90c472019-07-10 20:43:13 +0000402 "returns": "compute pass encoder",
403 "args": [
404 {"name": "descriptor", "type": "compute pass descriptor", "annotation": "const*", "optional": true}
405 ]
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000406 },
407 {
408 "name": "begin render pass",
Corentin Wallez4b90c472019-07-10 20:43:13 +0000409 "returns": "render pass encoder",
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000410 "args": [
Corentin Wallez4b90c472019-07-10 20:43:13 +0000411 {"name": "descriptor", "type": "render pass descriptor", "annotation": "const*"}
412 ]
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000413 },
414 {
415 "name": "copy buffer to buffer",
416 "args": [
417 {"name": "source", "type": "buffer"},
Austin Engcf52d712019-04-05 20:51:29 +0000418 {"name": "source offset", "type": "uint64_t"},
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000419 {"name": "destination", "type": "buffer"},
Austin Engcf52d712019-04-05 20:51:29 +0000420 {"name": "destination offset", "type": "uint64_t"},
421 {"name": "size", "type": "uint64_t"}
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000422 ]
423 },
424 {
425 "name": "copy buffer to texture",
426 "args": [
Corentin Wallez80915842021-03-04 18:13:45 +0000427 {"name": "source", "type": "image copy buffer", "annotation": "const*"},
428 {"name": "destination", "type": "image copy texture", "annotation": "const*"},
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000429 {"name": "copy size", "type": "extent 3D", "annotation": "const*"}
430 ]
431 },
432 {
433 "name": "copy texture to buffer",
434 "args": [
Corentin Wallez80915842021-03-04 18:13:45 +0000435 {"name": "source", "type": "image copy texture", "annotation": "const*"},
436 {"name": "destination", "type": "image copy buffer", "annotation": "const*"},
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000437 {"name": "copy size", "type": "extent 3D", "annotation": "const*"}
438 ]
Brandon Jonesd3d3aa02019-03-26 11:06:23 +0000439 },
440 {
441 "name": "copy texture to texture",
442 "args": [
Corentin Wallez80915842021-03-04 18:13:45 +0000443 {"name": "source", "type": "image copy texture", "annotation": "const*"},
444 {"name": "destination", "type": "image copy texture", "annotation": "const*"},
Brandon Jonesd3d3aa02019-03-26 11:06:23 +0000445 {"name": "copy size", "type": "extent 3D", "annotation": "const*"}
446 ]
Corentin Wallezb8ea84c2019-09-10 08:20:40 +0000447 },
448 {
Austin Eng464aaeb2020-11-14 01:24:03 +0000449 "name": "inject validation error",
450 "args": [
451 {"name": "message", "type": "char", "annotation": "const*", "length": "strlen"}
452 ],
453 "TODO": "enga@: Make this a Dawn extension"
454 },
455 {
Corentin Wallezb8ea84c2019-09-10 08:20:40 +0000456 "name": "insert debug marker",
457 "args": [
Kai Ninomiya51bbbef2020-07-12 16:01:38 +0000458 {"name": "marker label", "type": "char", "annotation": "const*", "length": "strlen"}
Corentin Wallezb8ea84c2019-09-10 08:20:40 +0000459 ]
460 },
461 {
462 "name": "pop debug group",
463 "args": []
464 },
465 {
466 "name": "push debug group",
467 "args": [
468 {"name": "group label", "type": "char", "annotation": "const*", "length": "strlen"}
469 ]
Hao Li5191adc2020-07-01 10:48:16 +0000470 },
471 {
Hao Li5c89c8d2020-07-17 09:02:46 +0000472 "name": "resolve query set",
473 "args": [
474 {"name": "query set", "type": "query set"},
475 {"name": "first query", "type": "uint32_t"},
476 {"name": "query count", "type": "uint32_t"},
477 {"name": "destination", "type": "buffer"},
478 {"name": "destination offset", "type": "uint64_t"}
479 ]
480 },
481 {
Hao Li5191adc2020-07-01 10:48:16 +0000482 "name": "write timestamp",
483 "args": [
484 {"name": "query set", "type": "query set"},
485 {"name": "query index", "type": "uint32_t"}
486 ]
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000487 }
488 ]
489 },
Corentin Wallez4b90c472019-07-10 20:43:13 +0000490 "command encoder descriptor": {
491 "category": "structure",
492 "extensible": true,
François Beaufort277d2e12019-10-03 14:56:49 +0000493 "members": [
494 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}
495 ]
Corentin Wallez4b90c472019-07-10 20:43:13 +0000496 },
Corentin Wallez82fbccb2018-09-21 00:24:37 +0000497 "compare function": {
498 "category": "enum",
499 "values": [
Corentin Wallez5d2f2042021-04-08 18:42:47 +0000500 {"value": 0, "name": "undefined", "jsrepr": "undefined", "valid": false},
Austin Engd6a54312020-04-17 19:32:07 +0000501 {"value": 1, "name": "never"},
502 {"value": 2, "name": "less"},
503 {"value": 3, "name": "less equal"},
504 {"value": 4, "name": "greater"},
505 {"value": 5, "name": "greater equal"},
506 {"value": 6, "name": "equal"},
507 {"value": 7, "name": "not equal"},
508 {"value": 8, "name": "always"}
Corentin Wallez82fbccb2018-09-21 00:24:37 +0000509 ]
510 },
Brandon Jones6f2bbe92021-04-05 23:34:17 +0000511 "compilation info": {
512 "category": "structure",
513 "extensible": false,
514 "members": [
515 {"name": "message count", "type": "uint32_t"},
516 {"name": "messages", "type": "compilation message", "annotation": "const*", "length": "message count"}
517 ]
518 },
519 "compilation info callback": {
520 "category": "callback",
521 "args": [
522 {"name": "status", "type": "compilation info request status"},
523 {"name": "compilation info", "type": "compilation info", "annotation": "const*"},
524 {"name": "userdata", "type": "void", "annotation": "*"}
525 ]
526 },
527 "compilation info request status": {
528 "category": "enum",
529 "values": [
530 {"value": 0, "name": "success"},
531 {"value": 1, "name": "error"},
532 {"value": 2, "name": "device lost"},
533 {"value": 3, "name": "unknown"}
534 ]
535 },
536 "compilation message": {
537 "category": "structure",
538 "extensible": false,
539 "members": [
540 {"name": "message", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
541 {"name": "type", "type": "compilation message type"},
542 {"name": "line num", "type": "uint64_t"},
543 {"name": "line pos", "type": "uint64_t"}
544 ]
545 },
546 "compilation message type": {
547 "category": "enum",
548 "values": [
549 {"value": 0, "name": "error"},
550 {"value": 1, "name": "warning"},
551 {"value": 2, "name": "info"}
552 ]
553 },
Corentin Wallez4b90c472019-07-10 20:43:13 +0000554 "compute pass descriptor": {
555 "category": "structure",
556 "extensible": true,
François Beaufort6ac5a922019-09-25 13:56:48 +0000557 "members": [
558 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}
559 ]
Corentin Wallez4b90c472019-07-10 20:43:13 +0000560 },
Corentin Wallez82fbccb2018-09-21 00:24:37 +0000561 "compute pass encoder": {
562 "category": "object",
563 "methods": [
Corentin Walleze9d347e2017-06-26 16:23:03 -0400564 {
Brandon Jones11d32c82019-02-20 20:21:00 +0000565 "name": "insert debug marker",
566 "args": [
Kai Ninomiya51bbbef2020-07-12 16:01:38 +0000567 {"name": "marker label", "type": "char", "annotation": "const*", "length": "strlen"}
Brandon Jones11d32c82019-02-20 20:21:00 +0000568 ]
569 },
570 {
571 "name": "pop debug group",
572 "args": []
573 },
574 {
575 "name": "push debug group",
576 "args": [
577 {"name": "group label", "type": "char", "annotation": "const*", "length": "strlen"}
578 ]
579 },
580 {
Yan, Shaobo300eec02018-12-21 10:40:26 +0000581 "name": "set pipeline",
Austin Eng376f1c62017-05-30 20:03:44 -0400582 "args": [
Corentin Wallez82fbccb2018-09-21 00:24:37 +0000583 {"name": "pipeline", "type": "compute pipeline"}
Austin Eng376f1c62017-05-30 20:03:44 -0400584 ]
585 },
586 {
Corentin Wallez82fbccb2018-09-21 00:24:37 +0000587 "name": "set bind group",
Austin Eng376f1c62017-05-30 20:03:44 -0400588 "args": [
Corentin Wallez82fbccb2018-09-21 00:24:37 +0000589 {"name": "group index", "type": "uint32_t"},
Yan, Shaobo991ab982019-03-18 06:01:37 +0000590 {"name": "group", "type": "bind group"},
Corentin Wallez70c8c102019-10-09 16:08:42 +0000591 {"name": "dynamic offset count", "type": "uint32_t", "default": "0"},
Austin Eng314fd352019-11-01 15:51:01 +0000592 {"name": "dynamic offsets", "type": "uint32_t", "annotation": "const*", "length": "dynamic offset count", "optional": true}
Corentin Wallez29ced282017-07-14 10:58:07 -0400593 ]
594 },
595 {
Hao Li5191adc2020-07-01 10:48:16 +0000596 "name": "write timestamp",
597 "args": [
598 {"name": "query set", "type": "query set"},
599 {"name": "query index", "type": "uint32_t"}
600 ]
601 },
602 {
Corentin Wallez82fbccb2018-09-21 00:24:37 +0000603 "name": "dispatch",
Corentin Walleza3c89cc2018-02-13 14:57:13 -0500604 "args": [
605 {"name": "x", "type": "uint32_t"},
Corentin Wallez8f938712019-07-08 19:20:22 +0000606 {"name": "y", "type": "uint32_t", "default": "1"},
607 {"name": "z", "type": "uint32_t", "default": "1"}
Corentin Walleza3c89cc2018-02-13 14:57:13 -0500608 ]
609 },
610 {
Idan Raiter05f7ad52019-06-10 20:56:27 +0000611 "name": "dispatch indirect",
612 "args": [
613 {"name": "indirect buffer", "type": "buffer"},
614 {"name": "indirect offset", "type": "uint64_t"}
615 ]
616 },
617 {
Kai Ninomiya4078ed82019-08-27 17:56:23 +0000618 "name": "end pass"
Austin Eng376f1c62017-05-30 20:03:44 -0400619 }
620 ]
621 },
Corentin Wallez29ced282017-07-14 10:58:07 -0400622 "compute pipeline": {
Austin Engf6eb8902019-11-22 17:02:22 +0000623 "category": "object",
624 "methods": [
625 {
626 "name": "get bind group layout",
627 "returns": "bind group layout",
628 "args": [
Corentin Wallez373a3ff2020-04-01 18:22:36 +0000629 {"name": "group index", "type": "uint32_t"}
Austin Engf6eb8902019-11-22 17:02:22 +0000630 ]
631 }
632 ]
Corentin Wallez29ced282017-07-14 10:58:07 -0400633 },
Corentin Wallez8e335a52018-08-27 23:12:56 +0200634 "compute pipeline descriptor": {
635 "category": "structure",
636 "extensible": true,
637 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +0000638 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Austin Engf6eb8902019-11-22 17:02:22 +0000639 {"name": "layout", "type": "pipeline layout", "optional": true},
Jinho Bang0b826712019-10-07 12:23:09 +0000640 {"name": "compute stage", "type": "programmable stage descriptor"}
Corentin Wallez29ced282017-07-14 10:58:07 -0400641 ]
642 },
Yan, Shaobobb913a92020-12-02 08:13:09 +0000643 "copy texture for browser options": {
644 "category": "structure",
645 "extensible": true,
646 "members": [
647 {"name": "flipY", "type": "bool", "default": "false"}
648 ]
649 },
Corentin Wallez2d3c2e32021-02-22 18:27:36 +0000650 "create compute pipeline async callback": {
Jiawei Shaoae5f9502020-10-19 01:56:08 +0000651 "category": "callback",
652 "args": [
Corentin Wallez2d3c2e32021-02-22 18:27:36 +0000653 {"name": "status", "type": "create pipeline async status"},
Jiawei Shaoae5f9502020-10-19 01:56:08 +0000654 {"name": "pipeline", "type": "compute pipeline"},
655 {"name": "message", "type": "char", "annotation": "const*", "length": "strlen"},
656 {"name": "userdata", "type": "void", "annotation": "*"}
657 ]
658 },
Corentin Wallez2d3c2e32021-02-22 18:27:36 +0000659 "create pipeline async status": {
Jiawei Shaoae5f9502020-10-19 01:56:08 +0000660 "category": "enum",
661 "values": [
662 {"value": 0, "name": "success"},
663 {"value": 1, "name": "error"},
664 {"value": 2, "name": "device lost"},
Jiawei Shao42103bc2020-10-24 03:11:43 +0000665 {"value": 3, "name": "device destroyed"},
666 {"value": 4, "name": "unknown"}
Jiawei Shaoae5f9502020-10-19 01:56:08 +0000667 ]
668 },
Corentin Wallez2d3c2e32021-02-22 18:27:36 +0000669 "create render pipeline async callback": {
Jiawei Shao03e14002020-10-21 04:37:41 +0000670 "category": "callback",
671 "args": [
Corentin Wallez2d3c2e32021-02-22 18:27:36 +0000672 {"name": "status", "type": "create pipeline async status"},
Jiawei Shao03e14002020-10-21 04:37:41 +0000673 {"name": "pipeline", "type": "render pipeline"},
674 {"name": "message", "type": "char", "annotation": "const*", "length": "strlen"},
675 {"name": "userdata", "type": "void", "annotation": "*"}
676 ]
677 },
Yunchao Hec33a8c12019-04-11 18:46:54 +0000678 "cull mode": {
679 "category": "enum",
680 "values": [
681 {"value": 0, "name": "none"},
682 {"value": 1, "name": "front"},
683 {"value": 2, "name": "back"}
684 ]
685 },
Austin Eng376f1c62017-05-30 20:03:44 -0400686 "device": {
687 "category": "object",
688 "methods": [
689 {
Corentin Wallez6f9d21e2018-12-05 07:18:30 +0000690 "name": "create bind group",
691 "returns": "bind group",
692 "args": [
693 {"name": "descriptor", "type": "bind group descriptor", "annotation": "const*"}
694 ]
Austin Eng376f1c62017-05-30 20:03:44 -0400695 },
696 {
Kai Ninomiya234becf2018-07-10 12:23:50 -0700697 "name": "create bind group layout",
698 "returns": "bind group layout",
699 "args": [
700 {"name": "descriptor", "type": "bind group layout descriptor", "annotation": "const*"}
701 ]
Austin Eng376f1c62017-05-30 20:03:44 -0400702 },
703 {
Corentin Wallez82b65732018-08-22 15:37:29 +0200704 "name": "create buffer",
705 "returns": "buffer",
706 "args": [
707 {"name": "descriptor", "type": "buffer descriptor", "annotation": "const*"}
708 ]
709 },
710 {
Austin Engcf1fdf42020-06-15 23:42:13 +0000711 "name": "create error buffer",
712 "returns": "buffer",
713 "TODO": "enga@: Make this part of a dawn_wire extension"
714 },
715 {
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000716 "name": "create command encoder",
Corentin Wallez4b90c472019-07-10 20:43:13 +0000717 "returns": "command encoder",
718 "args": [
719 {"name": "descriptor", "type": "command encoder descriptor", "annotation": "const*", "optional": true}
720 ]
Corentin Walleze1f0d4e2019-02-15 12:54:08 +0000721 },
722 {
Corentin Wallez8e335a52018-08-27 23:12:56 +0200723 "name": "create compute pipeline",
724 "returns": "compute pipeline",
725 "args": [
726 {"name": "descriptor", "type": "compute pipeline descriptor", "annotation": "const*"}
727 ]
Corentin Wallez29ced282017-07-14 10:58:07 -0400728 },
729 {
Corentin Wallez2d3c2e32021-02-22 18:27:36 +0000730 "name": "create compute pipeline async",
Jiawei Shaoae5f9502020-10-19 01:56:08 +0000731 "returns": "void",
732 "args": [
733 {"name": "descriptor", "type": "compute pipeline descriptor", "annotation": "const*"},
Corentin Wallez2d3c2e32021-02-22 18:27:36 +0000734 {"name": "callback", "type": "create compute pipeline async callback"},
Jiawei Shaoae5f9502020-10-19 01:56:08 +0000735 {"name": "userdata", "type": "void", "annotation": "*"}
736 ]
737 },
738 {
Kai Ninomiyaf53f98b2018-06-27 16:21:39 -0700739 "name": "create pipeline layout",
740 "returns": "pipeline layout",
741 "args": [
742 {"name": "descriptor", "type": "pipeline layout descriptor", "annotation": "const*"}
743 ]
Austin Eng376f1c62017-05-30 20:03:44 -0400744 },
745 {
Corentin Wallez9585c462020-07-06 18:50:00 +0000746 "name": "create query set",
747 "returns": "query set",
748 "args": [
749 {"name": "descriptor", "type": "query set descriptor", "annotation": "const*"}
750 ]
751 },
752 {
Corentin Wallez2d3c2e32021-02-22 18:27:36 +0000753 "name": "create render pipeline async",
Jiawei Shao03e14002020-10-21 04:37:41 +0000754 "returns": "void",
755 "args": [
Corentin Wallez8ac6a482021-03-21 23:13:04 +0000756 {"name": "descriptor", "type": "render pipeline descriptor 2", "annotation": "const*"},
Corentin Wallez2d3c2e32021-02-22 18:27:36 +0000757 {"name": "callback", "type": "create render pipeline async callback"},
Jiawei Shao03e14002020-10-21 04:37:41 +0000758 {"name": "userdata", "type": "void", "annotation": "*"}
759 ]
760 },
761 {
Austin Eng8a488c12019-08-13 22:12:54 +0000762 "name": "create render bundle encoder",
763 "returns": "render bundle encoder",
764 "args": [
765 {"name": "descriptor", "type": "render bundle encoder descriptor", "annotation": "const*"}
766 ]
767 },
768 {
Corentin Wallez9585c462020-07-06 18:50:00 +0000769 "name": "create render pipeline",
770 "returns": "render pipeline",
771 "args": [
772 {"name": "descriptor", "type": "render pipeline descriptor", "annotation": "const*"}
773 ]
774 },
775 {
Brandon Jones0702b702021-03-11 21:19:00 +0000776 "name": "create render pipeline 2",
777 "returns": "render pipeline",
778 "args": [
779 {"name": "descriptor", "type": "render pipeline descriptor 2", "annotation": "const*"}
780 ]
781 },
782 {
Corentin Wallez1ae19e82018-05-17 17:09:07 -0400783 "name": "create sampler",
784 "returns": "sampler",
785 "args": [
shrekshaob3177d42021-01-26 02:22:58 +0000786 {"name": "descriptor", "type": "sampler descriptor", "annotation": "const*", "optional": true}
Corentin Wallez1ae19e82018-05-17 17:09:07 -0400787 ]
Austin Eng376f1c62017-05-30 20:03:44 -0400788 },
789 {
Corentin Wallezdf671032018-08-20 17:01:20 +0200790 "name": "create shader module",
791 "returns": "shader module",
792 "args": [
793 {"name": "descriptor", "type": "shader module descriptor", "annotation": "const*"}
794 ]
Austin Eng376f1c62017-05-30 20:03:44 -0400795 },
796 {
Corentin Wallez7be2a712019-02-15 11:15:58 +0000797 "name": "create swap chain",
798 "returns": "swap chain",
799 "args": [
Corentin Wallez9d6265b2020-11-04 10:04:17 +0000800 {"name": "surface", "type": "surface", "optional": true},
Corentin Wallez7be2a712019-02-15 11:15:58 +0000801 {"name": "descriptor", "type": "swap chain descriptor", "annotation": "const*"}
802 ]
Kai Ninomiyac16a67a2017-07-27 18:30:57 -0700803 },
804 {
Jiawei Shao425428f2018-08-27 08:44:48 +0800805 "name": "create texture",
806 "returns": "texture",
807 "args": [
808 {"name": "descriptor", "type": "texture descriptor", "annotation": "const*"}
809 ]
Austin Eng376f1c62017-05-30 20:03:44 -0400810 },
811 {
Corentin Wallez6d315da2021-02-04 15:33:42 +0000812 "name": "get queue",
813 "returns": "queue"
814 },
815 {
Corentin Wallez8a437942020-04-17 16:45:17 +0000816 "name": "get default queue",
817 "returns": "queue"
818 },
819 {
Brandon Jones0e92e9b2021-04-01 20:46:42 +0000820 "name": "create external texture",
821 "returns": "external texture",
822 "args": [
823 {"name": "external texture descriptor", "type": "external texture descriptor", "annotation": "const*"}
824 ]
825 },
826 {
Austin Enge06f01b2019-09-30 22:50:59 +0000827 "name": "inject error",
828 "args": [
829 {"name": "type", "type": "error type"},
Austin Eng867f7202019-10-02 06:35:38 +0000830 {"name": "message", "type": "char", "annotation": "const*", "length": "strlen"}
Austin Enge06f01b2019-09-30 22:50:59 +0000831 ],
832 "TODO": "enga@: Make this a Dawn extension"
833 },
834 {
Natasha Lee0ecc48e2020-01-15 19:02:13 +0000835 "name": "lose for testing"
836 },
837 {
Corentin Wallezdbb57292017-06-14 13:33:45 -0400838 "name": "tick"
839 },
840 {
Austin Eng45ea7e62019-08-27 21:43:56 +0000841 "name": "set uncaptured error callback",
Austin Eng376f1c62017-05-30 20:03:44 -0400842 "args": [
Austin Engcb0cb652019-08-27 21:41:56 +0000843 {"name": "callback", "type": "error callback"},
Corentin Wallez839053b2019-05-29 13:03:50 +0000844 {"name": "userdata", "type": "void", "annotation": "*"}
Austin Eng376f1c62017-05-30 20:03:44 -0400845 ]
Austin Eng45238d72019-09-04 22:54:03 +0000846 },
847 {
Natasha Lee9bba4a92019-12-18 18:59:20 +0000848 "name": "set device lost callback",
849 "args": [
850 {"name": "callback", "type": "device lost callback"},
851 {"name": "userdata", "type": "void", "annotation": "*"}
852 ]
853 },
854 {
Austin Eng45238d72019-09-04 22:54:03 +0000855 "name": "push error scope",
856 "args": [
857 {"name": "filter", "type": "error filter"}
858 ]
859 },
860 {
861 "name": "pop error scope",
862 "returns": "bool",
863 "args": [
864 {"name": "callback", "type": "error callback"},
865 {"name": "userdata", "type": "void", "annotation": "*"}
866 ]
Austin Eng376f1c62017-05-30 20:03:44 -0400867 }
868 ]
869 },
Natasha Lee9bba4a92019-12-18 18:59:20 +0000870 "device lost callback": {
871 "category": "callback",
Corentin Wallez13e2e132020-01-25 09:30:40 +0000872 "args": [
Natasha Lee9bba4a92019-12-18 18:59:20 +0000873 {"name": "message", "type": "char", "annotation": "const*"},
874 {"name": "userdata", "type": "void", "annotation": "*"}
875 ]
876 },
Jiawei Shao5c2f5f32019-10-20 03:01:56 +0000877 "device properties": {
878 "category": "structure",
879 "extensible": false,
880 "members": [
Xinghua Caobdc05c32020-05-27 02:49:08 +0000881 {"name": "texture compression BC", "type": "bool", "default": "false"},
Xinghua Caodb8f8042020-06-08 12:18:21 +0000882 {"name": "shader float16", "type": "bool", "default": "false"},
Hao Li55c85f62020-05-27 05:15:18 +0000883 {"name": "pipeline statistics query", "type": "bool", "default": "false"},
Bryan Bernhart14a23982021-02-05 20:11:24 +0000884 {"name": "timestamp query", "type": "bool", "default": "false"},
Brian Ho2cccd5a2021-04-05 17:16:47 +0000885 {"name": "multi planar formats", "type": "bool", "default": "false"},
886 {"name": "depth clamping", "type": "bool", "default": "false"}
Jiawei Shao5c2f5f32019-10-20 03:01:56 +0000887 ]
888 },
Yunchao Heea563332019-01-04 04:28:37 +0000889 "depth stencil state descriptor": {
890 "category": "structure",
891 "extensible": true,
892 "members": [
Yunchao He108bcbd2019-02-15 02:20:57 +0000893 {"name": "format", "type": "texture format"},
Corentin Wallez8f938712019-07-08 19:20:22 +0000894 {"name": "depth write enabled", "type": "bool", "default": "false"},
895 {"name": "depth compare", "type": "compare function", "default": "always"},
Brandon Jones0702b702021-03-11 21:19:00 +0000896 {"name": "stencil front", "type": "stencil face state"},
897 {"name": "stencil back", "type": "stencil face state"},
Corentin Wallez8f938712019-07-08 19:20:22 +0000898 {"name": "stencil read mask", "type": "uint32_t", "default": "0xFFFFFFFF"},
899 {"name": "stencil write mask", "type": "uint32_t", "default": "0xFFFFFFFF"}
Austin Eng376f1c62017-05-30 20:03:44 -0400900 ]
901 },
Brandon Jones670858d2020-09-22 16:51:36 +0000902 "double": {
903 "category": "native"
904 },
Austin Engcb0cb652019-08-27 21:41:56 +0000905 "error callback": {
Corentin Wallez540abab2019-11-22 13:18:22 +0000906 "category": "callback",
907 "args": [
908 {"name": "type", "type": "error type"},
909 {"name": "message", "type": "char", "annotation": "const*"},
910 {"name": "userdata", "type": "void", "annotation": "*"}
911 ]
Austin Eng376f1c62017-05-30 20:03:44 -0400912 },
Austin Eng45238d72019-09-04 22:54:03 +0000913 "error filter": {
914 "category": "enum",
915 "values": [
916 {"value": 0, "name": "none"},
917 {"value": 1, "name": "validation"},
918 {"value": 2, "name": "out of memory"}
919 ]
920 },
Austin Engcb0cb652019-08-27 21:41:56 +0000921 "error type": {
922 "category": "enum",
923 "values": [
924 {"value": 0, "name": "no error"},
925 {"value": 1, "name": "validation"},
926 {"value": 2, "name": "out of memory"},
927 {"value": 3, "name": "unknown"},
928 {"value": 4, "name": "device lost"}
929 ]
930 },
Corentin Wallez29353d62018-09-18 12:49:22 +0000931 "extent 3D": {
932 "category": "structure",
933 "members": [
Corentin Walleza736d962021-03-04 17:03:15 +0000934 {"name": "width", "type": "uint32_t"},
Corentin Wallez2931c422020-10-16 14:20:06 +0000935 {"name": "height", "type": "uint32_t", "default": 1},
Corentin Wallez6d0438c2021-03-24 20:29:42 +0000936 {"name": "depth or array layers", "type": "uint32_t", "default": 1},
shrekshaob00de7f2021-03-22 21:12:36 +0000937 {"name": "depth", "type": "uint32_t", "default": 1}
Corentin Wallez29353d62018-09-18 12:49:22 +0000938 ]
939 },
Brandon Jones0e92e9b2021-04-01 20:46:42 +0000940 "external texture": {
941 "category": "object",
942 "methods": [
943 {
944 "name": "destroy",
945 "returns": "void"
946 }
947 ]
948 },
949 "external texture descriptor": {
950 "category": "structure",
951 "extensible": true,
952 "members": [
953 {"name": "plane 0", "type": "texture view"},
954 {"name": "format", "type": "texture format"}
955 ]
956 },
Austin Engf0b761f2018-12-03 16:57:34 +0000957 "fence": {
958 "category": "object",
959 "methods": [
960 {
961 "name": "get completed value",
962 "returns": "uint64_t"
963 },
964 {
965 "name": "on completion",
966 "args": [
967 {"name": "value", "type": "uint64_t"},
968 {"name": "callback", "type": "fence on completion callback"},
Corentin Wallez839053b2019-05-29 13:03:50 +0000969 {"name": "userdata", "type": "void", "annotation": "*"}
Austin Engf0b761f2018-12-03 16:57:34 +0000970 ]
971 }
972 ]
973 },
974 "fence on completion callback": {
Corentin Wallez540abab2019-11-22 13:18:22 +0000975 "category": "callback",
976 "args": [
977 {"name": "status", "type": "fence completion status"},
978 {"name": "userdata", "type": "void", "annotation": "*"}
979 ]
Austin Engf0b761f2018-12-03 16:57:34 +0000980 },
981 "fence completion status": {
982 "category": "enum",
983 "values": [
984 {"value": 0, "name": "success"},
985 {"value": 1, "name": "error"},
986 {"value": 2, "name": "unknown"},
Austin Eng5603dc92019-08-27 18:10:03 +0000987 {"value": 3, "name": "device lost"}
Austin Engf0b761f2018-12-03 16:57:34 +0000988 ]
989 },
990 "fence descriptor": {
991 "category": "structure",
992 "extensible": true,
993 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +0000994 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Corentin Wallez8f938712019-07-08 19:20:22 +0000995 {"name": "initial value", "type": "uint64_t", "default": "0"}
Austin Engf0b761f2018-12-03 16:57:34 +0000996 ]
997 },
Austin Eng376f1c62017-05-30 20:03:44 -0400998 "filter mode": {
999 "category": "enum",
1000 "values": [
Yunchao Hecfea9342019-04-02 14:31:29 +00001001 {"value": 0, "name": "nearest"},
1002 {"value": 1, "name": "linear"}
Austin Eng376f1c62017-05-30 20:03:44 -04001003 ]
1004 },
Austin Engfb426532017-08-01 14:22:52 -04001005 "float": {
1006 "category": "native"
1007 },
Yunchao Hec33a8c12019-04-11 18:46:54 +00001008 "front face": {
1009 "category": "enum",
1010 "values": [
1011 {"value": 0, "name": "CCW"},
1012 {"value": 1, "name": "CW"}
1013 ]
1014 },
Corentin Wallez80915842021-03-04 18:13:45 +00001015 "image copy buffer": {
1016 "category": "structure",
1017 "extensible": true,
1018 "members": [
1019 {"name": "layout", "type": "texture data layout"},
1020 {"name": "buffer", "type": "buffer"}
1021 ]
1022 },
1023 "image copy texture": {
1024 "category": "structure",
1025 "extensible": true,
1026 "members": [
1027 {"name": "texture", "type": "texture"},
1028 {"name": "mip level", "type": "uint32_t", "default": "0"},
1029 {"name": "origin", "type": "origin 3D"},
1030 {"name": "aspect", "type": "texture aspect", "default": "all"}
1031 ]
1032 },
Austin Eng376f1c62017-05-30 20:03:44 -04001033 "index format": {
1034 "category": "enum",
1035 "values": [
Brandon Jones8575cb32020-08-27 01:13:35 +00001036 {"value": 0, "name": "undefined", "jsrepr": "undefined"},
1037 {"value": 1, "name": "uint16"},
1038 {"value": 2, "name": "uint32"}
Austin Eng376f1c62017-05-30 20:03:44 -04001039 ]
1040 },
Corentin Wallez5fc2c822020-01-10 13:06:48 +00001041 "instance": {
Corentin Wallez3a1746e2020-01-15 13:14:12 +00001042 "category": "object",
1043 "methods": [
1044 {
1045 "name": "create surface",
1046 "returns": "surface",
1047 "args": [
1048 {"name": "descriptor", "type": "surface descriptor", "annotation": "const*"}
1049 ]
1050 }
1051 ]
Corentin Wallez5fc2c822020-01-10 13:06:48 +00001052 },
1053 "instance descriptor": {
1054 "category": "structure",
1055 "extensible": true,
1056 "members": []
1057 },
Brandon Jones58a471a2021-02-08 19:48:06 +00001058 "vertex attribute": {
Yunchao Heb2207732019-02-14 00:35:39 +00001059 "category": "structure",
1060 "extensible": false,
1061 "members": [
Kai Ninomiyaae1f25f2019-11-07 22:23:29 +00001062 {"name": "format", "type": "vertex format"},
1063 {"name": "offset", "type": "uint64_t"},
1064 {"name": "shader location", "type": "uint32_t"}
Yunchao Heb2207732019-02-14 00:35:39 +00001065 ]
1066 },
Brandon Jones58a471a2021-02-08 19:48:06 +00001067 "vertex attribute descriptor": {
1068 "category": "typedef",
1069 "type": "vertex attribute"
1070 },
1071 "vertex buffer layout": {
Yunchao He4dec7372019-02-14 23:56:07 +00001072 "category": "structure",
1073 "extensible": false,
1074 "members": [
Kai Ninomiyaae1f25f2019-11-07 22:23:29 +00001075 {"name": "array stride", "type": "uint64_t"},
Corentin Wallez8f938712019-07-08 19:20:22 +00001076 {"name": "step mode", "type": "input step mode", "default": "vertex"},
Yunchao He2d4b5292019-06-06 17:54:30 +00001077 {"name": "attribute count", "type": "uint32_t"},
Brandon Jones58a471a2021-02-08 19:48:06 +00001078 {"name": "attributes", "type": "vertex attribute", "annotation": "const*", "length": "attribute count"}
Yunchao He4dec7372019-02-14 23:56:07 +00001079 ]
1080 },
Brandon Jones58a471a2021-02-08 19:48:06 +00001081 "vertex buffer layout descriptor": {
1082 "category": "typedef",
1083 "type": "vertex buffer layout"
1084 },
Kai Ninomiyaae1f25f2019-11-07 22:23:29 +00001085 "vertex state descriptor": {
Yunchao He889d7432019-03-27 18:08:50 +00001086 "category": "structure",
1087 "extensible": true,
1088 "members": [
Brandon Jones8575cb32020-08-27 01:13:35 +00001089 {"name": "index format", "type": "index format", "default": "undefined"},
Kai Ninomiyaae1f25f2019-11-07 22:23:29 +00001090 {"name": "vertex buffer count", "type": "uint32_t", "default": 0},
Brandon Jones58a471a2021-02-08 19:48:06 +00001091 {"name": "vertex buffers", "type": "vertex buffer layout", "annotation": "const*", "length": "vertex buffer count"}
Austin Eng376f1c62017-05-30 20:03:44 -04001092 ]
1093 },
1094 "input step mode": {
1095 "category": "enum",
1096 "values": [
1097 {"value": 0, "name": "vertex"},
1098 {"value": 1, "name": "instance"}
1099 ]
1100 },
Kai Ninomiyab9854312017-08-11 14:36:20 -07001101 "load op": {
1102 "category": "enum",
1103 "values": [
1104 {"value": 0, "name": "clear"},
1105 {"value": 1, "name": "load"}
1106 ]
1107 },
Corentin Wallez0d52f802020-07-14 12:30:14 +00001108 "map mode": {
1109 "category": "bitmask",
1110 "values": [
1111 {"value": 0, "name": "none"},
1112 {"value": 1, "name": "read"},
1113 {"value": 2, "name": "write"}
1114 ]
1115 },
Jiawei Shao5e811ae2018-12-19 08:21:13 +00001116 "store op": {
1117 "category": "enum",
1118 "values": [
Natasha Leecf0e9d92019-09-25 13:08:28 +00001119 {"value": 0, "name": "store"},
1120 {"value": 1, "name": "clear"}
Jiawei Shao5e811ae2018-12-19 08:21:13 +00001121 ]
1122 },
Brandon Jonesac71e342018-11-28 17:54:13 +00001123 "origin 3D": {
1124 "category": "structure",
1125 "members": [
Corentin Wallez8f938712019-07-08 19:20:22 +00001126 {"name": "x", "type": "uint32_t", "default": "0"},
1127 {"name": "y", "type": "uint32_t", "default": "0"},
1128 {"name": "z", "type": "uint32_t", "default": "0"}
Brandon Jonesac71e342018-11-28 17:54:13 +00001129 ]
1130 },
Austin Eng376f1c62017-05-30 20:03:44 -04001131 "pipeline layout": {
1132 "category": "object"
1133 },
Kai Ninomiyaf53f98b2018-06-27 16:21:39 -07001134 "pipeline layout descriptor": {
1135 "category": "structure",
1136 "extensible": true,
1137 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +00001138 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Jiawei Shao20301662019-02-21 00:45:19 +00001139 {"name": "bind group layout count", "type": "uint32_t"},
1140 {"name": "bind group layouts", "type": "bind group layout", "annotation": "const*", "length": "bind group layout count"}
Austin Eng376f1c62017-05-30 20:03:44 -04001141 ]
1142 },
Kai Ninomiya261b05d2020-07-13 18:21:03 +00001143 "pipeline statistic name": {
Hao Lib6eff5a2020-06-11 00:34:14 +00001144 "category": "enum",
1145 "values": [
1146 {"value": 0, "name": "vertex shader invocations"},
1147 {"value": 1, "name": "clipper invocations"},
1148 {"value": 2, "name": "clipper primitives out"},
1149 {"value": 3, "name": "fragment shader invocations"},
1150 {"value": 4, "name": "compute shader invocations"}
1151 ]
1152 },
Corentin Wallezd87e6762020-01-23 17:20:38 +00001153 "present mode": {
1154 "category": "enum",
1155 "values": [
Corentin Wallez527045f2020-03-20 16:47:50 +00001156 {"value": 0, "name": "immediate"},
1157 {"value": 1, "name": "mailbox"},
1158 {"value": 2, "name": "fifo"}
Corentin Wallezd87e6762020-01-23 17:20:38 +00001159 ]
1160 },
Jinho Bang0b826712019-10-07 12:23:09 +00001161 "programmable stage descriptor": {
Yan, Shaoboa4924272018-12-10 19:47:22 +00001162 "category": "structure",
1163 "extensible": true,
1164 "members": [
1165 {"name": "module", "type": "shader module"},
1166 {"name": "entry point", "type": "char", "annotation": "const*", "length": "strlen"}
1167 ]
1168 },
Austin Eng3e9e3152017-07-24 13:54:19 -04001169 "primitive topology": {
1170 "category": "enum",
1171 "values": [
Austin Eng439d9632017-07-26 18:10:44 -04001172 {"value": 0, "name": "point list"},
1173 {"value": 1, "name": "line list"},
Austin Eng3e9e3152017-07-24 13:54:19 -04001174 {"value": 2, "name": "line strip"},
Austin Eng439d9632017-07-26 18:10:44 -04001175 {"value": 3, "name": "triangle list"},
Austin Eng3e9e3152017-07-24 13:54:19 -04001176 {"value": 4, "name": "triangle strip"}
1177 ]
1178 },
Hao Lib6eff5a2020-06-11 00:34:14 +00001179 "query set": {
1180 "category": "object",
1181 "methods": [
1182 {
1183 "name": "destroy"
1184 }
1185 ]
1186 },
1187 "query set descriptor": {
1188 "category": "structure",
1189 "extensible": true,
1190 "members": [
1191 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
1192 {"name": "type", "type": "query type"},
1193 {"name": "count", "type": "uint32_t"},
Kai Ninomiya261b05d2020-07-13 18:21:03 +00001194 {"name": "pipeline statistics", "type": "pipeline statistic name", "annotation": "const*", "length": "pipeline statistics count"},
Corentin Wallez9585c462020-07-06 18:50:00 +00001195 {"name": "pipeline statistics count", "type": "uint32_t", "default": "0"}
Hao Lib6eff5a2020-06-11 00:34:14 +00001196 ]
1197 },
1198 "query type": {
1199 "category": "enum",
1200 "values": [
1201 {"value": 0, "name": "occlusion"},
1202 {"value": 1, "name": "pipeline statistics"},
1203 {"value": 2, "name": "timestamp"}
1204 ]
1205 },
Austin Eng376f1c62017-05-30 20:03:44 -04001206 "queue": {
1207 "category": "object",
1208 "methods": [
1209 {
1210 "name": "submit",
1211 "args": [
Jiawei Shao20301662019-02-21 00:45:19 +00001212 {"name": "command count", "type": "uint32_t"},
1213 {"name": "commands", "type": "command buffer", "annotation": "const*", "length": "command count"}
Austin Eng376f1c62017-05-30 20:03:44 -04001214 ]
Austin Engf0b761f2018-12-03 16:57:34 +00001215 },
1216 {
1217 "name": "signal",
1218 "args": [
1219 {"name": "fence", "type": "fence"},
1220 {"name": "signal value", "type": "uint64_t"}
1221 ]
Austin Eng1cc38662019-03-06 22:42:22 +00001222 },
1223 {
1224 "name": "create fence",
1225 "returns": "fence",
1226 "args": [
Austin Enga1800c02020-05-11 20:29:22 +00001227 {"name": "descriptor", "type": "fence descriptor", "annotation": "const*", "optional": true}
Austin Eng1cc38662019-03-06 22:42:22 +00001228 ]
Corentin Wallez47a33412020-06-02 09:24:39 +00001229 },
1230 {
Corentin Wallezc093db22021-02-25 13:17:01 +00001231 "name": "on submitted work done",
1232 "args": [
1233 {"name": "signal value", "type": "uint64_t"},
1234 {"name": "callback", "type": "queue work done callback"},
1235 {"name": "userdata", "type": "void", "annotation": "*"}
1236 ]
1237 },
1238 {
Corentin Wallez47a33412020-06-02 09:24:39 +00001239 "name": "write buffer",
1240 "args": [
1241 {"name": "buffer", "type": "buffer"},
1242 {"name": "buffer offset", "type": "uint64_t"},
1243 {"name": "data", "type": "void", "annotation": "const*", "length": "size"},
1244 {"name": "size", "type": "size_t"}
1245 ]
Tomek Ponitkaa9c7d642020-07-08 18:42:30 +00001246 },
1247 {
1248 "name": "write texture",
1249 "args": [
Corentin Wallez80915842021-03-04 18:13:45 +00001250 {"name": "destination", "type": "image copy texture", "annotation": "const*"},
Corentin Wallez1b9b53a2020-07-16 00:43:08 +00001251 {"name": "data", "type": "void", "annotation": "const*", "length": "data size"},
Tomek Ponitkaa9c7d642020-07-08 18:42:30 +00001252 {"name": "data size", "type": "size_t"},
1253 {"name": "data layout", "type": "texture data layout", "annotation": "const*"},
Corentin Wallez1b9b53a2020-07-16 00:43:08 +00001254 {"name": "write size", "type": "extent 3D", "annotation": "const*"}
Tomek Ponitkaa9c7d642020-07-08 18:42:30 +00001255 ]
Yan, Shaobodb8766b2020-11-04 02:30:16 +00001256 },
1257 {
1258 "name": "copy texture for browser",
Yan, Shaobobb913a92020-12-02 08:13:09 +00001259 "extensible": true,
Yan, Shaobodb8766b2020-11-04 02:30:16 +00001260 "args": [
Corentin Wallez80915842021-03-04 18:13:45 +00001261 {"name": "source", "type": "image copy texture", "annotation": "const*"},
1262 {"name": "destination", "type": "image copy texture", "annotation": "const*"},
Yan, Shaobobb913a92020-12-02 08:13:09 +00001263 {"name": "copy size", "type": "extent 3D", "annotation": "const*"},
1264 {"name": "options", "type": "copy texture for browser options", "annotation": "const*"}
Yan, Shaobodb8766b2020-11-04 02:30:16 +00001265 ]
Austin Eng376f1c62017-05-30 20:03:44 -04001266 }
1267 ]
1268 },
Corentin Wallezc093db22021-02-25 13:17:01 +00001269 "queue work done callback": {
1270 "category": "callback",
1271 "args": [
1272 {"name": "status", "type": "queue work done status"},
1273 {"name": "userdata", "type": "void", "annotation": "*"}
1274 ]
1275 },
1276 "queue work done status": {
1277 "category": "enum",
1278 "values": [
1279 {"value": 0, "name": "success"},
1280 {"value": 1, "name": "error"},
1281 {"value": 2, "name": "unknown"},
1282 {"value": 3, "name": "device lost"}
1283 ]
1284 },
Jiawei Shao5e811ae2018-12-19 08:21:13 +00001285
Yunchao Hec33a8c12019-04-11 18:46:54 +00001286 "rasterization state descriptor": {
1287 "category": "structure",
1288 "extensible": true,
1289 "members": [
Corentin Wallez8f938712019-07-08 19:20:22 +00001290 {"name": "front face", "type": "front face", "default": "CCW"},
1291 {"name": "cull mode", "type": "cull mode", "default": "none"},
1292 {"name": "depth bias", "type": "int32_t", "default": "0"},
1293 {"name": "depth bias slope scale", "type": "float", "default": "0.0f"},
1294 {"name": "depth bias clamp", "type": "float", "default": "0.0f"}
Yunchao Hec33a8c12019-04-11 18:46:54 +00001295 ]
1296 },
1297
Austin Eng8a488c12019-08-13 22:12:54 +00001298 "render bundle": {
1299 "category": "object"
1300 },
1301
1302 "render bundle encoder": {
1303 "category": "object",
1304 "methods": [
1305 {
1306 "name": "set pipeline",
1307 "args": [
1308 {"name": "pipeline", "type": "render pipeline"}
1309 ]
1310 },
1311 {
1312 "name": "set bind group",
1313 "args": [
1314 {"name": "group index", "type": "uint32_t"},
1315 {"name": "group", "type": "bind group"},
Corentin Wallez70c8c102019-10-09 16:08:42 +00001316 {"name": "dynamic offset count", "type": "uint32_t", "default": "0"},
Austin Eng314fd352019-11-01 15:51:01 +00001317 {"name": "dynamic offsets", "type": "uint32_t", "annotation": "const*", "length": "dynamic offset count", "optional": true}
Austin Eng8a488c12019-08-13 22:12:54 +00001318 ]
1319 },
1320 {
1321 "name": "draw",
1322 "args": [
1323 {"name": "vertex count", "type": "uint32_t"},
Corentin Wallez67b1ad72020-03-31 16:21:35 +00001324 {"name": "instance count", "type": "uint32_t", "default": "1"},
1325 {"name": "first vertex", "type": "uint32_t", "default": "0"},
1326 {"name": "first instance", "type": "uint32_t", "default": "0"}
Austin Eng8a488c12019-08-13 22:12:54 +00001327 ]
1328 },
1329 {
1330 "name": "draw indexed",
1331 "args": [
1332 {"name": "index count", "type": "uint32_t"},
Corentin Wallez67b1ad72020-03-31 16:21:35 +00001333 {"name": "instance count", "type": "uint32_t", "default": "1"},
1334 {"name": "first index", "type": "uint32_t", "default": "0"},
1335 {"name": "base vertex", "type": "int32_t", "default": "0"},
1336 {"name": "first instance", "type": "uint32_t", "default": "0"}
Austin Eng8a488c12019-08-13 22:12:54 +00001337 ]
1338 },
1339 {
1340 "name": "draw indirect",
1341 "args": [
1342 {"name": "indirect buffer", "type": "buffer"},
1343 {"name": "indirect offset", "type": "uint64_t"}
1344 ]
1345 },
1346 {
1347 "name": "draw indexed indirect",
1348 "args": [
1349 {"name": "indirect buffer", "type": "buffer"},
1350 {"name": "indirect offset", "type": "uint64_t"}
1351 ]
1352 },
1353 {
1354 "name": "insert debug marker",
1355 "args": [
Kai Ninomiya51bbbef2020-07-12 16:01:38 +00001356 {"name": "marker label", "type": "char", "annotation": "const*", "length": "strlen"}
Austin Eng8a488c12019-08-13 22:12:54 +00001357 ]
1358 },
1359 {
1360 "name": "pop debug group",
1361 "args": []
1362 },
1363 {
1364 "name": "push debug group",
1365 "args": [
1366 {"name": "group label", "type": "char", "annotation": "const*", "length": "strlen"}
1367 ]
1368 },
1369 {
François Beaufort91b21422019-10-10 07:29:58 +00001370 "name": "set vertex buffer",
Austin Eng8a488c12019-08-13 22:12:54 +00001371 "args": [
François Beaufort91b21422019-10-10 07:29:58 +00001372 {"name": "slot", "type": "uint32_t"},
1373 {"name": "buffer", "type": "buffer"},
Corentin Wallezc244f532020-04-24 09:42:03 +00001374 {"name": "offset", "type": "uint64_t", "default": "0"},
1375 {"name": "size", "type": "uint64_t", "default": "0"}
Austin Eng8a488c12019-08-13 22:12:54 +00001376 ]
1377 },
1378 {
1379 "name": "set index buffer",
1380 "args": [
1381 {"name": "buffer", "type": "buffer"},
Corentin Wallez5fad85b2020-11-25 08:54:14 +00001382 {"name": "format", "type": "index format"},
Corentin Wallezc244f532020-04-24 09:42:03 +00001383 {"name": "offset", "type": "uint64_t", "default": "0"},
1384 {"name": "size", "type": "uint64_t", "default": "0"}
Austin Eng8a488c12019-08-13 22:12:54 +00001385 ]
1386 },
1387 {
Brandon Jones8575cb32020-08-27 01:13:35 +00001388 "name": "set index buffer with format",
1389 "args": [
1390 {"name": "buffer", "type": "buffer"},
1391 {"name": "format", "type": "index format"},
1392 {"name": "offset", "type": "uint64_t", "default": "0"},
1393 {"name": "size", "type": "uint64_t", "default": "0"}
1394 ]
1395 },
1396 {
Austin Eng8a488c12019-08-13 22:12:54 +00001397 "name": "finish",
1398 "returns": "render bundle",
1399 "args": [
1400 {"name": "descriptor", "type": "render bundle descriptor", "annotation": "const*", "optional": true}
1401 ]
1402 }
1403 ]
1404 },
1405
1406 "render bundle descriptor": {
1407 "category": "structure",
1408 "extensible": true,
François Beaufort277d2e12019-10-03 14:56:49 +00001409 "members": [
1410 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}
1411 ]
Austin Eng8a488c12019-08-13 22:12:54 +00001412 },
1413
1414 "render bundle encoder descriptor": {
1415 "category": "structure",
1416 "extensible": true,
1417 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +00001418 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Austin Eng8a488c12019-08-13 22:12:54 +00001419 {"name": "color formats count", "type": "uint32_t"},
1420 {"name": "color formats", "type": "texture format", "annotation": "const*", "length": "color formats count"},
Corentin Wallezd55bd7a2019-09-05 09:12:32 +00001421 {"name": "depth stencil format", "type": "texture format", "default": "undefined"},
Austin Eng8a488c12019-08-13 22:12:54 +00001422 {"name": "sample count", "type": "uint32_t", "default": "1"}
1423 ]
1424 },
1425
Brandon Jones5e6a0922021-04-17 01:51:53 +00001426 "render pass color attachment": {
Jiawei Shao5e811ae2018-12-19 08:21:13 +00001427 "category": "structure",
1428 "members": [
Brandon Jones5e6a0922021-04-17 01:51:53 +00001429 {"name": "view", "type": "texture view", "optional": true},
Jiawei Shao5e811ae2018-12-19 08:21:13 +00001430 {"name": "resolve target", "type": "texture view", "optional": true},
1431 {"name": "load op", "type": "load op"},
1432 {"name": "store op", "type": "store op"},
Brandon Jones5e6a0922021-04-17 01:51:53 +00001433 {"name": "clear color", "type": "color"},
1434 {"name": "attachment", "type": "texture view", "optional": true}
Jiawei Shao5e811ae2018-12-19 08:21:13 +00001435 ]
1436 },
1437
Brandon Jones5e6a0922021-04-17 01:51:53 +00001438 "render pass color attachment descriptor": {
1439 "category": "typedef",
1440 "type": "render pass color attachment"
1441 },
1442
1443 "render pass depth stencil attachment": {
Jiawei Shao5e811ae2018-12-19 08:21:13 +00001444 "category": "structure",
1445 "members": [
Brandon Jones5e6a0922021-04-17 01:51:53 +00001446 {"name": "view", "type": "texture view", "optional": true},
Jiawei Shao5e811ae2018-12-19 08:21:13 +00001447 {"name": "depth load op", "type": "load op"},
1448 {"name": "depth store op", "type": "store op"},
1449 {"name": "clear depth", "type": "float"},
Brandon Jones7695afc2020-07-10 23:13:58 +00001450 {"name": "depth read only", "type": "bool", "default": "false"},
Jiawei Shao5e811ae2018-12-19 08:21:13 +00001451 {"name": "stencil load op", "type": "load op"},
1452 {"name": "stencil store op", "type": "store op"},
Brandon Jones7695afc2020-07-10 23:13:58 +00001453 {"name": "clear stencil", "type": "uint32_t", "default": "0"},
Brandon Jones5e6a0922021-04-17 01:51:53 +00001454 {"name": "stencil read only", "type": "bool", "default": "false"},
1455 {"name": "attachment", "type": "texture view", "optional": true}
Jiawei Shao5e811ae2018-12-19 08:21:13 +00001456 ]
1457 },
1458
Brandon Jones5e6a0922021-04-17 01:51:53 +00001459 "render pass depth stencil attachment descriptor": {
1460 "category": "typedef",
1461 "type": "render pass depth stencil attachment"
1462 },
1463
Corentin Wallez8d6b5d22018-05-11 13:04:44 -04001464 "render pass descriptor": {
Jiawei Shaob2c50232019-02-27 09:21:56 +00001465 "category": "structure",
Corentin Wallez5f53d532019-10-08 07:34:43 +00001466 "extensible": true,
Jiawei Shaob2c50232019-02-27 09:21:56 +00001467 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +00001468 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Jiawei Shaob2c50232019-02-27 09:21:56 +00001469 {"name": "color attachment count", "type": "uint32_t"},
Brandon Jones5e6a0922021-04-17 01:51:53 +00001470 {"name": "color attachments", "type": "render pass color attachment", "annotation": "const*", "length": "color attachment count"},
1471 {"name": "depth stencil attachment", "type": "render pass depth stencil attachment", "annotation": "const*", "optional": true},
Kai Ninomiya53405b52020-07-11 03:15:16 +00001472 {"name": "occlusion query set", "type": "query set", "optional": true}
Jiawei Shaob2c50232019-02-27 09:21:56 +00001473 ]
Austin Eng376f1c62017-05-30 20:03:44 -04001474 },
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001475 "render pass encoder": {
1476 "category": "object",
1477 "methods": [
1478 {
Yan, Shaobo300eec02018-12-21 10:40:26 +00001479 "name": "set pipeline",
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001480 "args": [
1481 {"name": "pipeline", "type": "render pipeline"}
1482 ]
1483 },
1484 {
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001485 "name": "set bind group",
1486 "args": [
1487 {"name": "group index", "type": "uint32_t"},
Yan, Shaobo991ab982019-03-18 06:01:37 +00001488 {"name": "group", "type": "bind group"},
Corentin Wallez70c8c102019-10-09 16:08:42 +00001489 {"name": "dynamic offset count", "type": "uint32_t", "default": "0"},
Austin Eng314fd352019-11-01 15:51:01 +00001490 {"name": "dynamic offsets", "type": "uint32_t", "annotation": "const*", "length": "dynamic offset count", "optional": true}
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001491 ]
1492 },
1493 {
Jiawei Shaoc789b842018-12-10 05:20:19 +00001494 "name": "draw",
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001495 "args": [
1496 {"name": "vertex count", "type": "uint32_t"},
Corentin Wallez67b1ad72020-03-31 16:21:35 +00001497 {"name": "instance count", "type": "uint32_t", "default": "1"},
1498 {"name": "first vertex", "type": "uint32_t", "default": "0"},
1499 {"name": "first instance", "type": "uint32_t", "default": "0"}
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001500 ]
1501 },
1502 {
Jiawei Shaoc789b842018-12-10 05:20:19 +00001503 "name": "draw indexed",
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001504 "args": [
1505 {"name": "index count", "type": "uint32_t"},
Corentin Wallez67b1ad72020-03-31 16:21:35 +00001506 {"name": "instance count", "type": "uint32_t", "default": "1"},
1507 {"name": "first index", "type": "uint32_t", "default": "0"},
1508 {"name": "base vertex", "type": "int32_t", "default": "0"},
1509 {"name": "first instance", "type": "uint32_t", "default": "0"}
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001510 ]
1511 },
1512 {
Idan Raiter05f7ad52019-06-10 20:56:27 +00001513 "name": "draw indirect",
1514 "args": [
1515 {"name": "indirect buffer", "type": "buffer"},
1516 {"name": "indirect offset", "type": "uint64_t"}
1517 ]
1518 },
1519 {
1520 "name": "draw indexed indirect",
1521 "args": [
1522 {"name": "indirect buffer", "type": "buffer"},
1523 {"name": "indirect offset", "type": "uint64_t"}
1524 ]
1525 },
1526 {
Austin Eng8a488c12019-08-13 22:12:54 +00001527 "name": "execute bundles",
1528 "args": [
1529 {"name": "bundles count", "type": "uint32_t"},
1530 {"name": "bundles", "type": "render bundle", "annotation": "const*", "length": "bundles count"}
1531 ]
1532 },
1533 {
Brandon Jones11d32c82019-02-20 20:21:00 +00001534 "name": "insert debug marker",
1535 "args": [
Kai Ninomiya51bbbef2020-07-12 16:01:38 +00001536 {"name": "marker label", "type": "char", "annotation": "const*", "length": "strlen"}
Brandon Jones11d32c82019-02-20 20:21:00 +00001537 ]
1538 },
1539 {
1540 "name": "pop debug group",
1541 "args": []
1542 },
1543 {
1544 "name": "push debug group",
1545 "args": [
1546 {"name": "group label", "type": "char", "annotation": "const*", "length": "strlen"}
1547 ]
1548 },
1549 {
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001550 "name": "set stencil reference",
1551 "args": [
1552 {"name": "reference", "type": "uint32_t"}
1553 ]
1554 },
1555 {
1556 "name": "set blend color",
1557 "args": [
Corentin Wallez00976d02019-02-05 12:13:10 +00001558 {"name": "color", "type": "color", "annotation": "const*"}
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001559 ]
1560 },
1561 {
Brandon Jones413dcf82021-04-15 19:33:58 +00001562 "name": "set blend constant",
1563 "args": [
1564 {"name": "color", "type": "color", "annotation": "const*"}
1565 ]
1566 },
1567 {
Yunchao He050ab492019-07-04 15:30:59 +00001568 "name": "set viewport",
1569 "args": [
1570 {"name": "x", "type": "float"},
1571 {"name": "y", "type": "float"},
1572 {"name": "width", "type": "float"},
1573 {"name": "height", "type": "float"},
1574 {"name": "min depth", "type": "float"},
1575 {"name": "max depth", "type": "float"}
1576 ]
1577 },
1578 {
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001579 "name": "set scissor rect",
1580 "args": [
1581 {"name": "x", "type": "uint32_t"},
1582 {"name": "y", "type": "uint32_t"},
1583 {"name": "width", "type": "uint32_t"},
1584 {"name": "height", "type": "uint32_t"}
1585 ]
1586 },
1587 {
François Beaufort91b21422019-10-10 07:29:58 +00001588 "name": "set vertex buffer",
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001589 "args": [
François Beaufort91b21422019-10-10 07:29:58 +00001590 {"name": "slot", "type": "uint32_t"},
1591 {"name": "buffer", "type": "buffer"},
Corentin Wallezc244f532020-04-24 09:42:03 +00001592 {"name": "offset", "type": "uint64_t", "default": "0"},
1593 {"name": "size", "type": "uint64_t", "default": "0"}
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001594 ]
1595 },
1596 {
1597 "name": "set index buffer",
1598 "args": [
1599 {"name": "buffer", "type": "buffer"},
Corentin Wallez5fad85b2020-11-25 08:54:14 +00001600 {"name": "format", "type": "index format"},
Corentin Wallezc244f532020-04-24 09:42:03 +00001601 {"name": "offset", "type": "uint64_t", "default": "0"},
1602 {"name": "size", "type": "uint64_t", "default": "0"}
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001603 ]
1604 },
1605 {
Brandon Jones8575cb32020-08-27 01:13:35 +00001606 "name": "set index buffer with format",
1607 "args": [
1608 {"name": "buffer", "type": "buffer"},
1609 {"name": "format", "type": "index format"},
1610 {"name": "offset", "type": "uint64_t", "default": "0"},
1611 {"name": "size", "type": "uint64_t", "default": "0"}
1612 ]
1613 },
1614 {
Hao Li01e44502020-11-18 09:47:52 +00001615 "name": "begin occlusion query",
1616 "args": [
1617 {"name": "query index", "type": "uint32_t"}
1618 ]
1619 },
1620 {
1621 "name": "end occlusion query"
1622 },
1623 {
Hao Li5191adc2020-07-01 10:48:16 +00001624 "name": "write timestamp",
1625 "args": [
1626 {"name": "query set", "type": "query set"},
1627 {"name": "query index", "type": "uint32_t"}
1628 ]
1629 },
1630 {
Kai Ninomiya4078ed82019-08-27 17:56:23 +00001631 "name": "end pass"
Corentin Wallez82fbccb2018-09-21 00:24:37 +00001632 }
1633 ]
1634 },
Corentin Wallez29ced282017-07-14 10:58:07 -04001635 "render pipeline": {
Austin Engf6eb8902019-11-22 17:02:22 +00001636 "category": "object",
1637 "methods": [
1638 {
1639 "name": "get bind group layout",
1640 "returns": "bind group layout",
1641 "args": [
Corentin Wallez373a3ff2020-04-01 18:22:36 +00001642 {"name": "group index", "type": "uint32_t"}
Austin Engf6eb8902019-11-22 17:02:22 +00001643 ]
1644 }
1645 ]
Corentin Wallez29ced282017-07-14 10:58:07 -04001646 },
Brandon Jones0702b702021-03-11 21:19:00 +00001647
1648 "vertex state": {
1649 "category": "structure",
1650 "extensible": true,
1651 "members": [
1652 {"name": "module", "type": "shader module"},
1653 {"name": "entry point", "type": "char", "annotation": "const*", "length": "strlen"},
Austin Eng41b4c9d2021-04-16 07:19:35 +00001654 {"name": "buffer count", "type": "uint32_t", "default": 0},
Brandon Jones0702b702021-03-11 21:19:00 +00001655 {"name": "buffers", "type": "vertex buffer layout", "annotation": "const*", "length": "buffer count"}
1656 ]
1657 },
1658
1659 "primitive state": {
1660 "category": "structure",
1661 "extensible": true,
1662 "members": [
1663 {"name": "topology", "type": "primitive topology", "default": "triangle list"},
1664 {"name": "strip index format", "type": "index format", "default": "undefined"},
1665 {"name": "front face", "type": "front face", "default": "CCW"},
1666 {"name": "cull mode", "type": "cull mode", "default": "none"}
1667 ]
1668 },
1669
Brian Ho2cccd5a2021-04-05 17:16:47 +00001670 "primitive depth clamping state": {
1671 "category": "structure",
1672 "chained": true,
1673 "members": [
1674 {"name": "clamp depth", "type": "bool", "default": "false"}
1675 ]
1676 },
1677
Brandon Jones0702b702021-03-11 21:19:00 +00001678 "depth stencil state": {
1679 "category": "structure",
1680 "extensible": true,
1681 "members": [
1682 {"name": "format", "type": "texture format"},
1683 {"name": "depth write enabled", "type": "bool", "default": "false"},
1684 {"name": "depth compare", "type": "compare function", "default": "always"},
1685 {"name": "stencil front", "type": "stencil face state"},
1686 {"name": "stencil back", "type": "stencil face state"},
1687 {"name": "stencil read mask", "type": "uint32_t", "default": "0xFFFFFFFF"},
1688 {"name": "stencil write mask", "type": "uint32_t", "default": "0xFFFFFFFF"},
1689 {"name": "depth bias", "type": "int32_t", "default": "0"},
1690 {"name": "depth bias slope scale", "type": "float", "default": "0.0f"},
1691 {"name": "depth bias clamp", "type": "float", "default": "0.0f"}
1692 ]
1693 },
1694
1695 "multisample state": {
1696 "category": "structure",
1697 "extensible": true,
1698 "members": [
1699 {"name": "count", "type": "uint32_t", "default": "1"},
1700 {"name": "mask", "type": "uint32_t", "default": "0xFFFFFFFF"},
1701 {"name": "alpha to coverage enabled", "type": "bool", "default": "false"}
1702 ]
1703 },
1704
1705 "fragment state": {
1706 "category": "structure",
1707 "extensible": true,
1708 "members": [
1709 {"name": "module", "type": "shader module"},
1710 {"name": "entry point", "type": "char", "annotation": "const*", "length": "strlen"},
1711 {"name": "target count", "type": "uint32_t"},
1712 {"name": "targets", "type": "color target state", "annotation": "const*", "length": "target count"}
1713 ]
1714 },
1715 "color target state": {
1716 "category": "structure",
1717 "extensible": true,
1718 "members": [
1719 {"name": "format", "type": "texture format"},
1720 {"name": "blend", "type": "blend state", "annotation": "const*", "optional": true},
1721 {"name": "write mask", "type": "color write mask", "default": "all"}
1722 ]
1723 },
1724 "blend state": {
1725 "category": "structure",
1726 "extensible": false,
1727 "members": [
1728 {"name": "color", "type": "blend component"},
1729 {"name": "alpha", "type": "blend component"}
1730 ]
1731 },
1732
Yan, Shaoboa4924272018-12-10 19:47:22 +00001733 "render pipeline descriptor": {
1734 "category": "structure",
1735 "extensible": true,
1736 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +00001737 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Austin Engf6eb8902019-11-22 17:02:22 +00001738 {"name": "layout", "type": "pipeline layout", "optional": true},
Jinho Bang0b826712019-10-07 12:23:09 +00001739 {"name": "vertex stage", "type": "programmable stage descriptor"},
1740 {"name": "fragment stage", "type": "programmable stage descriptor", "annotation": "const*", "optional": true},
Kai Ninomiyaae1f25f2019-11-07 22:23:29 +00001741 {"name": "vertex state", "type": "vertex state descriptor", "annotation": "const*", "optional": true},
Yan, Shaoboa4924272018-12-10 19:47:22 +00001742 {"name": "primitive topology", "type": "primitive topology"},
François Beaufort4af98082019-07-16 17:01:59 +00001743 {"name": "rasterization state", "type": "rasterization state descriptor", "annotation": "const*", "optional": true},
Corentin Wallez8f938712019-07-08 19:20:22 +00001744 {"name": "sample count", "type": "uint32_t", "default": "1"},
Corentin Wallezf872e692019-02-13 10:15:38 +00001745 {"name": "depth stencil state", "type": "depth stencil state descriptor", "annotation": "const*", "optional": true},
Jiawei Shao20301662019-02-21 00:45:19 +00001746 {"name": "color state count", "type": "uint32_t"},
Corentin Wallezc81a7172019-09-20 23:22:27 +00001747 {"name": "color states", "type": "color state descriptor", "annotation": "const*", "length": "color state count"},
Corentin Wallezf07e85c2019-07-15 20:47:56 +00001748 {"name": "sample mask", "type": "uint32_t", "default": "0xFFFFFFFF"},
1749 {"name": "alpha to coverage enabled", "type": "bool", "default": "false"}
Corentin Wallez29ced282017-07-14 10:58:07 -04001750 ]
1751 },
Brandon Jones0702b702021-03-11 21:19:00 +00001752
1753 "render pipeline descriptor 2": {
1754 "category": "structure",
1755 "extensible": true,
1756 "members": [
1757 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
1758 {"name": "layout", "type": "pipeline layout", "optional": true},
1759 {"name": "vertex", "type": "vertex state"},
1760 {"name": "primitive", "type": "primitive state"},
1761 {"name": "depth stencil", "type": "depth stencil state", "annotation": "const*", "optional": true},
1762 {"name": "multisample", "type": "multisample state"},
1763 {"name": "fragment", "type": "fragment state", "annotation": "const*", "optional": true}
1764 ]
1765 },
1766
Austin Eng376f1c62017-05-30 20:03:44 -04001767 "sampler": {
1768 "category": "object"
1769 },
Corentin Wallez1ae19e82018-05-17 17:09:07 -04001770 "sampler descriptor": {
1771 "category": "structure",
1772 "extensible": true,
1773 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +00001774 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Corentin Wallez8f938712019-07-08 19:20:22 +00001775 {"name": "address mode u", "type": "address mode", "default": "clamp to edge"},
1776 {"name": "address mode v", "type": "address mode", "default": "clamp to edge"},
1777 {"name": "address mode w", "type": "address mode", "default": "clamp to edge"},
1778 {"name": "mag filter", "type": "filter mode", "default": "nearest"},
1779 {"name": "min filter", "type": "filter mode", "default": "nearest"},
1780 {"name": "mipmap filter", "type": "filter mode", "default": "nearest"},
1781 {"name": "lod min clamp", "type": "float", "default": "0.0f"},
1782 {"name": "lod max clamp", "type": "float", "default": "1000.0f"},
shrekshaof8c5e4a2020-12-24 03:11:17 +00001783 {"name": "compare", "type": "compare function", "default": "undefined"},
1784 {"name": "max anisotropy", "type": "uint16_t", "default": "1"}
Austin Eng376f1c62017-05-30 20:03:44 -04001785 ]
1786 },
1787 "shader module": {
Brandon Jones6f2bbe92021-04-05 23:34:17 +00001788 "category": "object",
1789 "methods": [
1790 {
1791 "name": "get compilation info",
1792 "args": [
1793 {"name": "callback", "type": "compilation info callback"},
1794 {"name": "userdata", "type": "void", "annotation": "*"}
1795 ]
1796 }
1797 ]
Austin Eng376f1c62017-05-30 20:03:44 -04001798 },
Corentin Wallezdf671032018-08-20 17:01:20 +02001799 "shader module descriptor": {
1800 "category": "structure",
1801 "extensible": true,
1802 "members": [
Corentin Wallez2eca22f2020-05-13 17:23:35 +00001803 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}
Corentin Wallezfee27832020-04-21 08:04:48 +00001804 ]
1805 },
1806 "shader module SPIRV descriptor": {
1807 "category": "structure",
1808 "chained": true,
1809 "members": [
Corentin Wallezdf671032018-08-20 17:01:20 +02001810 {"name": "code size", "type": "uint32_t"},
1811 {"name": "code", "type": "uint32_t", "annotation": "const*", "length": "code size"}
Austin Eng376f1c62017-05-30 20:03:44 -04001812 ]
1813 },
Corentin Wallezfee27832020-04-21 08:04:48 +00001814 "shader module WGSL descriptor": {
1815 "category": "structure",
1816 "chained": true,
1817 "members": [
1818 {"name": "source", "type": "char", "annotation": "const*", "length": "strlen"}
1819 ]
1820 },
Corentin Wallezb9b088f2019-08-27 08:42:29 +00001821 "shader stage": {
Austin Eng376f1c62017-05-30 20:03:44 -04001822 "category": "bitmask",
1823 "values": [
Corentin Wallezbe985c12017-07-20 11:00:39 -04001824 {"value": 0, "name": "none"},
Austin Eng376f1c62017-05-30 20:03:44 -04001825 {"value": 1, "name": "vertex"},
1826 {"value": 2, "name": "fragment"},
1827 {"value": 4, "name": "compute"}
1828 ]
1829 },
1830 "stencil operation": {
1831 "category": "enum",
1832 "values": [
1833 {"value": 0, "name": "keep"},
1834 {"value": 1, "name": "zero"},
1835 {"value": 2, "name": "replace"},
1836 {"value": 3, "name": "invert"},
1837 {"value": 4, "name": "increment clamp"},
1838 {"value": 5, "name": "decrement clamp"},
1839 {"value": 6, "name": "increment wrap"},
1840 {"value": 7, "name": "decrement wrap"}
Austin Eng10634392017-06-01 11:30:03 -04001841 ]
Austin Eng376f1c62017-05-30 20:03:44 -04001842 },
Brandon Jones0702b702021-03-11 21:19:00 +00001843 "stencil face state": {
Yunchao He48485e32018-12-15 02:32:34 +00001844 "category": "structure",
1845 "extensible": false,
1846 "members": [
Corentin Wallez8f938712019-07-08 19:20:22 +00001847 {"name": "compare", "type": "compare function", "default": "always"},
1848 {"name": "fail op", "type": "stencil operation", "default": "keep"},
1849 {"name": "depth fail op", "type": "stencil operation", "default": "keep"},
1850 {"name": "pass op", "type": "stencil operation", "default": "keep"}
Yunchao He48485e32018-12-15 02:32:34 +00001851 ]
1852 },
Brandon Jones0702b702021-03-11 21:19:00 +00001853 "stencil state face descriptor": {
1854 "category": "typedef",
1855 "type": "stencil face state"
1856 },
Corentin Wallez3a1746e2020-01-15 13:14:12 +00001857 "surface": {
1858 "category": "object"
1859 },
1860 "surface descriptor": {
1861 "category": "structure",
1862 "extensible": true,
1863 "members": [
1864 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}
1865 ]
1866 },
Corentin Wallez9585c462020-07-06 18:50:00 +00001867 "surface descriptor from canvas HTML selector": {
Corentin Wallezc2e16962020-01-22 21:37:26 +00001868 "category": "structure",
1869 "chained": true,
1870 "members": [
Corentin Wallez9585c462020-07-06 18:50:00 +00001871 {"name": "selector", "type": "char", "annotation": "const*", "length": "strlen"}
Corentin Wallezc2e16962020-01-22 21:37:26 +00001872 ]
1873 },
Corentin Wallez3a1746e2020-01-15 13:14:12 +00001874 "surface descriptor from metal layer": {
1875 "category": "structure",
1876 "chained": true,
Kai Ninomiya7b6246a2020-01-28 23:54:38 +00001877 "javascript": false,
Corentin Wallez3a1746e2020-01-15 13:14:12 +00001878 "members": [
1879 {"name": "layer", "type": "void", "annotation": "*"}
1880 ]
1881 },
1882 "surface descriptor from windows HWND": {
1883 "category": "structure",
1884 "chained": true,
Kai Ninomiya7b6246a2020-01-28 23:54:38 +00001885 "javascript": false,
Corentin Wallez3a1746e2020-01-15 13:14:12 +00001886 "members": [
1887 {"name": "hinstance", "type": "void", "annotation": "*"},
1888 {"name": "hwnd", "type": "void", "annotation": "*"}
1889 ]
1890 },
1891 "surface descriptor from xlib": {
1892 "category": "structure",
1893 "chained": true,
Kai Ninomiya7b6246a2020-01-28 23:54:38 +00001894 "javascript": false,
Corentin Wallez3a1746e2020-01-15 13:14:12 +00001895 "members": [
1896 {"name": "display", "type": "void", "annotation": "*"},
1897 {"name": "window", "type": "uint32_t"}
1898 ]
1899 },
陈俊嘉74326fe2021-04-27 16:43:27 +00001900 "surface descriptor from windows core window": {
1901 "category": "structure",
1902 "chained": true,
1903 "javascript": false,
1904 "members": [
1905 {"name": "core window", "type": "void", "annotation": "*"}
1906 ]
1907 },
Kai Ninomiya35bf4242017-07-19 15:41:17 -07001908 "swap chain": {
1909 "category": "object",
1910 "methods": [
1911 {
1912 "name": "configure",
1913 "args": [
1914 {"name": "format", "type": "texture format"},
Corentin Wallez9e9e29f2019-08-27 08:21:39 +00001915 {"name": "allowed usage", "type": "texture usage"},
Kai Ninomiya35bf4242017-07-19 15:41:17 -07001916 {"name": "width", "type": "uint32_t"},
1917 {"name": "height", "type": "uint32_t"}
1918 ]
1919 },
Corentin Wallez604072b2019-11-12 18:30:11 +00001920 {"name": "get current texture view", "returns": "texture view"},
1921 {"name": "present"}
Kai Ninomiya35bf4242017-07-19 15:41:17 -07001922 ]
1923 },
Corentin Wallez7be2a712019-02-15 11:15:58 +00001924 "swap chain descriptor": {
1925 "category": "structure",
1926 "extensible": true,
1927 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +00001928 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Corentin Wallezd87e6762020-01-23 17:20:38 +00001929 {"name": "usage", "type": "texture usage"},
1930 {"name": "format", "type": "texture format"},
1931 {"name": "width", "type": "uint32_t"},
1932 {"name": "height", "type": "uint32_t"},
1933 {"name": "present mode", "type": "present mode"},
1934 {"name": "implementation", "type": "uint64_t", "default": 0}
Kai Ninomiya35bf4242017-07-19 15:41:17 -07001935 ]
1936 },
Corentin Wallez2b24c3d2020-01-15 09:54:42 +00001937 "s type": {
1938 "category": "enum",
Kai Ninomiya7b6246a2020-01-28 23:54:38 +00001939 "javascript": false,
Corentin Wallez2b24c3d2020-01-15 09:54:42 +00001940 "values": [
Austin Eng76a8d0b2020-04-03 17:37:48 +00001941 {"value": 0, "name": "invalid", "valid": false},
Corentin Wallez3a1746e2020-01-15 13:14:12 +00001942 {"value": 1, "name": "surface descriptor from metal layer"},
1943 {"value": 2, "name": "surface descriptor from windows HWND"},
Corentin Wallezc2e16962020-01-22 21:37:26 +00001944 {"value": 3, "name": "surface descriptor from xlib"},
Corentin Wallez9585c462020-07-06 18:50:00 +00001945 {"value": 4, "name": "surface descriptor from canvas HTML selector"},
Corentin Wallezfee27832020-04-21 08:04:48 +00001946 {"value": 5, "name": "shader module SPIRV descriptor"},
1947 {"value": 6, "name": "shader module WGSL descriptor"},
陈俊嘉74326fe2021-04-27 16:43:27 +00001948 {"value": 7, "name": "primitive depth clamping state"},
1949 {"value": 8, "name": "surface descriptor from windows core window"}
Corentin Wallez2b24c3d2020-01-15 09:54:42 +00001950 ]
1951 },
Austin Eng376f1c62017-05-30 20:03:44 -04001952 "texture": {
1953 "category": "object",
1954 "methods": [
1955 {
Austin Engb4b3ea052019-04-09 16:57:00 +00001956 "name": "create view",
Jiawei Shao6329e5a2018-10-12 08:32:58 +00001957 "returns": "texture view",
1958 "args": [
Kai Ninomiya93196db2019-08-26 22:51:19 +00001959 {"name": "descriptor", "type": "texture view descriptor", "annotation": "const*", "optional": true}
Jiawei Shao6329e5a2018-10-12 08:32:58 +00001960 ]
Natasha Leecae68ff2019-03-27 22:04:10 +00001961 },
1962 {
1963 "name": "destroy"
Austin Eng376f1c62017-05-30 20:03:44 -04001964 }
1965 ]
1966 },
Brandon Jonesac71e342018-11-28 17:54:13 +00001967 "texture aspect": {
Corentin Wallez5df84ce2019-07-08 08:55:21 +00001968 "category": "enum",
Brandon Jonesac71e342018-11-28 17:54:13 +00001969 "values": [
Corentin Wallez5df84ce2019-07-08 08:55:21 +00001970 {"value": 0, "name": "all"},
1971 {"value": 1, "name": "stencil only"},
Bryan Bernhart14a23982021-02-05 20:11:24 +00001972 {"value": 2, "name": "depth only"},
1973 {"value": 3, "name": "plane 0 only"},
1974 {"value": 4, "name": "plane 1 only"}
Brandon Jonesac71e342018-11-28 17:54:13 +00001975 ]
1976 },
Corentin Wallezf463a202019-08-21 12:16:33 +00001977 "texture component type": {
1978 "category": "enum",
1979 "values": [
1980 {"value": 0, "name": "float"},
1981 {"value": 1, "name": "sint"},
Corentin Wallez4196a542020-10-16 14:13:16 +00001982 {"value": 2, "name": "uint"},
1983 {"value": 3, "name": "depth comparison"}
Corentin Wallezf463a202019-08-21 12:16:33 +00001984 ]
1985 },
Brandon Jonesac71e342018-11-28 17:54:13 +00001986 "texture copy view": {
Corentin Wallez80915842021-03-04 18:13:45 +00001987 "category": "typedef",
1988 "type": "image copy texture"
Brandon Jonesac71e342018-11-28 17:54:13 +00001989 },
Tomek Ponitka0f5d4962020-07-07 10:18:51 +00001990 "texture data layout": {
1991 "category": "structure",
1992 "extensible": true,
1993 "members": [
1994 {"name": "offset", "type": "uint64_t", "default": 0},
Kai Ninomiyacf820d72020-12-16 07:53:30 +00001995 {"name": "bytes per row", "type": "uint32_t", "default": "WGPU_COPY_STRIDE_UNDEFINED"},
1996 {"name": "rows per image", "type": "uint32_t", "default": "WGPU_COPY_STRIDE_UNDEFINED"}
Tomek Ponitka0f5d4962020-07-07 10:18:51 +00001997 ]
1998 },
Jiawei Shao425428f2018-08-27 08:44:48 +08001999 "texture descriptor": {
2000 "category": "structure",
2001 "extensible": true,
2002 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +00002003 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Corentin Wallez9e9e29f2019-08-27 08:21:39 +00002004 {"name": "usage", "type": "texture usage"},
Corentin Wallez8f938712019-07-08 19:20:22 +00002005 {"name": "dimension", "type": "texture dimension", "default": "2D"},
Corentin Wallez29353d62018-09-18 12:49:22 +00002006 {"name": "size", "type": "extent 3D"},
Jiawei Shao425428f2018-08-27 08:44:48 +08002007 {"name": "format", "type": "texture format"},
Corentin Wallez8f938712019-07-08 19:20:22 +00002008 {"name": "mip level count", "type": "uint32_t", "default": 1},
2009 {"name": "sample count", "type": "uint32_t", "default": 1}
Austin Eng376f1c62017-05-30 20:03:44 -04002010 ]
2011 },
2012 "texture dimension": {
2013 "category": "enum",
2014 "values": [
Corentin Wallezf07e85c2019-07-15 20:47:56 +00002015 {"value": 0, "name": "1D"},
2016 {"value": 1, "name": "2D"},
2017 {"value": 2, "name": "3D"}
Austin Eng376f1c62017-05-30 20:03:44 -04002018 ]
2019 },
Corentin Walleza60799f2018-09-11 18:16:54 +00002020 "texture format": {
2021 "category": "enum",
2022 "values": [
Kai Ninomiya7b6246a2020-01-28 23:54:38 +00002023 {"value": 0, "name": "undefined", "valid": false, "jsrepr": "undefined"},
Corentin Wallezd55bd7a2019-09-05 09:12:32 +00002024 {"value": 1, "name": "R8 unorm"},
2025 {"value": 2, "name": "R8 snorm"},
2026 {"value": 3, "name": "R8 uint"},
2027 {"value": 4, "name": "R8 sint"},
Corentin Wallez431d6182019-07-01 09:58:07 +00002028
Corentin Wallezd55bd7a2019-09-05 09:12:32 +00002029 {"value": 5, "name": "R16 uint"},
2030 {"value": 6, "name": "R16 sint"},
2031 {"value": 7, "name": "R16 float"},
2032 {"value": 8, "name": "RG8 unorm"},
2033 {"value": 9, "name": "RG8 snorm"},
2034 {"value": 10, "name": "RG8 uint"},
2035 {"value": 11, "name": "RG8 sint"},
Corentin Wallez431d6182019-07-01 09:58:07 +00002036
Corentin Wallezd55bd7a2019-09-05 09:12:32 +00002037 {"value": 12, "name": "R32 float"},
2038 {"value": 13, "name": "R32 uint"},
2039 {"value": 14, "name": "R32 sint"},
2040 {"value": 15, "name": "RG16 uint"},
2041 {"value": 16, "name": "RG16 sint"},
2042 {"value": 17, "name": "RG16 float"},
2043 {"value": 18, "name": "RGBA8 unorm"},
2044 {"value": 19, "name": "RGBA8 unorm srgb"},
2045 {"value": 20, "name": "RGBA8 snorm"},
2046 {"value": 21, "name": "RGBA8 uint"},
2047 {"value": 22, "name": "RGBA8 sint"},
2048 {"value": 23, "name": "BGRA8 unorm"},
2049 {"value": 24, "name": "BGRA8 unorm srgb"},
2050 {"value": 25, "name": "RGB10 A2 unorm"},
Corentin Wallez2f6e4ec2020-08-19 21:51:20 +00002051 {"value": 26, "name": "RG11 B10 ufloat"},
2052 {"value": 27, "name": "RGB9 E5 ufloat"},
Corentin Wallez431d6182019-07-01 09:58:07 +00002053
Corentin Wallez2f6e4ec2020-08-19 21:51:20 +00002054 {"value": 28, "name": "RG32 float"},
2055 {"value": 29, "name": "RG32 uint"},
2056 {"value": 30, "name": "RG32 sint"},
2057 {"value": 31, "name": "RGBA16 uint"},
2058 {"value": 32, "name": "RGBA16 sint"},
2059 {"value": 33, "name": "RGBA16 float"},
Corentin Wallez431d6182019-07-01 09:58:07 +00002060
Corentin Wallez2f6e4ec2020-08-19 21:51:20 +00002061 {"value": 34, "name": "RGBA32 float"},
2062 {"value": 35, "name": "RGBA32 uint"},
2063 {"value": 36, "name": "RGBA32 sint"},
Corentin Wallez431d6182019-07-01 09:58:07 +00002064
Corentin Wallez2f6e4ec2020-08-19 21:51:20 +00002065 {"value": 37, "name": "depth32 float"},
2066 {"value": 38, "name": "depth24 plus"},
Bryan Bernhart536c7ae2021-02-16 19:55:09 +00002067 {"value": 39, "name": "stencil8"},
2068 {"value": 40, "name": "depth24 plus stencil8"},
Corentin Wallez431d6182019-07-01 09:58:07 +00002069
Bryan Bernhart536c7ae2021-02-16 19:55:09 +00002070 {"value": 41, "name": "BC1 RGBA unorm"},
2071 {"value": 42, "name": "BC1 RGBA unorm srgb"},
2072 {"value": 43, "name": "BC2 RGBA unorm"},
2073 {"value": 44, "name": "BC2 RGBA unorm srgb"},
2074 {"value": 45, "name": "BC3 RGBA unorm"},
2075 {"value": 46, "name": "BC3 RGBA unorm srgb"},
2076 {"value": 47, "name": "BC4 R unorm"},
2077 {"value": 48, "name": "BC4 R snorm"},
2078 {"value": 49, "name": "BC5 RG unorm"},
2079 {"value": 50, "name": "BC5 RG snorm"},
2080 {"value": 51, "name": "BC6H RGB ufloat"},
2081 {"value": 52, "name": "BC6H RGB float"},
2082 {"value": 53, "name": "BC7 RGBA unorm"},
2083 {"value": 54, "name": "BC7 RGBA unorm srgb"},
2084 {"value": 55, "name": "R8 BG8 Biplanar 420 unorm"}
Corentin Walleza60799f2018-09-11 18:16:54 +00002085 ]
2086 },
Corentin Wallez9e9e29f2019-08-27 08:21:39 +00002087 "texture usage": {
Austin Eng376f1c62017-05-30 20:03:44 -04002088 "category": "bitmask",
2089 "values": [
2090 {"value": 0, "name": "none"},
Corentin Wallezec053552019-07-08 10:05:46 +00002091 {"value": 1, "name": "copy src"},
2092 {"value": 2, "name": "copy dst"},
Austin Eng376f1c62017-05-30 20:03:44 -04002093 {"value": 4, "name": "sampled"},
2094 {"value": 8, "name": "storage"},
Kai Ninomiya35bf4242017-07-19 15:41:17 -07002095 {"value": 16, "name": "output attachment"},
Corentin Wallez6b087812020-10-27 15:35:56 +00002096 {"value": 16, "name": "render attachment"},
Kai Ninomiya35bf4242017-07-19 15:41:17 -07002097 {"value": 32, "name": "present"}
Austin Eng376f1c62017-05-30 20:03:44 -04002098 ]
2099 },
Jiawei Shao6329e5a2018-10-12 08:32:58 +00002100 "texture view descriptor": {
2101 "category": "structure",
2102 "extensible": true,
2103 "members": [
François Beaufort277d2e12019-10-03 14:56:49 +00002104 {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
Corentin Wallezd55bd7a2019-09-05 09:12:32 +00002105 {"name": "format", "type": "texture format", "default": "undefined"},
2106 {"name": "dimension", "type": "texture view dimension", "default": "undefined"},
Corentin Wallez8f938712019-07-08 19:20:22 +00002107 {"name": "base mip level", "type": "uint32_t", "default": "0"},
Kai Ninomiya93196db2019-08-26 22:51:19 +00002108 {"name": "mip level count", "type": "uint32_t", "default": "0"},
Corentin Wallez8f938712019-07-08 19:20:22 +00002109 {"name": "base array layer", "type": "uint32_t", "default": "0"},
Corentin Wallezdbe74bc2019-09-10 08:30:43 +00002110 {"name": "array layer count", "type": "uint32_t", "default": "0"},
2111 {"name": "aspect", "type": "texture aspect", "default": "all"}
Jiawei Shao6329e5a2018-10-12 08:32:58 +00002112 ]
2113 },
Austin Eng376f1c62017-05-30 20:03:44 -04002114 "texture view": {
2115 "category": "object"
2116 },
Jiawei Shao6329e5a2018-10-12 08:32:58 +00002117 "texture view dimension": {
2118 "category": "enum",
2119 "values": [
Kai Ninomiya7b6246a2020-01-28 23:54:38 +00002120 {"value": 0, "name": "undefined", "valid": false, "jsrepr": "undefined"},
Corentin Wallezd55bd7a2019-09-05 09:12:32 +00002121 {"value": 1, "name": "1D"},
2122 {"value": 2, "name": "2D"},
2123 {"value": 3, "name": "2D array"},
2124 {"value": 4, "name": "cube"},
2125 {"value": 5, "name": "cube array"},
2126 {"value": 6, "name": "3D"}
Jiawei Shao6329e5a2018-10-12 08:32:58 +00002127 ]
2128 },
Austin Eng376f1c62017-05-30 20:03:44 -04002129 "vertex format": {
2130 "category": "enum",
2131 "values": [
Brandon Jonese3f10e32021-02-26 02:20:25 +00002132 {"value": 0, "name": "undefined", "valid": false, "jsrepr": "undefined"},
2133 {"value": 1, "name": "uint8x2"},
2134 {"value": 2, "name": "uint8x4"},
2135 {"value": 3, "name": "sint8x2"},
2136 {"value": 4, "name": "sint8x4"},
2137 {"value": 5, "name": "unorm8x2"},
2138 {"value": 6, "name": "unorm8x4"},
2139 {"value": 7, "name": "snorm8x2"},
2140 {"value": 8, "name": "snorm8x4"},
2141 {"value": 9, "name": "uint16x2"},
2142 {"value": 10, "name": "uint16x4"},
2143 {"value": 11, "name": "sint16x2"},
2144 {"value": 12, "name": "sint16x4"},
2145 {"value": 13, "name": "unorm16x2"},
2146 {"value": 14, "name": "unorm16x4"},
2147 {"value": 15, "name": "snorm16x2"},
2148 {"value": 16, "name": "snorm16x4"},
2149 {"value": 17, "name": "float16x2"},
2150 {"value": 18, "name": "float16x4"},
2151 {"value": 19, "name": "float32"},
2152 {"value": 20, "name": "float32x2"},
2153 {"value": 21, "name": "float32x3"},
2154 {"value": 22, "name": "float32x4"},
2155 {"value": 23, "name": "uint32"},
2156 {"value": 24, "name": "uint32x2"},
2157 {"value": 25, "name": "uint32x3"},
2158 {"value": 26, "name": "uint32x4"},
2159 {"value": 27, "name": "sint32"},
2160 {"value": 28, "name": "sint32x2"},
2161 {"value": 29, "name": "sint32x3"},
2162 {"value": 30, "name": "sint32x4"},
2163
2164 {"value": 101, "name": "uChar2"},
2165 {"value": 102, "name": "uChar4"},
2166 {"value": 103, "name": "char2"},
2167 {"value": 104, "name": "char4"},
2168 {"value": 105, "name": "uChar2 norm"},
2169 {"value": 106, "name": "uChar4 norm"},
2170 {"value": 107, "name": "char2 norm"},
2171 {"value": 108, "name": "char4 norm"},
2172 {"value": 109, "name": "uShort2"},
2173 {"value": 110, "name": "uShort4"},
2174 {"value": 111, "name": "short2"},
2175 {"value": 112, "name": "short4"},
2176 {"value": 113, "name": "uShort2 norm"},
2177 {"value": 114, "name": "uShort4 norm"},
2178 {"value": 115, "name": "short2 norm"},
2179 {"value": 116, "name": "short4 norm"},
2180 {"value": 117, "name": "half2"},
2181 {"value": 118, "name": "half4"},
2182 {"value": 119, "name": "float"},
2183 {"value": 120, "name": "float2"},
2184 {"value": 121, "name": "float3"},
2185 {"value": 122, "name": "float4"},
2186 {"value": 123, "name": "uInt"},
2187 {"value": 124, "name": "uInt2"},
2188 {"value": 125, "name": "uInt3"},
2189 {"value": 126, "name": "uInt4"},
2190 {"value": 127, "name": "int"},
2191 {"value": 128, "name": "int2"},
2192 {"value": 129, "name": "int3"},
2193 {"value": 130, "name": "int4"}
Austin Eng376f1c62017-05-30 20:03:44 -04002194 ]
2195 },
Austin Engc7f416c2019-01-15 20:49:53 +00002196 "ObjectType": {
2197 "_comment": "Only used for the wire",
2198 "category": "native"
2199 },
2200 "ObjectId": {
2201 "_comment": "Only used for the wire",
2202 "category": "native"
2203 },
2204 "ObjectHandle": {
2205 "_comment": "Only used for the wire",
2206 "category": "native"
2207 },
Austin Eng376f1c62017-05-30 20:03:44 -04002208 "void": {
2209 "category": "native"
2210 },
Corentin Wallez1325ab12020-06-30 11:51:14 +00002211 "void *": {
2212 "category": "native"
2213 },
2214 "void const *": {
2215 "category": "native"
2216 },
Yunchao Hec33a8c12019-04-11 18:46:54 +00002217 "int32_t": {
2218 "category": "native"
2219 },
Corentin Wallez47a33412020-06-02 09:24:39 +00002220 "size_t": {
2221 "category": "native"
2222 },
shrekshaof8c5e4a2020-12-24 03:11:17 +00002223 "uint16_t": {
2224 "category": "native"
2225 },
2226 "uint32_t": {
2227 "category": "native"
2228 },
Kai Ninomiya35bf4242017-07-19 15:41:17 -07002229 "uint64_t": {
2230 "category": "native"
Corentin Walleza60799f2018-09-11 18:16:54 +00002231 },
2232 "uint8_t": {
2233 "category": "native"
Austin Eng376f1c62017-05-30 20:03:44 -04002234 }
2235}