blob: 3e49704458011cab0b417741020737cc84a248c5 [file] [log] [blame]
Courtney Goeltzenleuchterd8e229c2015-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 Wua5d28fa2015-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 Wu509a4122015-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 Wue442dc32015-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 Wue442dc32015-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 Wuaf3b5552015-01-04 12:00:01 +0800101 def c_pretty_decl(self, name, attr=""):
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600102 """Return a named declaration in C, with vulkan.h formatting."""
Chia-I Wuaf3b5552015-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 Wua5d28fa2015-01-04 15:02:50 +0800133 def object_in_params(self):
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600134 """Return the params that are simple VK objects and are inputs."""
Chia-I Wua5d28fa2015-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 Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600138 """Return the params that are simple VK objects and are outputs."""
Chia-I Wua5d28fa2015-01-04 15:02:50 +0800139 return [param for param in self.params
140 if param.dereferenced_type() in objects]
141
Chia-I Wu509a4122015-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 Wuc4f24e82015-01-01 08:46:31 +0800151class Extension(object):
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800152 def __init__(self, name, headers, objects, protos):
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800153 self.name = name
154 self.headers = headers
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800155 self.objects = objects
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800156 self.protos = protos
157
Chia-I Wu509a4122015-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 Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600181# VK core API
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800182core = Extension(
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600183 name="VK_CORE",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600184 headers=["vulkan.h", "vkDbg.h"],
Jon Ashburn9fd4cc42015-04-10 14:33:07 -0600185
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800186 objects=[
Courtney Goeltzenleuchterfb4efc62015-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 Goeltzenleuchter502744a2015-04-10 16:24:50 -0600208 "VkDynamicVpState",
209 "VkDynamicRsState",
210 "VkDynamicCbState",
211 "VkDynamicDsState",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600212 "VkCmdBuffer",
213 "VkFence",
214 "VkSemaphore",
215 "VkEvent",
216 "VkQueryPool",
217 "VkFramebuffer",
218 "VkRenderPass",
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800219 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800220 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600221 Proto("VkResult", "CreateInstance",
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600222 [Param("const VkInstanceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600223 Param("VkInstance*", "pInstance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700224
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600225 Proto("VkResult", "DestroyInstance",
226 [Param("VkInstance", "instance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700227
Jon Ashburn83a64252015-04-15 11:31:12 -0600228 Proto("VkResult", "EnumeratePhysicalDevices",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600229 [Param("VkInstance", "instance"),
Jon Ashburn83a64252015-04-15 11:31:12 -0600230 Param("uint32_t*", "pPhysicalDeviceCount"),
231 Param("VkPhysicalGpu*", "pPhysicalDevices")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700232
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600233 Proto("VkResult", "GetGpuInfo",
234 [Param("VkPhysicalGpu", "gpu"),
235 Param("VkPhysicalGpuInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600236 Param("size_t*", "pDataSize"),
237 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800238
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600239 Proto("void*", "GetProcAddr",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600240 [Param("VkPhysicalGpu", "gpu"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600241 Param("const char*", "pName")]),
Chia-I Wuf2ffc522015-01-04 14:51:06 +0800242
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600243 Proto("VkResult", "CreateDevice",
244 [Param("VkPhysicalGpu", "gpu"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600245 Param("const VkDeviceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600246 Param("VkDevice*", "pDevice")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800247
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600248 Proto("VkResult", "DestroyDevice",
249 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800250
Jon Ashburn9fd4cc42015-04-10 14:33:07 -0600251 Proto("VkResult", "GetGlobalExtensionInfo",
252 [Param("VkExtensionInfoType", "infoType"),
253 Param("uint32_t", "extensionIndex"),
254 Param("size_t*", "pDataSize"),
255 Param("void*", "pData")]),
256
Tobin Ehlis01939012015-04-16 12:51:37 -0600257 Proto("VkResult", "GetPhysicalDeviceExtensionInfo",
258 [Param("VkPhysicalGpu", "gpu"),
259 Param("VkExtensionInfoType", "infoType"),
260 Param("uint32_t", "extensionIndex"),
261 Param("size_t*", "pDataSize"),
262 Param("void*", "pData")]),
263
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600264 Proto("VkResult", "EnumerateLayers",
265 [Param("VkPhysicalGpu", "gpu"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600266 Param("size_t", "maxLayerCount"),
267 Param("size_t", "maxStringSize"),
268 Param("size_t*", "pOutLayerCount"),
269 Param("char* const*", "pOutLayers"),
270 Param("void*", "pReserved")]),
Jon Ashburnf7bcf9b2014-10-15 15:30:23 -0600271
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600272 Proto("VkResult", "GetDeviceQueue",
273 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter18248e62015-03-05 18:09:39 -0700274 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600275 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600276 Param("VkQueue*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800277
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600278 Proto("VkResult", "QueueSubmit",
279 [Param("VkQueue", "queue"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600280 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600281 Param("const VkCmdBuffer*", "pCmdBuffers"),
282 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800283
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600284 Proto("VkResult", "QueueAddMemReferences",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600285 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600286 Param("uint32_t", "count"),
287 Param("const VkGpuMemory*", "pMems")]),
Courtney Goeltzenleuchterd3fb9552015-04-02 13:39:07 -0600288
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600289 Proto("VkResult", "QueueRemoveMemReferences",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600290 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600291 Param("uint32_t", "count"),
292 Param("const VkGpuMemory*", "pMems")]),
Courtney Goeltzenleuchterd3fb9552015-04-02 13:39:07 -0600293
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600294 Proto("VkResult", "QueueWaitIdle",
295 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800296
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600297 Proto("VkResult", "DeviceWaitIdle",
298 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800299
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600300 Proto("VkResult", "AllocMemory",
301 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600302 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600303 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800304
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600305 Proto("VkResult", "FreeMemory",
306 [Param("VkGpuMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800307
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600308 Proto("VkResult", "SetMemoryPriority",
309 [Param("VkGpuMemory", "mem"),
310 Param("VkMemoryPriority", "priority")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800311
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600312 Proto("VkResult", "MapMemory",
313 [Param("VkGpuMemory", "mem"),
314 Param("VkFlags", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600315 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800316
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600317 Proto("VkResult", "UnmapMemory",
318 [Param("VkGpuMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800319
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600320 Proto("VkResult", "PinSystemMemory",
321 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600322 Param("const void*", "pSysMem"),
323 Param("size_t", "memSize"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600324 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800325
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600326 Proto("VkResult", "GetMultiGpuCompatibility",
327 [Param("VkPhysicalGpu", "gpu0"),
328 Param("VkPhysicalGpu", "gpu1"),
329 Param("VkGpuCompatibilityInfo*", "pInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800330
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600331 Proto("VkResult", "OpenSharedMemory",
332 [Param("VkDevice", "device"),
333 Param("const VkMemoryOpenInfo*", "pOpenInfo"),
334 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800335
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600336 Proto("VkResult", "OpenSharedSemaphore",
337 [Param("VkDevice", "device"),
338 Param("const VkSemaphoreOpenInfo*", "pOpenInfo"),
339 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800340
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600341 Proto("VkResult", "OpenPeerMemory",
342 [Param("VkDevice", "device"),
343 Param("const VkPeerMemoryOpenInfo*", "pOpenInfo"),
344 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800345
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600346 Proto("VkResult", "OpenPeerImage",
347 [Param("VkDevice", "device"),
348 Param("const VkPeerImageOpenInfo*", "pOpenInfo"),
349 Param("VkImage*", "pImage"),
350 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800351
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600352 Proto("VkResult", "DestroyObject",
353 [Param("VkObject", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800354
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600355 Proto("VkResult", "GetObjectInfo",
356 [Param("VkBaseObject", "object"),
357 Param("VkObjectInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600358 Param("size_t*", "pDataSize"),
359 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800360
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500361 Proto("VkResult", "QueueBindObjectMemory",
362 [Param("VkQueue", "queue"),
363 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600364 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600365 Param("VkGpuMemory", "mem"),
366 Param("VkGpuSize", "offset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800367
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500368 Proto("VkResult", "QueueBindObjectMemoryRange",
369 [Param("VkQueue", "queue"),
370 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600371 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600372 Param("VkGpuSize", "rangeOffset"),
373 Param("VkGpuSize", "rangeSize"),
374 Param("VkGpuMemory", "mem"),
375 Param("VkGpuSize", "memOffset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800376
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500377 Proto("VkResult", "QueueBindImageMemoryRange",
378 [Param("VkQueue", "queue"),
379 Param("VkImage", "image"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600380 Param("uint32_t", "allocationIdx"),
Jeremy Hayesaf0d72c2015-04-15 15:20:03 -0600381 Param("const VkImageMemoryBindInfo*", "pBindInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600382 Param("VkGpuMemory", "mem"),
383 Param("VkGpuSize", "memOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800384
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600385 Proto("VkResult", "CreateFence",
386 [Param("VkDevice", "device"),
387 Param("const VkFenceCreateInfo*", "pCreateInfo"),
388 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800389
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600390 Proto("VkResult", "ResetFences",
391 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500392 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600393 Param("VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500394
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600395 Proto("VkResult", "GetFenceStatus",
396 [Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800397
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600398 Proto("VkResult", "WaitForFences",
399 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600400 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600401 Param("const VkFence*", "pFences"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600402 Param("bool32_t", "waitAll"),
403 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800404
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600405 Proto("VkResult", "CreateSemaphore",
406 [Param("VkDevice", "device"),
407 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
408 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800409
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600410 Proto("VkResult", "QueueSignalSemaphore",
411 [Param("VkQueue", "queue"),
412 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800413
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600414 Proto("VkResult", "QueueWaitSemaphore",
415 [Param("VkQueue", "queue"),
416 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800417
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600418 Proto("VkResult", "CreateEvent",
419 [Param("VkDevice", "device"),
420 Param("const VkEventCreateInfo*", "pCreateInfo"),
421 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800422
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600423 Proto("VkResult", "GetEventStatus",
424 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800425
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600426 Proto("VkResult", "SetEvent",
427 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800428
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600429 Proto("VkResult", "ResetEvent",
430 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800431
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600432 Proto("VkResult", "CreateQueryPool",
433 [Param("VkDevice", "device"),
434 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
435 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800436
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600437 Proto("VkResult", "GetQueryPoolResults",
438 [Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600439 Param("uint32_t", "startQuery"),
440 Param("uint32_t", "queryCount"),
441 Param("size_t*", "pDataSize"),
442 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800443
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600444 Proto("VkResult", "GetFormatInfo",
445 [Param("VkDevice", "device"),
446 Param("VkFormat", "format"),
447 Param("VkFormatInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600448 Param("size_t*", "pDataSize"),
449 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800450
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600451 Proto("VkResult", "CreateBuffer",
452 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600453 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600454 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800455
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600456 Proto("VkResult", "CreateBufferView",
457 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600458 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600459 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800460
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600461 Proto("VkResult", "CreateImage",
462 [Param("VkDevice", "device"),
463 Param("const VkImageCreateInfo*", "pCreateInfo"),
464 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800465
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600466 Proto("VkResult", "GetImageSubresourceInfo",
467 [Param("VkImage", "image"),
468 Param("const VkImageSubresource*", "pSubresource"),
469 Param("VkSubresourceInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600470 Param("size_t*", "pDataSize"),
471 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800472
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600473 Proto("VkResult", "CreateImageView",
474 [Param("VkDevice", "device"),
475 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
476 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800477
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600478 Proto("VkResult", "CreateColorAttachmentView",
479 [Param("VkDevice", "device"),
480 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
481 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800482
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600483 Proto("VkResult", "CreateDepthStencilView",
484 [Param("VkDevice", "device"),
485 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
486 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800487
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600488 Proto("VkResult", "CreateShader",
489 [Param("VkDevice", "device"),
490 Param("const VkShaderCreateInfo*", "pCreateInfo"),
491 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800492
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600493 Proto("VkResult", "CreateGraphicsPipeline",
494 [Param("VkDevice", "device"),
495 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
496 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800497
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600498 Proto("VkResult", "CreateGraphicsPipelineDerivative",
499 [Param("VkDevice", "device"),
500 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
501 Param("VkPipeline", "basePipeline"),
502 Param("VkPipeline*", "pPipeline")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600503
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600504 Proto("VkResult", "CreateComputePipeline",
505 [Param("VkDevice", "device"),
506 Param("const VkComputePipelineCreateInfo*", "pCreateInfo"),
507 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800508
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600509 Proto("VkResult", "StorePipeline",
510 [Param("VkPipeline", "pipeline"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600511 Param("size_t*", "pDataSize"),
512 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800513
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600514 Proto("VkResult", "LoadPipeline",
515 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600516 Param("size_t", "dataSize"),
517 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600518 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800519
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600520 Proto("VkResult", "LoadPipelineDerivative",
521 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600522 Param("size_t", "dataSize"),
523 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600524 Param("VkPipeline", "basePipeline"),
525 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800526
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600527 Proto("VkResult", "CreateSampler",
528 [Param("VkDevice", "device"),
529 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
530 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800531
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600532 Proto("VkResult", "CreateDescriptorSetLayout",
533 [Param("VkDevice", "device"),
534 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
535 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800536
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600537 Proto("VkResult", "CreateDescriptorSetLayoutChain",
538 [Param("VkDevice", "device"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800539 Param("uint32_t", "setLayoutArrayCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600540 Param("const VkDescriptorSetLayout*", "pSetLayoutArray"),
541 Param("VkDescriptorSetLayoutChain*", "pLayoutChain")]),
Chia-I Wu41126e52015-03-26 15:27:55 +0800542
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600543 Proto("VkResult", "BeginDescriptorPoolUpdate",
544 [Param("VkDevice", "device"),
545 Param("VkDescriptorUpdateMode", "updateMode")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800546
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600547 Proto("VkResult", "EndDescriptorPoolUpdate",
548 [Param("VkDevice", "device"),
549 Param("VkCmdBuffer", "cmd")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800550
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600551 Proto("VkResult", "CreateDescriptorPool",
552 [Param("VkDevice", "device"),
553 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600554 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600555 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
556 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800557
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600558 Proto("VkResult", "ResetDescriptorPool",
559 [Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800560
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600561 Proto("VkResult", "AllocDescriptorSets",
562 [Param("VkDescriptorPool", "descriptorPool"),
563 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600564 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600565 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
566 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600567 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800568
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600569 Proto("void", "ClearDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600570 [Param("VkDescriptorPool", "descriptorPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600571 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600572 Param("const VkDescriptorSet*", "pDescriptorSets")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800573
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600574 Proto("void", "UpdateDescriptors",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600575 [Param("VkDescriptorSet", "descriptorSet"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800576 Param("uint32_t", "updateCount"),
577 Param("const void**", "ppUpdateArray")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800578
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600579 Proto("VkResult", "CreateDynamicViewportState",
580 [Param("VkDevice", "device"),
581 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600582 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800583
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600584 Proto("VkResult", "CreateDynamicRasterState",
585 [Param("VkDevice", "device"),
586 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600587 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800588
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600589 Proto("VkResult", "CreateDynamicColorBlendState",
590 [Param("VkDevice", "device"),
591 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600592 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800593
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600594 Proto("VkResult", "CreateDynamicDepthStencilState",
595 [Param("VkDevice", "device"),
596 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600597 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800598
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600599 Proto("VkResult", "CreateCommandBuffer",
600 [Param("VkDevice", "device"),
601 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
602 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800603
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600604 Proto("VkResult", "BeginCommandBuffer",
605 [Param("VkCmdBuffer", "cmdBuffer"),
606 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800607
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600608 Proto("VkResult", "EndCommandBuffer",
609 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800610
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600611 Proto("VkResult", "ResetCommandBuffer",
612 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800613
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600614 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600615 [Param("VkCmdBuffer", "cmdBuffer"),
616 Param("VkPipelineBindPoint", "pipelineBindPoint"),
617 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800618
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600619 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600620 [Param("VkCmdBuffer", "cmdBuffer"),
621 Param("VkStateBindPoint", "stateBindPoint"),
622 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800623
Chia-I Wu53f07d72015-03-28 15:23:55 +0800624 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600625 [Param("VkCmdBuffer", "cmdBuffer"),
626 Param("VkPipelineBindPoint", "pipelineBindPoint"),
627 Param("VkDescriptorSetLayoutChain", "layoutChain"),
Chia-I Wu53f07d72015-03-28 15:23:55 +0800628 Param("uint32_t", "layoutChainSlot"),
629 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600630 Param("const VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600631 Param("const uint32_t*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800632
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600633 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600634 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600635 Param("uint32_t", "startBinding"),
636 Param("uint32_t", "bindingCount"),
637 Param("const VkBuffer*", "pBuffers"),
638 Param("const VkGpuSize*", "pOffsets")]),
Chia-I Wu7a42e122014-11-08 10:48:20 +0800639
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600640 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600641 [Param("VkCmdBuffer", "cmdBuffer"),
642 Param("VkBuffer", "buffer"),
643 Param("VkGpuSize", "offset"),
644 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800645
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600646 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600647 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600648 Param("uint32_t", "firstVertex"),
649 Param("uint32_t", "vertexCount"),
650 Param("uint32_t", "firstInstance"),
651 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800652
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600653 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600654 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600655 Param("uint32_t", "firstIndex"),
656 Param("uint32_t", "indexCount"),
657 Param("int32_t", "vertexOffset"),
658 Param("uint32_t", "firstInstance"),
659 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800660
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600661 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600662 [Param("VkCmdBuffer", "cmdBuffer"),
663 Param("VkBuffer", "buffer"),
664 Param("VkGpuSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600665 Param("uint32_t", "count"),
666 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800667
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600668 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600669 [Param("VkCmdBuffer", "cmdBuffer"),
670 Param("VkBuffer", "buffer"),
671 Param("VkGpuSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600672 Param("uint32_t", "count"),
673 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800674
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600675 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600676 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600677 Param("uint32_t", "x"),
678 Param("uint32_t", "y"),
679 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800680
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600681 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600682 [Param("VkCmdBuffer", "cmdBuffer"),
683 Param("VkBuffer", "buffer"),
684 Param("VkGpuSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800685
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600686 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600687 [Param("VkCmdBuffer", "cmdBuffer"),
688 Param("VkBuffer", "srcBuffer"),
689 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600690 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600691 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800692
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600693 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-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"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600699 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600700 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800701
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600702 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600703 [Param("VkCmdBuffer", "cmdBuffer"),
704 Param("VkImage", "srcImage"),
705 Param("VkImageLayout", "srcImageLayout"),
706 Param("VkImage", "destImage"),
707 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600708 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600709 Param("const VkImageBlit*", "pRegions")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600710
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600711 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600712 [Param("VkCmdBuffer", "cmdBuffer"),
713 Param("VkBuffer", "srcBuffer"),
714 Param("VkImage", "destImage"),
715 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600716 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600717 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800718
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600719 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600720 [Param("VkCmdBuffer", "cmdBuffer"),
721 Param("VkImage", "srcImage"),
722 Param("VkImageLayout", "srcImageLayout"),
723 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600724 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600725 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800726
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600727 Proto("void", "CmdCloneImageData",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600728 [Param("VkCmdBuffer", "cmdBuffer"),
729 Param("VkImage", "srcImage"),
730 Param("VkImageLayout", "srcImageLayout"),
731 Param("VkImage", "destImage"),
732 Param("VkImageLayout", "destImageLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800733
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600734 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600735 [Param("VkCmdBuffer", "cmdBuffer"),
736 Param("VkBuffer", "destBuffer"),
737 Param("VkGpuSize", "destOffset"),
738 Param("VkGpuSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600739 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800740
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600741 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600742 [Param("VkCmdBuffer", "cmdBuffer"),
743 Param("VkBuffer", "destBuffer"),
744 Param("VkGpuSize", "destOffset"),
745 Param("VkGpuSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600746 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800747
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600748 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600749 [Param("VkCmdBuffer", "cmdBuffer"),
750 Param("VkImage", "image"),
751 Param("VkImageLayout", "imageLayout"),
752 Param("VkClearColor", "color"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600753 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600754 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800755
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600756 Proto("void", "CmdClearDepthStencil",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600757 [Param("VkCmdBuffer", "cmdBuffer"),
758 Param("VkImage", "image"),
759 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600760 Param("float", "depth"),
761 Param("uint32_t", "stencil"),
762 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600763 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800764
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600765 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600766 [Param("VkCmdBuffer", "cmdBuffer"),
767 Param("VkImage", "srcImage"),
768 Param("VkImageLayout", "srcImageLayout"),
769 Param("VkImage", "destImage"),
770 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600771 Param("uint32_t", "regionCount"),
772 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800773
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600774 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-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 Lobodzinski17caf572015-01-29 08:55:56 -0600779 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600780 [Param("VkCmdBuffer", "cmdBuffer"),
781 Param("VkEvent", "event"),
782 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800783
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600784 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600785 [Param("VkCmdBuffer", "cmdBuffer"),
786 Param("const VkEventWaitInfo*", "pWaitInfo")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000787
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600788 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600789 [Param("VkCmdBuffer", "cmdBuffer"),
790 Param("const VkPipelineBarrier*", "pBarrier")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000791
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600792 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600793 [Param("VkCmdBuffer", "cmdBuffer"),
794 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600795 Param("uint32_t", "slot"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600796 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800797
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600798 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600799 [Param("VkCmdBuffer", "cmdBuffer"),
800 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600801 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800802
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600803 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600804 [Param("VkCmdBuffer", "cmdBuffer"),
805 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600806 Param("uint32_t", "startQuery"),
807 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800808
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600809 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600810 [Param("VkCmdBuffer", "cmdBuffer"),
811 Param("VkTimestampType", "timestampType"),
812 Param("VkBuffer", "destBuffer"),
813 Param("VkGpuSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800814
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600815 Proto("void", "CmdCopyQueryPoolResults",
816 [Param("VkCmdBuffer", "cmdBuffer"),
817 Param("VkQueryPool", "queryPool"),
818 Param("uint32_t", "startQuery"),
819 Param("uint32_t", "queryCount"),
820 Param("VkBuffer", "destBuffer"),
821 Param("VkGpuSize", "destOffset"),
822 Param("VkGpuSize", "destStride"),
823 Param("VkFlags", "flags")]),
824
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600825 Proto("void", "CmdInitAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600826 [Param("VkCmdBuffer", "cmdBuffer"),
827 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600828 Param("uint32_t", "startCounter"),
829 Param("uint32_t", "counterCount"),
830 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800831
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600832 Proto("void", "CmdLoadAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600833 [Param("VkCmdBuffer", "cmdBuffer"),
834 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600835 Param("uint32_t", "startCounter"),
836 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600837 Param("VkBuffer", "srcBuffer"),
838 Param("VkGpuSize", "srcOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800839
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600840 Proto("void", "CmdSaveAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600841 [Param("VkCmdBuffer", "cmdBuffer"),
842 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600843 Param("uint32_t", "startCounter"),
844 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600845 Param("VkBuffer", "destBuffer"),
846 Param("VkGpuSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800847
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600848 Proto("VkResult", "CreateFramebuffer",
849 [Param("VkDevice", "device"),
850 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
851 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700852
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600853 Proto("VkResult", "CreateRenderPass",
854 [Param("VkDevice", "device"),
855 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
856 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700857
Jon Ashburne13f1982015-02-02 09:58:11 -0700858 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600859 [Param("VkCmdBuffer", "cmdBuffer"),
860 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700861
862 Proto("void", "CmdEndRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600863 [Param("VkCmdBuffer", "cmdBuffer"),
864 Param("VkRenderPass", "renderPass")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700865
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600866 Proto("VkResult", "DbgSetValidationLevel",
867 [Param("VkDevice", "device"),
868 Param("VkValidationLevel", "validationLevel")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800869
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600870 Proto("VkResult", "DbgRegisterMsgCallback",
871 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600872 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600873 Param("void*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800874
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600875 Proto("VkResult", "DbgUnregisterMsgCallback",
876 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600877 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800878
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600879 Proto("VkResult", "DbgSetMessageFilter",
880 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600881 Param("int32_t", "msgCode"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600882 Param("VK_DBG_MSG_FILTER", "filter")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800883
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600884 Proto("VkResult", "DbgSetObjectTag",
885 [Param("VkBaseObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600886 Param("size_t", "tagSize"),
887 Param("const void*", "pTag")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800888
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600889 Proto("VkResult", "DbgSetGlobalOption",
890 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600891 Param("VK_DBG_GLOBAL_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600892 Param("size_t", "dataSize"),
893 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800894
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600895 Proto("VkResult", "DbgSetDeviceOption",
896 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600897 Param("VK_DBG_DEVICE_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600898 Param("size_t", "dataSize"),
899 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800900
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600901 Proto("void", "CmdDbgMarkerBegin",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600902 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600903 Param("const char*", "pMarker")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800904
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600905 Proto("void", "CmdDbgMarkerEnd",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600906 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800907 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800908)
909
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800910wsi_x11 = Extension(
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600911 name="VK_WSI_X11",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600912 headers=["vkWsiX11Ext.h"],
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800913 objects=[],
Chia-I Wue442dc32015-01-01 09:31:15 +0800914 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600915 Proto("VkResult", "WsiX11AssociateConnection",
916 [Param("VkPhysicalGpu", "gpu"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600917 Param("const VK_WSI_X11_CONNECTION_INFO*", "pConnectionInfo")]),
Chia-I Wu6bdf0192014-09-13 13:36:06 +0800918
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600919 Proto("VkResult", "WsiX11GetMSC",
920 [Param("VkDevice", "device"),
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800921 Param("xcb_window_t", "window"),
922 Param("xcb_randr_crtc_t", "crtc"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600923 Param("uint64_t*", "pMsc")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800924
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600925 Proto("VkResult", "WsiX11CreatePresentableImage",
926 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600927 Param("const VK_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600928 Param("VkImage*", "pImage"),
929 Param("VkGpuMemory*", "pMem")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800930
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600931 Proto("VkResult", "WsiX11QueuePresent",
932 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600933 Param("const VK_WSI_X11_PRESENT_INFO*", "pPresentInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600934 Param("VkFence", "fence")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800935 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800936)
937
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800938extensions = [core, wsi_x11]
939
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700940object_root_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600941 "VkInstance",
942 "VkPhysicalGpu",
943 "VkBaseObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700944]
945
946object_base_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600947 "VkDevice",
948 "VkQueue",
949 "VkGpuMemory",
950 "VkObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700951]
952
953object_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600954 "VkBuffer",
955 "VkBufferView",
956 "VkImage",
957 "VkImageView",
958 "VkColorAttachmentView",
959 "VkDepthStencilView",
960 "VkShader",
961 "VkPipeline",
962 "VkSampler",
963 "VkDescriptorSet",
964 "VkDescriptorSetLayout",
965 "VkDescriptorSetLayoutChain",
966 "VkDescriptorPool",
967 "VkDynamicStateObject",
968 "VkCmdBuffer",
969 "VkFence",
970 "VkSemaphore",
971 "VkEvent",
972 "VkQueryPool",
973 "VkFramebuffer",
974 "VkRenderPass"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700975]
976
977object_dynamic_state_list = [
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600978 "VkDynamicVpState",
979 "VkDynamicRsState",
980 "VkDynamicCbState",
981 "VkDynamicDsState"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700982]
983
984object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
985
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600986object_parent_list = ["VkBaseObject", "VkObject", "VkDynamicStateObject"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700987
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800988headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800989objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800990protos = []
991for ext in extensions:
992 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800993 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800994 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800995
Chia-I Wu9a4ceb12015-01-01 14:45:58 +0800996proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +0800997
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600998def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +0800999 # read object and protoype typedefs
1000 object_lines = []
1001 proto_lines = []
1002 with open(filename, "r") as fp:
1003 for line in fp:
1004 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001005 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +08001006 begin = line.find("(") + 1
1007 end = line.find(",")
1008 # extract the object type
1009 object_lines.append(line[begin:end])
1010 if line.startswith("typedef") and line.endswith(");"):
1011 # drop leading "typedef " and trailing ");"
1012 proto_lines.append(line[8:-2])
1013
1014 # parse proto_lines to protos
1015 protos = []
1016 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001017 first, rest = line.split(" (VKAPI *PFN_vk")
1018 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001019
1020 # get the return type, no space before "*"
1021 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1022
1023 # get the name
1024 proto_name = second.strip()
1025
1026 # get the list of params
1027 param_strs = third.split(", ")
1028 params = []
1029 for s in param_strs:
1030 ty, name = s.rsplit(" ", 1)
1031
1032 # no space before "*"
1033 ty = "*".join([t.rstrip() for t in ty.split("*")])
1034 # attach [] to ty
1035 idx = name.rfind("[")
1036 if idx >= 0:
1037 ty += name[idx:]
1038 name = name[:idx]
1039
1040 params.append(Param(ty, name))
1041
1042 protos.append(Proto(proto_ret, proto_name, params))
1043
1044 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001045 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001046 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001047 objects=object_lines,
1048 protos=protos)
1049 print("core =", str(ext))
1050
1051 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001052 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001053 print("{")
1054 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001055 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001056 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001057
1058if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001059 parse_vk_h("include/vulkan.h")