blob: d921bef077432bc63842a799e850e1a94cf93435 [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", "EnumerateLayers",
259 [Param("VkPhysicalGpu", "gpu"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600260 Param("size_t", "maxLayerCount"),
261 Param("size_t", "maxStringSize"),
262 Param("size_t*", "pOutLayerCount"),
263 Param("char* const*", "pOutLayers"),
264 Param("void*", "pReserved")]),
Jon Ashburn96f28fc2014-10-15 15:30:23 -0600265
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600266 Proto("VkResult", "GetDeviceQueue",
267 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -0700268 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600269 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600270 Param("VkQueue*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800271
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600272 Proto("VkResult", "QueueSubmit",
273 [Param("VkQueue", "queue"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600274 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600275 Param("const VkCmdBuffer*", "pCmdBuffers"),
276 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800277
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600278 Proto("VkResult", "QueueAddMemReference",
279 [Param("VkQueue", "queue"),
280 Param("VkGpuMemory", "mem")]),
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -0600281
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600282 Proto("VkResult", "QueueRemoveMemReference",
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", "QueueWaitIdle",
287 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800288
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600289 Proto("VkResult", "DeviceWaitIdle",
290 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800291
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600292 Proto("VkResult", "AllocMemory",
293 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600294 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600295 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800296
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600297 Proto("VkResult", "FreeMemory",
298 [Param("VkGpuMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800299
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600300 Proto("VkResult", "SetMemoryPriority",
301 [Param("VkGpuMemory", "mem"),
302 Param("VkMemoryPriority", "priority")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800303
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600304 Proto("VkResult", "MapMemory",
305 [Param("VkGpuMemory", "mem"),
306 Param("VkFlags", "flags"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600307 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800308
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600309 Proto("VkResult", "UnmapMemory",
310 [Param("VkGpuMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800311
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600312 Proto("VkResult", "PinSystemMemory",
313 [Param("VkDevice", "device"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600314 Param("const void*", "pSysMem"),
315 Param("size_t", "memSize"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600316 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800317
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600318 Proto("VkResult", "GetMultiGpuCompatibility",
319 [Param("VkPhysicalGpu", "gpu0"),
320 Param("VkPhysicalGpu", "gpu1"),
321 Param("VkGpuCompatibilityInfo*", "pInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800322
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600323 Proto("VkResult", "OpenSharedMemory",
324 [Param("VkDevice", "device"),
325 Param("const VkMemoryOpenInfo*", "pOpenInfo"),
326 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800327
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600328 Proto("VkResult", "OpenSharedSemaphore",
329 [Param("VkDevice", "device"),
330 Param("const VkSemaphoreOpenInfo*", "pOpenInfo"),
331 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800332
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600333 Proto("VkResult", "OpenPeerMemory",
334 [Param("VkDevice", "device"),
335 Param("const VkPeerMemoryOpenInfo*", "pOpenInfo"),
336 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800337
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600338 Proto("VkResult", "OpenPeerImage",
339 [Param("VkDevice", "device"),
340 Param("const VkPeerImageOpenInfo*", "pOpenInfo"),
341 Param("VkImage*", "pImage"),
342 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800343
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600344 Proto("VkResult", "DestroyObject",
345 [Param("VkObject", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800346
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600347 Proto("VkResult", "GetObjectInfo",
348 [Param("VkBaseObject", "object"),
349 Param("VkObjectInfoType", "infoType"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600350 Param("size_t*", "pDataSize"),
351 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800352
Mark Lobodzinskicf26e072015-04-16 11:44:05 -0500353 Proto("VkResult", "QueueBindObjectMemory",
354 [Param("VkQueue", "queue"),
355 Param("VkObject", "object"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600356 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600357 Param("VkGpuMemory", "mem"),
358 Param("VkGpuSize", "offset")]),
Chia-I Wu714df452015-01-01 07:55:04 +0800359
Mark Lobodzinskicf26e072015-04-16 11:44:05 -0500360 Proto("VkResult", "QueueBindObjectMemoryRange",
361 [Param("VkQueue", "queue"),
362 Param("VkObject", "object"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600363 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600364 Param("VkGpuSize", "rangeOffset"),
365 Param("VkGpuSize", "rangeSize"),
366 Param("VkGpuMemory", "mem"),
367 Param("VkGpuSize", "memOffset")]),
Chia-I Wu714df452015-01-01 07:55:04 +0800368
Mark Lobodzinskicf26e072015-04-16 11:44:05 -0500369 Proto("VkResult", "QueueBindImageMemoryRange",
370 [Param("VkQueue", "queue"),
371 Param("VkImage", "image"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600372 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600373 Param("const VkImageMemoryBindInfo*", "bindInfo"),
374 Param("VkGpuMemory", "mem"),
375 Param("VkGpuSize", "memOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800376
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600377 Proto("VkResult", "CreateFence",
378 [Param("VkDevice", "device"),
379 Param("const VkFenceCreateInfo*", "pCreateInfo"),
380 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800381
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600382 Proto("VkResult", "ResetFences",
383 [Param("VkDevice", "device"),
Mark Lobodzinskiebe814d2015-04-07 16:07:57 -0500384 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600385 Param("VkFence*", "pFences")]),
Mark Lobodzinskiebe814d2015-04-07 16:07:57 -0500386
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600387 Proto("VkResult", "GetFenceStatus",
388 [Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800389
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600390 Proto("VkResult", "WaitForFences",
391 [Param("VkDevice", "device"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600392 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600393 Param("const VkFence*", "pFences"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600394 Param("bool32_t", "waitAll"),
395 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800396
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600397 Proto("VkResult", "CreateSemaphore",
398 [Param("VkDevice", "device"),
399 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
400 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800401
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600402 Proto("VkResult", "QueueSignalSemaphore",
403 [Param("VkQueue", "queue"),
404 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800405
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600406 Proto("VkResult", "QueueWaitSemaphore",
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", "CreateEvent",
411 [Param("VkDevice", "device"),
412 Param("const VkEventCreateInfo*", "pCreateInfo"),
413 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800414
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600415 Proto("VkResult", "GetEventStatus",
416 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800417
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600418 Proto("VkResult", "SetEvent",
419 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800420
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600421 Proto("VkResult", "ResetEvent",
422 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800423
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600424 Proto("VkResult", "CreateQueryPool",
425 [Param("VkDevice", "device"),
426 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
427 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800428
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600429 Proto("VkResult", "GetQueryPoolResults",
430 [Param("VkQueryPool", "queryPool"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600431 Param("uint32_t", "startQuery"),
432 Param("uint32_t", "queryCount"),
433 Param("size_t*", "pDataSize"),
434 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800435
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600436 Proto("VkResult", "GetFormatInfo",
437 [Param("VkDevice", "device"),
438 Param("VkFormat", "format"),
439 Param("VkFormatInfoType", "infoType"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600440 Param("size_t*", "pDataSize"),
441 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800442
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600443 Proto("VkResult", "CreateBuffer",
444 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600445 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600446 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu714df452015-01-01 07:55:04 +0800447
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600448 Proto("VkResult", "CreateBufferView",
449 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600450 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600451 Param("VkBufferView*", "pView")]),
Chia-I Wu714df452015-01-01 07:55:04 +0800452
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600453 Proto("VkResult", "CreateImage",
454 [Param("VkDevice", "device"),
455 Param("const VkImageCreateInfo*", "pCreateInfo"),
456 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800457
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600458 Proto("VkResult", "GetImageSubresourceInfo",
459 [Param("VkImage", "image"),
460 Param("const VkImageSubresource*", "pSubresource"),
461 Param("VkSubresourceInfoType", "infoType"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600462 Param("size_t*", "pDataSize"),
463 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800464
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600465 Proto("VkResult", "CreateImageView",
466 [Param("VkDevice", "device"),
467 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
468 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800469
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600470 Proto("VkResult", "CreateColorAttachmentView",
471 [Param("VkDevice", "device"),
472 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
473 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800474
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600475 Proto("VkResult", "CreateDepthStencilView",
476 [Param("VkDevice", "device"),
477 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
478 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800479
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600480 Proto("VkResult", "CreateShader",
481 [Param("VkDevice", "device"),
482 Param("const VkShaderCreateInfo*", "pCreateInfo"),
483 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800484
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600485 Proto("VkResult", "CreateGraphicsPipeline",
486 [Param("VkDevice", "device"),
487 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
488 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800489
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600490 Proto("VkResult", "CreateGraphicsPipelineDerivative",
491 [Param("VkDevice", "device"),
492 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
493 Param("VkPipeline", "basePipeline"),
494 Param("VkPipeline*", "pPipeline")]),
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -0600495
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600496 Proto("VkResult", "CreateComputePipeline",
497 [Param("VkDevice", "device"),
498 Param("const VkComputePipelineCreateInfo*", "pCreateInfo"),
499 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800500
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600501 Proto("VkResult", "StorePipeline",
502 [Param("VkPipeline", "pipeline"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600503 Param("size_t*", "pDataSize"),
504 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800505
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600506 Proto("VkResult", "LoadPipeline",
507 [Param("VkDevice", "device"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600508 Param("size_t", "dataSize"),
509 Param("const void*", "pData"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600510 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800511
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600512 Proto("VkResult", "LoadPipelineDerivative",
513 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -0600514 Param("size_t", "dataSize"),
515 Param("const void*", "pData"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600516 Param("VkPipeline", "basePipeline"),
517 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800518
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600519 Proto("VkResult", "CreateSampler",
520 [Param("VkDevice", "device"),
521 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
522 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800523
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600524 Proto("VkResult", "CreateDescriptorSetLayout",
525 [Param("VkDevice", "device"),
526 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
527 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800528
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600529 Proto("VkResult", "CreateDescriptorSetLayoutChain",
530 [Param("VkDevice", "device"),
Chia-I Wu7732cb22015-03-26 15:27:55 +0800531 Param("uint32_t", "setLayoutArrayCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600532 Param("const VkDescriptorSetLayout*", "pSetLayoutArray"),
533 Param("VkDescriptorSetLayoutChain*", "pLayoutChain")]),
Chia-I Wu7732cb22015-03-26 15:27:55 +0800534
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600535 Proto("VkResult", "BeginDescriptorPoolUpdate",
536 [Param("VkDevice", "device"),
537 Param("VkDescriptorUpdateMode", "updateMode")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800538
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600539 Proto("VkResult", "EndDescriptorPoolUpdate",
540 [Param("VkDevice", "device"),
541 Param("VkCmdBuffer", "cmd")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800542
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600543 Proto("VkResult", "CreateDescriptorPool",
544 [Param("VkDevice", "device"),
545 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600546 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600547 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
548 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wuf8385062015-01-04 16:27:24 +0800549
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600550 Proto("VkResult", "ResetDescriptorPool",
551 [Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wuf8385062015-01-04 16:27:24 +0800552
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600553 Proto("VkResult", "AllocDescriptorSets",
554 [Param("VkDescriptorPool", "descriptorPool"),
555 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600556 Param("uint32_t", "count"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600557 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
558 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600559 Param("uint32_t*", "pCount")]),
Chia-I Wuf8385062015-01-04 16:27:24 +0800560
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600561 Proto("void", "ClearDescriptorSets",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600562 [Param("VkDescriptorPool", "descriptorPool"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600563 Param("uint32_t", "count"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600564 Param("const VkDescriptorSet*", "pDescriptorSets")]),
Chia-I Wuf8385062015-01-04 16:27:24 +0800565
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600566 Proto("void", "UpdateDescriptors",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600567 [Param("VkDescriptorSet", "descriptorSet"),
Chia-I Wu7732cb22015-03-26 15:27:55 +0800568 Param("uint32_t", "updateCount"),
569 Param("const void**", "ppUpdateArray")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800570
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600571 Proto("VkResult", "CreateDynamicViewportState",
572 [Param("VkDevice", "device"),
573 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -0600574 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800575
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600576 Proto("VkResult", "CreateDynamicRasterState",
577 [Param("VkDevice", "device"),
578 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -0600579 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800580
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600581 Proto("VkResult", "CreateDynamicColorBlendState",
582 [Param("VkDevice", "device"),
583 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -0600584 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800585
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600586 Proto("VkResult", "CreateDynamicDepthStencilState",
587 [Param("VkDevice", "device"),
588 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -0600589 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800590
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600591 Proto("VkResult", "CreateCommandBuffer",
592 [Param("VkDevice", "device"),
593 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
594 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800595
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600596 Proto("VkResult", "BeginCommandBuffer",
597 [Param("VkCmdBuffer", "cmdBuffer"),
598 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800599
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600600 Proto("VkResult", "EndCommandBuffer",
601 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800602
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600603 Proto("VkResult", "ResetCommandBuffer",
604 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800605
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600606 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600607 [Param("VkCmdBuffer", "cmdBuffer"),
608 Param("VkPipelineBindPoint", "pipelineBindPoint"),
609 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800610
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600611 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600612 [Param("VkCmdBuffer", "cmdBuffer"),
613 Param("VkStateBindPoint", "stateBindPoint"),
614 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800615
Chia-I Wu862c5572015-03-28 15:23:55 +0800616 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600617 [Param("VkCmdBuffer", "cmdBuffer"),
618 Param("VkPipelineBindPoint", "pipelineBindPoint"),
619 Param("VkDescriptorSetLayoutChain", "layoutChain"),
Chia-I Wu862c5572015-03-28 15:23:55 +0800620 Param("uint32_t", "layoutChainSlot"),
621 Param("uint32_t", "count"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600622 Param("const VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600623 Param("const uint32_t*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800624
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600625 Proto("void", "CmdBindVertexBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600626 [Param("VkCmdBuffer", "cmdBuffer"),
627 Param("VkBuffer", "buffer"),
628 Param("VkGpuSize", "offset"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600629 Param("uint32_t", "binding")]),
Chia-I Wu3b04af52014-11-08 10:48:20 +0800630
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600631 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600632 [Param("VkCmdBuffer", "cmdBuffer"),
633 Param("VkBuffer", "buffer"),
634 Param("VkGpuSize", "offset"),
635 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800636
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600637 Proto("void", "CmdDraw",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600638 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600639 Param("uint32_t", "firstVertex"),
640 Param("uint32_t", "vertexCount"),
641 Param("uint32_t", "firstInstance"),
642 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800643
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600644 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600645 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600646 Param("uint32_t", "firstIndex"),
647 Param("uint32_t", "indexCount"),
648 Param("int32_t", "vertexOffset"),
649 Param("uint32_t", "firstInstance"),
650 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800651
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600652 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600653 [Param("VkCmdBuffer", "cmdBuffer"),
654 Param("VkBuffer", "buffer"),
655 Param("VkGpuSize", "offset"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600656 Param("uint32_t", "count"),
657 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800658
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600659 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600660 [Param("VkCmdBuffer", "cmdBuffer"),
661 Param("VkBuffer", "buffer"),
662 Param("VkGpuSize", "offset"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600663 Param("uint32_t", "count"),
664 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800665
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600666 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600667 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600668 Param("uint32_t", "x"),
669 Param("uint32_t", "y"),
670 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800671
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600672 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600673 [Param("VkCmdBuffer", "cmdBuffer"),
674 Param("VkBuffer", "buffer"),
675 Param("VkGpuSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800676
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600677 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600678 [Param("VkCmdBuffer", "cmdBuffer"),
679 Param("VkBuffer", "srcBuffer"),
680 Param("VkBuffer", "destBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600681 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600682 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800683
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600684 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600685 [Param("VkCmdBuffer", "cmdBuffer"),
686 Param("VkImage", "srcImage"),
687 Param("VkImageLayout", "srcImageLayout"),
688 Param("VkImage", "destImage"),
689 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600690 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600691 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800692
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600693 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600694 [Param("VkCmdBuffer", "cmdBuffer"),
695 Param("VkImage", "srcImage"),
696 Param("VkImageLayout", "srcImageLayout"),
697 Param("VkImage", "destImage"),
698 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600699 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600700 Param("const VkImageBlit*", "pRegions")]),
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600701
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600702 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600703 [Param("VkCmdBuffer", "cmdBuffer"),
704 Param("VkBuffer", "srcBuffer"),
705 Param("VkImage", "destImage"),
706 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600707 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600708 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800709
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600710 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600711 [Param("VkCmdBuffer", "cmdBuffer"),
712 Param("VkImage", "srcImage"),
713 Param("VkImageLayout", "srcImageLayout"),
714 Param("VkBuffer", "destBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600715 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600716 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800717
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600718 Proto("void", "CmdCloneImageData",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600719 [Param("VkCmdBuffer", "cmdBuffer"),
720 Param("VkImage", "srcImage"),
721 Param("VkImageLayout", "srcImageLayout"),
722 Param("VkImage", "destImage"),
723 Param("VkImageLayout", "destImageLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800724
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600725 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600726 [Param("VkCmdBuffer", "cmdBuffer"),
727 Param("VkBuffer", "destBuffer"),
728 Param("VkGpuSize", "destOffset"),
729 Param("VkGpuSize", "dataSize"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600730 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800731
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600732 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600733 [Param("VkCmdBuffer", "cmdBuffer"),
734 Param("VkBuffer", "destBuffer"),
735 Param("VkGpuSize", "destOffset"),
736 Param("VkGpuSize", "fillSize"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600737 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800738
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600739 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600740 [Param("VkCmdBuffer", "cmdBuffer"),
741 Param("VkImage", "image"),
742 Param("VkImageLayout", "imageLayout"),
743 Param("VkClearColor", "color"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600744 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600745 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800746
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600747 Proto("void", "CmdClearDepthStencil",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600748 [Param("VkCmdBuffer", "cmdBuffer"),
749 Param("VkImage", "image"),
750 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600751 Param("float", "depth"),
752 Param("uint32_t", "stencil"),
753 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600754 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800755
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600756 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600757 [Param("VkCmdBuffer", "cmdBuffer"),
758 Param("VkImage", "srcImage"),
759 Param("VkImageLayout", "srcImageLayout"),
760 Param("VkImage", "destImage"),
761 Param("VkImageLayout", "destImageLayout"),
Tony Barbour11f74372015-04-13 15:02:52 -0600762 Param("uint32_t", "regionCount"),
763 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800764
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600765 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600766 [Param("VkCmdBuffer", "cmdBuffer"),
767 Param("VkEvent", "event"),
768 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800769
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600770 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600771 [Param("VkCmdBuffer", "cmdBuffer"),
772 Param("VkEvent", "event"),
773 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800774
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600775 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600776 [Param("VkCmdBuffer", "cmdBuffer"),
777 Param("const VkEventWaitInfo*", "pWaitInfo")]),
Mike Stroyan55658c22014-12-04 11:08:39 +0000778
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600779 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600780 [Param("VkCmdBuffer", "cmdBuffer"),
781 Param("const VkPipelineBarrier*", "pBarrier")]),
Mike Stroyan55658c22014-12-04 11:08:39 +0000782
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600783 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600784 [Param("VkCmdBuffer", "cmdBuffer"),
785 Param("VkQueryPool", "queryPool"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600786 Param("uint32_t", "slot"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600787 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800788
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600789 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600790 [Param("VkCmdBuffer", "cmdBuffer"),
791 Param("VkQueryPool", "queryPool"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600792 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800793
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600794 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600795 [Param("VkCmdBuffer", "cmdBuffer"),
796 Param("VkQueryPool", "queryPool"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600797 Param("uint32_t", "startQuery"),
798 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800799
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600800 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600801 [Param("VkCmdBuffer", "cmdBuffer"),
802 Param("VkTimestampType", "timestampType"),
803 Param("VkBuffer", "destBuffer"),
804 Param("VkGpuSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800805
Courtney Goeltzenleuchter98049062015-04-15 18:21:13 -0600806 Proto("void", "CmdCopyQueryPoolResults",
807 [Param("VkCmdBuffer", "cmdBuffer"),
808 Param("VkQueryPool", "queryPool"),
809 Param("uint32_t", "startQuery"),
810 Param("uint32_t", "queryCount"),
811 Param("VkBuffer", "destBuffer"),
812 Param("VkGpuSize", "destOffset"),
813 Param("VkGpuSize", "destStride"),
814 Param("VkFlags", "flags")]),
815
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600816 Proto("void", "CmdInitAtomicCounters",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600817 [Param("VkCmdBuffer", "cmdBuffer"),
818 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600819 Param("uint32_t", "startCounter"),
820 Param("uint32_t", "counterCount"),
821 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800822
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600823 Proto("void", "CmdLoadAtomicCounters",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600824 [Param("VkCmdBuffer", "cmdBuffer"),
825 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600826 Param("uint32_t", "startCounter"),
827 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600828 Param("VkBuffer", "srcBuffer"),
829 Param("VkGpuSize", "srcOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800830
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600831 Proto("void", "CmdSaveAtomicCounters",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600832 [Param("VkCmdBuffer", "cmdBuffer"),
833 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600834 Param("uint32_t", "startCounter"),
835 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600836 Param("VkBuffer", "destBuffer"),
837 Param("VkGpuSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800838
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600839 Proto("VkResult", "CreateFramebuffer",
840 [Param("VkDevice", "device"),
841 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
842 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayese0c3b222015-01-14 16:17:08 -0700843
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600844 Proto("VkResult", "CreateRenderPass",
845 [Param("VkDevice", "device"),
846 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
847 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayese0c3b222015-01-14 16:17:08 -0700848
Jon Ashburnb1dbb372015-02-02 09:58:11 -0700849 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600850 [Param("VkCmdBuffer", "cmdBuffer"),
851 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburnb1dbb372015-02-02 09:58:11 -0700852
853 Proto("void", "CmdEndRenderPass",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600854 [Param("VkCmdBuffer", "cmdBuffer"),
855 Param("VkRenderPass", "renderPass")]),
Jon Ashburnb1dbb372015-02-02 09:58:11 -0700856
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600857 Proto("VkResult", "DbgSetValidationLevel",
858 [Param("VkDevice", "device"),
859 Param("VkValidationLevel", "validationLevel")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800860
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600861 Proto("VkResult", "DbgRegisterMsgCallback",
862 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600863 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600864 Param("void*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800865
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600866 Proto("VkResult", "DbgUnregisterMsgCallback",
867 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600868 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800869
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600870 Proto("VkResult", "DbgSetMessageFilter",
871 [Param("VkDevice", "device"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600872 Param("int32_t", "msgCode"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600873 Param("VK_DBG_MSG_FILTER", "filter")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800874
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600875 Proto("VkResult", "DbgSetObjectTag",
876 [Param("VkBaseObject", "object"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600877 Param("size_t", "tagSize"),
878 Param("const void*", "pTag")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800879
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600880 Proto("VkResult", "DbgSetGlobalOption",
881 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600882 Param("VK_DBG_GLOBAL_OPTION", "dbgOption"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600883 Param("size_t", "dataSize"),
884 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800885
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600886 Proto("VkResult", "DbgSetDeviceOption",
887 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600888 Param("VK_DBG_DEVICE_OPTION", "dbgOption"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600889 Param("size_t", "dataSize"),
890 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800891
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600892 Proto("void", "CmdDbgMarkerBegin",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600893 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600894 Param("const char*", "pMarker")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800895
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600896 Proto("void", "CmdDbgMarkerEnd",
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600897 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wu82d0c6e2015-01-01 09:31:15 +0800898 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800899)
900
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800901wsi_x11 = Extension(
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600902 name="VK_WSI_X11",
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -0600903 headers=["vkWsiX11Ext.h"],
Chia-I Wua5d442f2015-01-04 14:46:22 +0800904 objects=[],
Chia-I Wu82d0c6e2015-01-01 09:31:15 +0800905 protos=[
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600906 Proto("VkResult", "WsiX11AssociateConnection",
907 [Param("VkPhysicalGpu", "gpu"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600908 Param("const VK_WSI_X11_CONNECTION_INFO*", "pConnectionInfo")]),
Chia-I Wu6ae460f2014-09-13 13:36:06 +0800909
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600910 Proto("VkResult", "WsiX11GetMSC",
911 [Param("VkDevice", "device"),
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800912 Param("xcb_window_t", "window"),
913 Param("xcb_randr_crtc_t", "crtc"),
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600914 Param("uint64_t*", "pMsc")]),
Chia-I Wub8dceae2014-09-23 10:37:23 +0800915
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600916 Proto("VkResult", "WsiX11CreatePresentableImage",
917 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600918 Param("const VK_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO*", "pCreateInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600919 Param("VkImage*", "pImage"),
920 Param("VkGpuMemory*", "pMem")]),
Chia-I Wub8dceae2014-09-23 10:37:23 +0800921
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600922 Proto("VkResult", "WsiX11QueuePresent",
923 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600924 Param("const VK_WSI_X11_PRESENT_INFO*", "pPresentInfo"),
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600925 Param("VkFence", "fence")]),
Chia-I Wu82d0c6e2015-01-01 09:31:15 +0800926 ],
Chia-I Wub8dceae2014-09-23 10:37:23 +0800927)
928
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800929extensions = [core, wsi_x11]
930
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700931object_root_list = [
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600932 "VkInstance",
933 "VkPhysicalGpu",
934 "VkBaseObject"
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700935]
936
937object_base_list = [
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600938 "VkDevice",
939 "VkQueue",
940 "VkGpuMemory",
941 "VkObject"
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700942]
943
944object_list = [
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600945 "VkBuffer",
946 "VkBufferView",
947 "VkImage",
948 "VkImageView",
949 "VkColorAttachmentView",
950 "VkDepthStencilView",
951 "VkShader",
952 "VkPipeline",
953 "VkSampler",
954 "VkDescriptorSet",
955 "VkDescriptorSetLayout",
956 "VkDescriptorSetLayoutChain",
957 "VkDescriptorPool",
958 "VkDynamicStateObject",
959 "VkCmdBuffer",
960 "VkFence",
961 "VkSemaphore",
962 "VkEvent",
963 "VkQueryPool",
964 "VkFramebuffer",
965 "VkRenderPass"
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700966]
967
968object_dynamic_state_list = [
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -0600969 "VkDynamicVpState",
970 "VkDynamicRsState",
971 "VkDynamicCbState",
972 "VkDynamicDsState"
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700973]
974
975object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
976
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600977object_parent_list = ["VkBaseObject", "VkObject", "VkDynamicStateObject"]
Tobin Ehlis2f3726c2015-01-15 17:51:52 -0700978
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800979headers = []
Chia-I Wua5d442f2015-01-04 14:46:22 +0800980objects = []
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800981protos = []
982for ext in extensions:
983 headers.extend(ext.headers)
Chia-I Wua5d442f2015-01-04 14:46:22 +0800984 objects.extend(ext.objects)
Chia-I Wuec30dcb2015-01-01 08:46:31 +0800985 protos.extend(ext.protos)
Chia-I Wub8dceae2014-09-23 10:37:23 +0800986
Chia-I Wuf91902a2015-01-01 14:45:58 +0800987proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +0800988
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -0600989def parse_vk_h(filename):
Chia-I Wu8f4508a2015-01-04 14:08:46 +0800990 # read object and protoype typedefs
991 object_lines = []
992 proto_lines = []
993 with open(filename, "r") as fp:
994 for line in fp:
995 line = line.strip()
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600996 if line.startswith("VK_DEFINE"):
Chia-I Wu8f4508a2015-01-04 14:08:46 +0800997 begin = line.find("(") + 1
998 end = line.find(",")
999 # extract the object type
1000 object_lines.append(line[begin:end])
1001 if line.startswith("typedef") and line.endswith(");"):
1002 # drop leading "typedef " and trailing ");"
1003 proto_lines.append(line[8:-2])
1004
1005 # parse proto_lines to protos
1006 protos = []
1007 for line in proto_lines:
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001008 first, rest = line.split(" (VKAPI *PFN_vk")
1009 second, third = rest.split(")(")
Chia-I Wu8f4508a2015-01-04 14:08:46 +08001010
1011 # get the return type, no space before "*"
1012 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1013
1014 # get the name
1015 proto_name = second.strip()
1016
1017 # get the list of params
1018 param_strs = third.split(", ")
1019 params = []
1020 for s in param_strs:
1021 ty, name = s.rsplit(" ", 1)
1022
1023 # no space before "*"
1024 ty = "*".join([t.rstrip() for t in ty.split("*")])
1025 # attach [] to ty
1026 idx = name.rfind("[")
1027 if idx >= 0:
1028 ty += name[idx:]
1029 name = name[:idx]
1030
1031 params.append(Param(ty, name))
1032
1033 protos.append(Proto(proto_ret, proto_name, params))
1034
1035 # make them an extension and print
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001036 ext = Extension("VK_CORE",
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -06001037 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wu8f4508a2015-01-04 14:08:46 +08001038 objects=object_lines,
1039 protos=protos)
1040 print("core =", str(ext))
1041
1042 print("")
Jon Ashburn301c5f02015-04-06 10:58:22 -06001043 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu8f4508a2015-01-04 14:08:46 +08001044 print("{")
1045 for proto in ext.protos:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001046 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburn301c5f02015-04-06 10:58:22 -06001047 print("} VkLayerDispatchTable;")
Chia-I Wu8f4508a2015-01-04 14:08:46 +08001048
1049if __name__ == "__main__":
Courtney Goeltzenleuchtera8c06282015-04-14 14:55:44 -06001050 parse_vk_h("include/vulkan.h")