blob: ab069acb10ed85a93aa811f4419577dd729a937a [file] [log] [blame]
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001"""VK API description"""
Chia-I Wufb2559d2014-08-01 11:19:52 +08002
3# Copyright (C) 2014 LunarG, Inc.
4#
5# Permission is hereby granted, free of charge, to any person obtaining a
6# copy of this software and associated documentation files (the "Software"),
7# to deal in the Software without restriction, including without limitation
8# the rights to use, copy, modify, merge, publish, distribute, sublicense,
9# and/or sell copies of the Software, and to permit persons to whom the
10# Software is furnished to do so, subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be included
13# in all copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21# DEALINGS IN THE SOFTWARE.
22
23class Param(object):
24 """A function parameter."""
25
26 def __init__(self, ty, name):
27 self.ty = ty
28 self.name = name
29
30 def c(self):
31 """Return the parameter in C."""
32 idx = self.ty.find("[")
33
34 # arrays have a different syntax
35 if idx >= 0:
36 return "%s %s%s" % (self.ty[:idx], self.name, self.ty[idx:])
37 else:
38 return "%s %s" % (self.ty, self.name)
39
Chia-I Wu41911d52015-01-04 15:02:50 +080040 def indirection_level(self):
41 """Return the level of indirection."""
42 return self.ty.count("*") + self.ty.count("[")
43
44 def dereferenced_type(self, level=0):
45 """Return the type after dereferencing."""
46 if not level:
47 level = self.indirection_level()
48
49 deref = self.ty if level else ""
50 while level > 0:
51 idx = deref.rfind("[")
52 if idx < 0:
53 idx = deref.rfind("*")
54 if idx < 0:
55 deref = ""
56 break
57 deref = deref[:idx]
58 level -= 1;
59
60 return deref.rstrip()
61
Chia-I Wu8f4508a2015-01-04 14:08:46 +080062 def __repr__(self):
63 return "Param(\"%s\", \"%s\")" % (self.ty, self.name)
64
Chia-I Wufb2559d2014-08-01 11:19:52 +080065class Proto(object):
66 """A function prototype."""
67
Chia-I Wu82d0c6e2015-01-01 09:31:15 +080068 def __init__(self, ret, name, params=[]):
Chia-I Wufb2559d2014-08-01 11:19:52 +080069 # the proto has only a param
Chia-I Wu82d0c6e2015-01-01 09:31:15 +080070 if not isinstance(params, list):
71 params = [params]
Chia-I Wufb2559d2014-08-01 11:19:52 +080072
73 self.ret = ret
74 self.name = name
75 self.params = params
76
77 def c_params(self, need_type=True, need_name=True):
78 """Return the parameter list in C."""
79 if self.params and (need_type or need_name):
80 if need_type and need_name:
81 return ", ".join([param.c() for param in self.params])
82 elif need_type:
83 return ", ".join([param.ty for param in self.params])
84 else:
85 return ", ".join([param.name for param in self.params])
86 else:
87 return "void" if need_type else ""
88
89 def c_decl(self, name, attr="", typed=False, need_param_names=True):
90 """Return a named declaration in C."""
91 format_vals = (self.ret,
92 attr + " " if attr else "",
93 name,
94 self.c_params(need_name=need_param_names))
95
96 if typed:
97 return "%s (%s*%s)(%s)" % format_vals
98 else:
99 return "%s %s%s(%s)" % format_vals
100
Chia-I Wu2560a602015-01-04 12:00:01 +0800101 def c_pretty_decl(self, name, attr=""):
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600102 """Return a named declaration in C, with vulkan.h formatting."""
Chia-I Wu2560a602015-01-04 12:00:01 +0800103 plist = []
104 for param in self.params:
105 idx = param.ty.find("[")
106 if idx < 0:
107 idx = len(param.ty)
108
109 pad = 44 - idx
110 if pad <= 0:
111 pad = 1
112
113 plist.append(" %s%s%s%s" % (param.ty[:idx],
114 " " * pad, param.name, param.ty[idx:]))
115
116 return "%s %s%s(\n%s)" % (self.ret,
117 attr + " " if attr else "",
118 name,
119 ",\n".join(plist))
120
Chia-I Wufb2559d2014-08-01 11:19:52 +0800121 def c_typedef(self, suffix="", attr=""):
122 """Return the typedef for the prototype in C."""
123 return self.c_decl(self.name + suffix, attr=attr, typed=True)
124
125 def c_func(self, prefix="", attr=""):
126 """Return the prototype in C."""
127 return self.c_decl(prefix + self.name, attr=attr, typed=False)
128
129 def c_call(self):
130 """Return a call to the prototype in C."""
131 return "%s(%s)" % (self.name, self.c_params(need_type=False))
132
Chia-I Wu41911d52015-01-04 15:02:50 +0800133 def object_in_params(self):
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600134 """Return the params that are simple VK objects and are inputs."""
Chia-I Wu41911d52015-01-04 15:02:50 +0800135 return [param for param in self.params if param.ty in objects]
136
137 def object_out_params(self):
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600138 """Return the params that are simple VK objects and are outputs."""
Chia-I Wu41911d52015-01-04 15:02:50 +0800139 return [param for param in self.params
140 if param.dereferenced_type() in objects]
141
Chia-I Wu8f4508a2015-01-04 14:08:46 +0800142 def __repr__(self):
143 param_strs = []
144 for param in self.params:
145 param_strs.append(str(param))
146 param_str = " [%s]" % (",\n ".join(param_strs))
147
148 return "Proto(\"%s\", \"%s\",\n%s)" % \
149 (self.ret, self.name, param_str)
150
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800151class Extension(object):
Chia-I Wua5d442f2015-01-04 14:46:22 +0800152 def __init__(self, name, headers, objects, protos):
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800153 self.name = name
154 self.headers = headers
Chia-I Wua5d442f2015-01-04 14:46:22 +0800155 self.objects = objects
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800156 self.protos = protos
157
Chia-I Wu8f4508a2015-01-04 14:08:46 +0800158 def __repr__(self):
159 lines = []
160 lines.append("Extension(")
161 lines.append(" name=\"%s\"," % self.name)
162 lines.append(" headers=[\"%s\"]," %
163 "\", \"".join(self.headers))
164
165 lines.append(" objects=[")
166 for obj in self.objects:
167 lines.append(" \"%s\"," % obj)
168 lines.append(" ],")
169
170 lines.append(" protos=[")
171 for proto in self.protos:
172 param_lines = str(proto).splitlines()
173 param_lines[-1] += ",\n" if proto != self.protos[-1] else ","
174 for p in param_lines:
175 lines.append(" " + p)
176 lines.append(" ],")
177 lines.append(")")
178
179 return "\n".join(lines)
180
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600181# VK core API
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800182core = Extension(
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600183 name="VK_CORE",
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -0600184 headers=["vulkan.h", "vkDbg.h"],
Jon Ashburneb2728b2015-04-10 14:33:07 -0600185
Chia-I Wua5d442f2015-01-04 14:46:22 +0800186 objects=[
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600187 "VkInstance",
188 "VkPhysicalGpu",
189 "VkBaseObject",
190 "VkDevice",
191 "VkQueue",
192 "VkGpuMemory",
193 "VkObject",
194 "VkBuffer",
195 "VkBufferView",
196 "VkImage",
197 "VkImageView",
198 "VkColorAttachmentView",
199 "VkDepthStencilView",
200 "VkShader",
201 "VkPipeline",
202 "VkSampler",
203 "VkDescriptorSet",
204 "VkDescriptorSetLayout",
205 "VkDescriptorSetLayoutChain",
206 "VkDescriptorPool",
207 "VkDynamicStateObject",
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -0600208 "VkDynamicVpState",
209 "VkDynamicRsState",
210 "VkDynamicCbState",
211 "VkDynamicDsState",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600212 "VkCmdBuffer",
213 "VkFence",
214 "VkSemaphore",
215 "VkEvent",
216 "VkQueryPool",
217 "VkFramebuffer",
218 "VkRenderPass",
Chia-I Wua5d442f2015-01-04 14:46:22 +0800219 ],
Chia-I Wu82d0c6e2015-01-01 09:31:15 +0800220 protos=[
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600221 Proto("VkResult", "CreateInstance",
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600222 [Param("const VkInstanceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600223 Param("VkInstance*", "pInstance")]),
Jon Ashburn349508d2015-01-26 14:51:40 -0700224
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600225 Proto("VkResult", "DestroyInstance",
226 [Param("VkInstance", "instance")]),
Jon Ashburn349508d2015-01-26 14:51:40 -0700227
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600228 Proto("VkResult", "EnumerateGpus",
229 [Param("VkInstance", "instance"),
Jon Ashburn349508d2015-01-26 14:51:40 -0700230 Param("uint32_t", "maxGpus"),
231 Param("uint32_t*", "pGpuCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600232 Param("VkPhysicalGpu*", "pGpus")]),
Jon Ashburn349508d2015-01-26 14:51:40 -0700233
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600234 Proto("VkResult", "GetGpuInfo",
235 [Param("VkPhysicalGpu", "gpu"),
236 Param("VkPhysicalGpuInfoType", "infoType"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600237 Param("size_t*", "pDataSize"),
238 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800239
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600240 Proto("void*", "GetProcAddr",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600241 [Param("VkPhysicalGpu", "gpu"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600242 Param("const char*", "pName")]),
Chia-I Wucc6de622015-01-04 14:51:06 +0800243
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600244 Proto("VkResult", "CreateDevice",
245 [Param("VkPhysicalGpu", "gpu"),
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600246 Param("const VkDeviceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600247 Param("VkDevice*", "pDevice")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800248
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600249 Proto("VkResult", "DestroyDevice",
250 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800251
Jon Ashburneb2728b2015-04-10 14:33:07 -0600252 Proto("VkResult", "GetGlobalExtensionInfo",
253 [Param("VkExtensionInfoType", "infoType"),
254 Param("uint32_t", "extensionIndex"),
255 Param("size_t*", "pDataSize"),
256 Param("void*", "pData")]),
257
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600258 Proto("VkResult", "GetExtensionSupport",
259 [Param("VkPhysicalGpu", "gpu"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600260 Param("const char*", "pExtName")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800261
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600262 Proto("VkResult", "EnumerateLayers",
263 [Param("VkPhysicalGpu", "gpu"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600264 Param("size_t", "maxLayerCount"),
265 Param("size_t", "maxStringSize"),
266 Param("size_t*", "pOutLayerCount"),
267 Param("char* const*", "pOutLayers"),
268 Param("void*", "pReserved")]),
Jon Ashburn96f28fc2014-10-15 15:30:23 -0600269
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600270 Proto("VkResult", "GetDeviceQueue",
271 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -0700272 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600273 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600274 Param("VkQueue*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800275
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600276 Proto("VkResult", "QueueSubmit",
277 [Param("VkQueue", "queue"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600278 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600279 Param("const VkCmdBuffer*", "pCmdBuffers"),
280 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800281
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600282 Proto("VkResult", "QueueAddMemReference",
283 [Param("VkQueue", "queue"),
284 Param("VkGpuMemory", "mem")]),
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -0600285
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600286 Proto("VkResult", "QueueRemoveMemReference",
287 [Param("VkQueue", "queue"),
288 Param("VkGpuMemory", "mem")]),
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -0600289
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600290 Proto("VkResult", "QueueWaitIdle",
291 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800292
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600293 Proto("VkResult", "DeviceWaitIdle",
294 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800295
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600296 Proto("VkResult", "AllocMemory",
297 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600298 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600299 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800300
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600301 Proto("VkResult", "FreeMemory",
302 [Param("VkGpuMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800303
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600304 Proto("VkResult", "SetMemoryPriority",
305 [Param("VkGpuMemory", "mem"),
306 Param("VkMemoryPriority", "priority")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800307
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600308 Proto("VkResult", "MapMemory",
309 [Param("VkGpuMemory", "mem"),
310 Param("VkFlags", "flags"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600311 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800312
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600313 Proto("VkResult", "UnmapMemory",
314 [Param("VkGpuMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800315
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600316 Proto("VkResult", "PinSystemMemory",
317 [Param("VkDevice", "device"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600318 Param("const void*", "pSysMem"),
319 Param("size_t", "memSize"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600320 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800321
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600322 Proto("VkResult", "GetMultiGpuCompatibility",
323 [Param("VkPhysicalGpu", "gpu0"),
324 Param("VkPhysicalGpu", "gpu1"),
325 Param("VkGpuCompatibilityInfo*", "pInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800326
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600327 Proto("VkResult", "OpenSharedMemory",
328 [Param("VkDevice", "device"),
329 Param("const VkMemoryOpenInfo*", "pOpenInfo"),
330 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800331
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600332 Proto("VkResult", "OpenSharedSemaphore",
333 [Param("VkDevice", "device"),
334 Param("const VkSemaphoreOpenInfo*", "pOpenInfo"),
335 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800336
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600337 Proto("VkResult", "OpenPeerMemory",
338 [Param("VkDevice", "device"),
339 Param("const VkPeerMemoryOpenInfo*", "pOpenInfo"),
340 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800341
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600342 Proto("VkResult", "OpenPeerImage",
343 [Param("VkDevice", "device"),
344 Param("const VkPeerImageOpenInfo*", "pOpenInfo"),
345 Param("VkImage*", "pImage"),
346 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800347
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600348 Proto("VkResult", "DestroyObject",
349 [Param("VkObject", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800350
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600351 Proto("VkResult", "GetObjectInfo",
352 [Param("VkBaseObject", "object"),
353 Param("VkObjectInfoType", "infoType"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600354 Param("size_t*", "pDataSize"),
355 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800356
Mark Lobodzinskicf26e072015-04-16 11:44:05 -0500357 Proto("VkResult", "QueueBindObjectMemory",
358 [Param("VkQueue", "queue"),
359 Param("VkObject", "object"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600360 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600361 Param("VkGpuMemory", "mem"),
362 Param("VkGpuSize", "offset")]),
Chia-I Wu714df452015-01-01 07:55:04 +0800363
Mark Lobodzinskicf26e072015-04-16 11:44:05 -0500364 Proto("VkResult", "QueueBindObjectMemoryRange",
365 [Param("VkQueue", "queue"),
366 Param("VkObject", "object"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600367 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600368 Param("VkGpuSize", "rangeOffset"),
369 Param("VkGpuSize", "rangeSize"),
370 Param("VkGpuMemory", "mem"),
371 Param("VkGpuSize", "memOffset")]),
Chia-I Wu714df452015-01-01 07:55:04 +0800372
Mark Lobodzinskicf26e072015-04-16 11:44:05 -0500373 Proto("VkResult", "QueueBindImageMemoryRange",
374 [Param("VkQueue", "queue"),
375 Param("VkImage", "image"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600376 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600377 Param("const VkImageMemoryBindInfo*", "bindInfo"),
378 Param("VkGpuMemory", "mem"),
379 Param("VkGpuSize", "memOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800380
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600381 Proto("VkResult", "CreateFence",
382 [Param("VkDevice", "device"),
383 Param("const VkFenceCreateInfo*", "pCreateInfo"),
384 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800385
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600386 Proto("VkResult", "ResetFences",
387 [Param("VkDevice", "device"),
Mark Lobodzinskiebe814d2015-04-07 16:07:57 -0500388 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600389 Param("VkFence*", "pFences")]),
Mark Lobodzinskiebe814d2015-04-07 16:07:57 -0500390
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600391 Proto("VkResult", "GetFenceStatus",
392 [Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800393
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600394 Proto("VkResult", "WaitForFences",
395 [Param("VkDevice", "device"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600396 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600397 Param("const VkFence*", "pFences"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600398 Param("bool32_t", "waitAll"),
399 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800400
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600401 Proto("VkResult", "CreateSemaphore",
402 [Param("VkDevice", "device"),
403 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
404 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800405
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600406 Proto("VkResult", "QueueSignalSemaphore",
407 [Param("VkQueue", "queue"),
408 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800409
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600410 Proto("VkResult", "QueueWaitSemaphore",
411 [Param("VkQueue", "queue"),
412 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800413
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600414 Proto("VkResult", "CreateEvent",
415 [Param("VkDevice", "device"),
416 Param("const VkEventCreateInfo*", "pCreateInfo"),
417 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800418
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600419 Proto("VkResult", "GetEventStatus",
420 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800421
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600422 Proto("VkResult", "SetEvent",
423 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800424
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600425 Proto("VkResult", "ResetEvent",
426 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800427
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600428 Proto("VkResult", "CreateQueryPool",
429 [Param("VkDevice", "device"),
430 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
431 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800432
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600433 Proto("VkResult", "GetQueryPoolResults",
434 [Param("VkQueryPool", "queryPool"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600435 Param("uint32_t", "startQuery"),
436 Param("uint32_t", "queryCount"),
437 Param("size_t*", "pDataSize"),
438 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800439
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600440 Proto("VkResult", "GetFormatInfo",
441 [Param("VkDevice", "device"),
442 Param("VkFormat", "format"),
443 Param("VkFormatInfoType", "infoType"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600444 Param("size_t*", "pDataSize"),
445 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800446
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600447 Proto("VkResult", "CreateBuffer",
448 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600449 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600450 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu714df452015-01-01 07:55:04 +0800451
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600452 Proto("VkResult", "CreateBufferView",
453 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600454 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600455 Param("VkBufferView*", "pView")]),
Chia-I Wu714df452015-01-01 07:55:04 +0800456
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600457 Proto("VkResult", "CreateImage",
458 [Param("VkDevice", "device"),
459 Param("const VkImageCreateInfo*", "pCreateInfo"),
460 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800461
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600462 Proto("VkResult", "GetImageSubresourceInfo",
463 [Param("VkImage", "image"),
464 Param("const VkImageSubresource*", "pSubresource"),
465 Param("VkSubresourceInfoType", "infoType"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600466 Param("size_t*", "pDataSize"),
467 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800468
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600469 Proto("VkResult", "CreateImageView",
470 [Param("VkDevice", "device"),
471 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
472 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800473
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600474 Proto("VkResult", "CreateColorAttachmentView",
475 [Param("VkDevice", "device"),
476 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
477 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800478
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600479 Proto("VkResult", "CreateDepthStencilView",
480 [Param("VkDevice", "device"),
481 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
482 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800483
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600484 Proto("VkResult", "CreateShader",
485 [Param("VkDevice", "device"),
486 Param("const VkShaderCreateInfo*", "pCreateInfo"),
487 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800488
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600489 Proto("VkResult", "CreateGraphicsPipeline",
490 [Param("VkDevice", "device"),
491 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
492 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800493
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600494 Proto("VkResult", "CreateGraphicsPipelineDerivative",
495 [Param("VkDevice", "device"),
496 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
497 Param("VkPipeline", "basePipeline"),
498 Param("VkPipeline*", "pPipeline")]),
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -0600499
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600500 Proto("VkResult", "CreateComputePipeline",
501 [Param("VkDevice", "device"),
502 Param("const VkComputePipelineCreateInfo*", "pCreateInfo"),
503 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800504
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600505 Proto("VkResult", "StorePipeline",
506 [Param("VkPipeline", "pipeline"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600507 Param("size_t*", "pDataSize"),
508 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800509
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600510 Proto("VkResult", "LoadPipeline",
511 [Param("VkDevice", "device"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600512 Param("size_t", "dataSize"),
513 Param("const void*", "pData"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600514 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800515
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600516 Proto("VkResult", "LoadPipelineDerivative",
517 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -0600518 Param("size_t", "dataSize"),
519 Param("const void*", "pData"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600520 Param("VkPipeline", "basePipeline"),
521 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800522
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600523 Proto("VkResult", "CreateSampler",
524 [Param("VkDevice", "device"),
525 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
526 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800527
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600528 Proto("VkResult", "CreateDescriptorSetLayout",
529 [Param("VkDevice", "device"),
530 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
531 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800532
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600533 Proto("VkResult", "CreateDescriptorSetLayoutChain",
534 [Param("VkDevice", "device"),
Chia-I Wu7732cb22015-03-26 15:27:55 +0800535 Param("uint32_t", "setLayoutArrayCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600536 Param("const VkDescriptorSetLayout*", "pSetLayoutArray"),
537 Param("VkDescriptorSetLayoutChain*", "pLayoutChain")]),
Chia-I Wu7732cb22015-03-26 15:27:55 +0800538
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600539 Proto("VkResult", "BeginDescriptorPoolUpdate",
540 [Param("VkDevice", "device"),
541 Param("VkDescriptorUpdateMode", "updateMode")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800542
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600543 Proto("VkResult", "EndDescriptorPoolUpdate",
544 [Param("VkDevice", "device"),
545 Param("VkCmdBuffer", "cmd")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800546
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600547 Proto("VkResult", "CreateDescriptorPool",
548 [Param("VkDevice", "device"),
549 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600550 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600551 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
552 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wuf8385062015-01-04 16:27:24 +0800553
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600554 Proto("VkResult", "ResetDescriptorPool",
555 [Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wuf8385062015-01-04 16:27:24 +0800556
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600557 Proto("VkResult", "AllocDescriptorSets",
558 [Param("VkDescriptorPool", "descriptorPool"),
559 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600560 Param("uint32_t", "count"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600561 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
562 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600563 Param("uint32_t*", "pCount")]),
Chia-I Wuf8385062015-01-04 16:27:24 +0800564
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600565 Proto("void", "ClearDescriptorSets",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600566 [Param("VkDescriptorPool", "descriptorPool"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600567 Param("uint32_t", "count"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600568 Param("const VkDescriptorSet*", "pDescriptorSets")]),
Chia-I Wuf8385062015-01-04 16:27:24 +0800569
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600570 Proto("void", "UpdateDescriptors",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600571 [Param("VkDescriptorSet", "descriptorSet"),
Chia-I Wu7732cb22015-03-26 15:27:55 +0800572 Param("uint32_t", "updateCount"),
573 Param("const void**", "ppUpdateArray")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800574
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600575 Proto("VkResult", "CreateDynamicViewportState",
576 [Param("VkDevice", "device"),
577 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -0600578 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800579
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600580 Proto("VkResult", "CreateDynamicRasterState",
581 [Param("VkDevice", "device"),
582 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -0600583 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800584
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600585 Proto("VkResult", "CreateDynamicColorBlendState",
586 [Param("VkDevice", "device"),
587 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -0600588 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800589
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600590 Proto("VkResult", "CreateDynamicDepthStencilState",
591 [Param("VkDevice", "device"),
592 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -0600593 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800594
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600595 Proto("VkResult", "CreateCommandBuffer",
596 [Param("VkDevice", "device"),
597 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
598 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800599
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600600 Proto("VkResult", "BeginCommandBuffer",
601 [Param("VkCmdBuffer", "cmdBuffer"),
602 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800603
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600604 Proto("VkResult", "EndCommandBuffer",
605 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800606
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600607 Proto("VkResult", "ResetCommandBuffer",
608 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800609
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600610 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600611 [Param("VkCmdBuffer", "cmdBuffer"),
612 Param("VkPipelineBindPoint", "pipelineBindPoint"),
613 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800614
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600615 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600616 [Param("VkCmdBuffer", "cmdBuffer"),
617 Param("VkStateBindPoint", "stateBindPoint"),
618 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800619
Chia-I Wu862c5572015-03-28 15:23:55 +0800620 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600621 [Param("VkCmdBuffer", "cmdBuffer"),
622 Param("VkPipelineBindPoint", "pipelineBindPoint"),
623 Param("VkDescriptorSetLayoutChain", "layoutChain"),
Chia-I Wu862c5572015-03-28 15:23:55 +0800624 Param("uint32_t", "layoutChainSlot"),
625 Param("uint32_t", "count"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600626 Param("const VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600627 Param("const uint32_t*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800628
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600629 Proto("void", "CmdBindVertexBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600630 [Param("VkCmdBuffer", "cmdBuffer"),
631 Param("VkBuffer", "buffer"),
632 Param("VkGpuSize", "offset"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600633 Param("uint32_t", "binding")]),
Chia-I Wu3b04af52014-11-08 10:48:20 +0800634
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600635 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600636 [Param("VkCmdBuffer", "cmdBuffer"),
637 Param("VkBuffer", "buffer"),
638 Param("VkGpuSize", "offset"),
639 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800640
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600641 Proto("void", "CmdDraw",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600642 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600643 Param("uint32_t", "firstVertex"),
644 Param("uint32_t", "vertexCount"),
645 Param("uint32_t", "firstInstance"),
646 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800647
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600648 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600649 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600650 Param("uint32_t", "firstIndex"),
651 Param("uint32_t", "indexCount"),
652 Param("int32_t", "vertexOffset"),
653 Param("uint32_t", "firstInstance"),
654 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800655
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600656 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600657 [Param("VkCmdBuffer", "cmdBuffer"),
658 Param("VkBuffer", "buffer"),
659 Param("VkGpuSize", "offset"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600660 Param("uint32_t", "count"),
661 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800662
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600663 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600664 [Param("VkCmdBuffer", "cmdBuffer"),
665 Param("VkBuffer", "buffer"),
666 Param("VkGpuSize", "offset"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600667 Param("uint32_t", "count"),
668 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800669
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600670 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600671 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600672 Param("uint32_t", "x"),
673 Param("uint32_t", "y"),
674 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800675
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600676 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600677 [Param("VkCmdBuffer", "cmdBuffer"),
678 Param("VkBuffer", "buffer"),
679 Param("VkGpuSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800680
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600681 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600682 [Param("VkCmdBuffer", "cmdBuffer"),
683 Param("VkBuffer", "srcBuffer"),
684 Param("VkBuffer", "destBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600685 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600686 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800687
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600688 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600689 [Param("VkCmdBuffer", "cmdBuffer"),
690 Param("VkImage", "srcImage"),
691 Param("VkImageLayout", "srcImageLayout"),
692 Param("VkImage", "destImage"),
693 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600694 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600695 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800696
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600697 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600698 [Param("VkCmdBuffer", "cmdBuffer"),
699 Param("VkImage", "srcImage"),
700 Param("VkImageLayout", "srcImageLayout"),
701 Param("VkImage", "destImage"),
702 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600703 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600704 Param("const VkImageBlit*", "pRegions")]),
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600705
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600706 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600707 [Param("VkCmdBuffer", "cmdBuffer"),
708 Param("VkBuffer", "srcBuffer"),
709 Param("VkImage", "destImage"),
710 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600711 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600712 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800713
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600714 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600715 [Param("VkCmdBuffer", "cmdBuffer"),
716 Param("VkImage", "srcImage"),
717 Param("VkImageLayout", "srcImageLayout"),
718 Param("VkBuffer", "destBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600719 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600720 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800721
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600722 Proto("void", "CmdCloneImageData",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600723 [Param("VkCmdBuffer", "cmdBuffer"),
724 Param("VkImage", "srcImage"),
725 Param("VkImageLayout", "srcImageLayout"),
726 Param("VkImage", "destImage"),
727 Param("VkImageLayout", "destImageLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800728
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600729 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600730 [Param("VkCmdBuffer", "cmdBuffer"),
731 Param("VkBuffer", "destBuffer"),
732 Param("VkGpuSize", "destOffset"),
733 Param("VkGpuSize", "dataSize"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600734 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800735
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600736 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600737 [Param("VkCmdBuffer", "cmdBuffer"),
738 Param("VkBuffer", "destBuffer"),
739 Param("VkGpuSize", "destOffset"),
740 Param("VkGpuSize", "fillSize"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600741 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800742
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600743 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600744 [Param("VkCmdBuffer", "cmdBuffer"),
745 Param("VkImage", "image"),
746 Param("VkImageLayout", "imageLayout"),
747 Param("VkClearColor", "color"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600748 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600749 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800750
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600751 Proto("void", "CmdClearDepthStencil",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600752 [Param("VkCmdBuffer", "cmdBuffer"),
753 Param("VkImage", "image"),
754 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600755 Param("float", "depth"),
756 Param("uint32_t", "stencil"),
757 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600758 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800759
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600760 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600761 [Param("VkCmdBuffer", "cmdBuffer"),
762 Param("VkImage", "srcImage"),
763 Param("VkImageLayout", "srcImageLayout"),
764 Param("VkImage", "destImage"),
765 Param("VkImageLayout", "destImageLayout"),
Tony Barbour11f74372015-04-13 15:02:52 -0600766 Param("uint32_t", "regionCount"),
767 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800768
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600769 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600770 [Param("VkCmdBuffer", "cmdBuffer"),
771 Param("VkEvent", "event"),
772 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800773
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600774 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600775 [Param("VkCmdBuffer", "cmdBuffer"),
776 Param("VkEvent", "event"),
777 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800778
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600779 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600780 [Param("VkCmdBuffer", "cmdBuffer"),
781 Param("const VkEventWaitInfo*", "pWaitInfo")]),
Mike Stroyan55658c22014-12-04 11:08:39 +0000782
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600783 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600784 [Param("VkCmdBuffer", "cmdBuffer"),
785 Param("const VkPipelineBarrier*", "pBarrier")]),
Mike Stroyan55658c22014-12-04 11:08:39 +0000786
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600787 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600788 [Param("VkCmdBuffer", "cmdBuffer"),
789 Param("VkQueryPool", "queryPool"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600790 Param("uint32_t", "slot"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600791 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800792
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600793 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600794 [Param("VkCmdBuffer", "cmdBuffer"),
795 Param("VkQueryPool", "queryPool"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600796 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800797
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600798 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600799 [Param("VkCmdBuffer", "cmdBuffer"),
800 Param("VkQueryPool", "queryPool"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600801 Param("uint32_t", "startQuery"),
802 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800803
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600804 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600805 [Param("VkCmdBuffer", "cmdBuffer"),
806 Param("VkTimestampType", "timestampType"),
807 Param("VkBuffer", "destBuffer"),
808 Param("VkGpuSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800809
Courtney Goeltzenleuchter98049062015-04-15 18:21:13 -0600810 Proto("void", "CmdCopyQueryPoolResults",
811 [Param("VkCmdBuffer", "cmdBuffer"),
812 Param("VkQueryPool", "queryPool"),
813 Param("uint32_t", "startQuery"),
814 Param("uint32_t", "queryCount"),
815 Param("VkBuffer", "destBuffer"),
816 Param("VkGpuSize", "destOffset"),
817 Param("VkGpuSize", "destStride"),
818 Param("VkFlags", "flags")]),
819
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600820 Proto("void", "CmdInitAtomicCounters",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600821 [Param("VkCmdBuffer", "cmdBuffer"),
822 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600823 Param("uint32_t", "startCounter"),
824 Param("uint32_t", "counterCount"),
825 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800826
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600827 Proto("void", "CmdLoadAtomicCounters",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600828 [Param("VkCmdBuffer", "cmdBuffer"),
829 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600830 Param("uint32_t", "startCounter"),
831 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600832 Param("VkBuffer", "srcBuffer"),
833 Param("VkGpuSize", "srcOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800834
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600835 Proto("void", "CmdSaveAtomicCounters",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600836 [Param("VkCmdBuffer", "cmdBuffer"),
837 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600838 Param("uint32_t", "startCounter"),
839 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600840 Param("VkBuffer", "destBuffer"),
841 Param("VkGpuSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800842
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600843 Proto("VkResult", "CreateFramebuffer",
844 [Param("VkDevice", "device"),
845 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
846 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayese0c3b222015-01-14 16:17:08 -0700847
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600848 Proto("VkResult", "CreateRenderPass",
849 [Param("VkDevice", "device"),
850 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
851 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayese0c3b222015-01-14 16:17:08 -0700852
Jon Ashburnb1dbb372015-02-02 09:58:11 -0700853 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600854 [Param("VkCmdBuffer", "cmdBuffer"),
855 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburnb1dbb372015-02-02 09:58:11 -0700856
857 Proto("void", "CmdEndRenderPass",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600858 [Param("VkCmdBuffer", "cmdBuffer"),
859 Param("VkRenderPass", "renderPass")]),
Jon Ashburnb1dbb372015-02-02 09:58:11 -0700860
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600861 Proto("VkResult", "DbgSetValidationLevel",
862 [Param("VkDevice", "device"),
863 Param("VkValidationLevel", "validationLevel")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800864
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600865 Proto("VkResult", "DbgRegisterMsgCallback",
866 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600867 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600868 Param("void*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800869
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600870 Proto("VkResult", "DbgUnregisterMsgCallback",
871 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600872 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800873
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600874 Proto("VkResult", "DbgSetMessageFilter",
875 [Param("VkDevice", "device"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600876 Param("int32_t", "msgCode"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600877 Param("VK_DBG_MSG_FILTER", "filter")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800878
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600879 Proto("VkResult", "DbgSetObjectTag",
880 [Param("VkBaseObject", "object"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600881 Param("size_t", "tagSize"),
882 Param("const void*", "pTag")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800883
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600884 Proto("VkResult", "DbgSetGlobalOption",
885 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600886 Param("VK_DBG_GLOBAL_OPTION", "dbgOption"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600887 Param("size_t", "dataSize"),
888 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800889
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600890 Proto("VkResult", "DbgSetDeviceOption",
891 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600892 Param("VK_DBG_DEVICE_OPTION", "dbgOption"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600893 Param("size_t", "dataSize"),
894 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800895
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600896 Proto("void", "CmdDbgMarkerBegin",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600897 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600898 Param("const char*", "pMarker")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800899
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600900 Proto("void", "CmdDbgMarkerEnd",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600901 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wu82d0c6e2015-01-01 09:31:15 +0800902 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800903)
904
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800905wsi_x11 = Extension(
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600906 name="VK_WSI_X11",
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -0600907 headers=["vkWsiX11Ext.h"],
Chia-I Wua5d442f2015-01-04 14:46:22 +0800908 objects=[],
Chia-I Wu82d0c6e2015-01-01 09:31:15 +0800909 protos=[
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600910 Proto("VkResult", "WsiX11AssociateConnection",
911 [Param("VkPhysicalGpu", "gpu"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600912 Param("const VK_WSI_X11_CONNECTION_INFO*", "pConnectionInfo")]),
Chia-I Wu6ae460f2014-09-13 13:36:06 +0800913
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600914 Proto("VkResult", "WsiX11GetMSC",
915 [Param("VkDevice", "device"),
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800916 Param("xcb_window_t", "window"),
917 Param("xcb_randr_crtc_t", "crtc"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600918 Param("uint64_t*", "pMsc")]),
Chia-I Wub8dceae2014-09-23 10:37:23 +0800919
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600920 Proto("VkResult", "WsiX11CreatePresentableImage",
921 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600922 Param("const VK_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO*", "pCreateInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600923 Param("VkImage*", "pImage"),
924 Param("VkGpuMemory*", "pMem")]),
Chia-I Wub8dceae2014-09-23 10:37:23 +0800925
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600926 Proto("VkResult", "WsiX11QueuePresent",
927 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600928 Param("const VK_WSI_X11_PRESENT_INFO*", "pPresentInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600929 Param("VkFence", "fence")]),
Chia-I Wu82d0c6e2015-01-01 09:31:15 +0800930 ],
Chia-I Wub8dceae2014-09-23 10:37:23 +0800931)
932
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800933extensions = [core, wsi_x11]
934
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700935object_root_list = [
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600936 "VkInstance",
937 "VkPhysicalGpu",
938 "VkBaseObject"
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700939]
940
941object_base_list = [
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600942 "VkDevice",
943 "VkQueue",
944 "VkGpuMemory",
945 "VkObject"
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700946]
947
948object_list = [
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600949 "VkBuffer",
950 "VkBufferView",
951 "VkImage",
952 "VkImageView",
953 "VkColorAttachmentView",
954 "VkDepthStencilView",
955 "VkShader",
956 "VkPipeline",
957 "VkSampler",
958 "VkDescriptorSet",
959 "VkDescriptorSetLayout",
960 "VkDescriptorSetLayoutChain",
961 "VkDescriptorPool",
962 "VkDynamicStateObject",
963 "VkCmdBuffer",
964 "VkFence",
965 "VkSemaphore",
966 "VkEvent",
967 "VkQueryPool",
968 "VkFramebuffer",
969 "VkRenderPass"
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700970]
971
972object_dynamic_state_list = [
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -0600973 "VkDynamicVpState",
974 "VkDynamicRsState",
975 "VkDynamicCbState",
976 "VkDynamicDsState"
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700977]
978
979object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
980
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600981object_parent_list = ["VkBaseObject", "VkObject", "VkDynamicStateObject"]
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700982
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800983headers = []
Chia-I Wua5d442f2015-01-04 14:46:22 +0800984objects = []
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800985protos = []
986for ext in extensions:
987 headers.extend(ext.headers)
Chia-I Wua5d442f2015-01-04 14:46:22 +0800988 objects.extend(ext.objects)
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800989 protos.extend(ext.protos)
Chia-I Wub8dceae2014-09-23 10:37:23 +0800990
Chia-I Wuf91902a2015-01-01 14:45:58 +0800991proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +0800992
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -0600993def parse_vk_h(filename):
Chia-I Wu8f4508a2015-01-04 14:08:46 +0800994 # read object and protoype typedefs
995 object_lines = []
996 proto_lines = []
997 with open(filename, "r") as fp:
998 for line in fp:
999 line = line.strip()
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001000 if line.startswith("VK_DEFINE"):
Chia-I Wu8f4508a2015-01-04 14:08:46 +08001001 begin = line.find("(") + 1
1002 end = line.find(",")
1003 # extract the object type
1004 object_lines.append(line[begin:end])
1005 if line.startswith("typedef") and line.endswith(");"):
1006 # drop leading "typedef " and trailing ");"
1007 proto_lines.append(line[8:-2])
1008
1009 # parse proto_lines to protos
1010 protos = []
1011 for line in proto_lines:
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001012 first, rest = line.split(" (VKAPI *PFN_vk")
1013 second, third = rest.split(")(")
Chia-I Wu8f4508a2015-01-04 14:08:46 +08001014
1015 # get the return type, no space before "*"
1016 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1017
1018 # get the name
1019 proto_name = second.strip()
1020
1021 # get the list of params
1022 param_strs = third.split(", ")
1023 params = []
1024 for s in param_strs:
1025 ty, name = s.rsplit(" ", 1)
1026
1027 # no space before "*"
1028 ty = "*".join([t.rstrip() for t in ty.split("*")])
1029 # attach [] to ty
1030 idx = name.rfind("[")
1031 if idx >= 0:
1032 ty += name[idx:]
1033 name = name[:idx]
1034
1035 params.append(Param(ty, name))
1036
1037 protos.append(Proto(proto_ret, proto_name, params))
1038
1039 # make them an extension and print
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001040 ext = Extension("VK_CORE",
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -06001041 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wu8f4508a2015-01-04 14:08:46 +08001042 objects=object_lines,
1043 protos=protos)
1044 print("core =", str(ext))
1045
1046 print("")
Jon Ashburn301c5f02015-04-06 10:58:22 -06001047 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu8f4508a2015-01-04 14:08:46 +08001048 print("{")
1049 for proto in ext.protos:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001050 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburn301c5f02015-04-06 10:58:22 -06001051 print("} VkLayerDispatchTable;")
Chia-I Wu8f4508a2015-01-04 14:08:46 +08001052
1053if __name__ == "__main__":
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -06001054 parse_vk_h("include/vulkan.h")