blob: 56b95c27083c30800bd8ecbaf87d1424067a8d6b [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
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600228 Proto("VkResult", "EnumerateGpus",
229 [Param("VkInstance", "instance"),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700230 Param("uint32_t", "maxGpus"),
231 Param("uint32_t*", "pGpuCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600232 Param("VkPhysicalGpu*", "pGpus")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700233
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600234 Proto("VkResult", "GetGpuInfo",
235 [Param("VkPhysicalGpu", "gpu"),
236 Param("VkPhysicalGpuInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600237 Param("size_t*", "pDataSize"),
238 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800239
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600240 Proto("void*", "GetProcAddr",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600241 [Param("VkPhysicalGpu", "gpu"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600242 Param("const char*", "pName")]),
Chia-I Wuf2ffc522015-01-04 14:51:06 +0800243
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600244 Proto("VkResult", "CreateDevice",
245 [Param("VkPhysicalGpu", "gpu"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600246 Param("const VkDeviceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600247 Param("VkDevice*", "pDevice")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800248
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600249 Proto("VkResult", "DestroyDevice",
250 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800251
Jon Ashburn9fd4cc42015-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
Tobin Ehlis01939012015-04-16 12:51:37 -0600258 Proto("VkResult", "GetPhysicalDeviceExtensionInfo",
259 [Param("VkPhysicalGpu", "gpu"),
260 Param("VkExtensionInfoType", "infoType"),
261 Param("uint32_t", "extensionIndex"),
262 Param("size_t*", "pDataSize"),
263 Param("void*", "pData")]),
264
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600265 Proto("VkResult", "EnumerateLayers",
266 [Param("VkPhysicalGpu", "gpu"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600267 Param("size_t", "maxLayerCount"),
268 Param("size_t", "maxStringSize"),
269 Param("size_t*", "pOutLayerCount"),
270 Param("char* const*", "pOutLayers"),
271 Param("void*", "pReserved")]),
Jon Ashburnf7bcf9b2014-10-15 15:30:23 -0600272
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600273 Proto("VkResult", "GetDeviceQueue",
274 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter18248e62015-03-05 18:09:39 -0700275 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600276 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600277 Param("VkQueue*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800278
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600279 Proto("VkResult", "QueueSubmit",
280 [Param("VkQueue", "queue"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600281 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600282 Param("const VkCmdBuffer*", "pCmdBuffers"),
283 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800284
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600285 Proto("VkResult", "QueueAddMemReferences",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600286 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600287 Param("uint32_t", "count"),
288 Param("const VkGpuMemory*", "pMems")]),
Courtney Goeltzenleuchterd3fb9552015-04-02 13:39:07 -0600289
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600290 Proto("VkResult", "QueueRemoveMemReferences",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600291 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600292 Param("uint32_t", "count"),
293 Param("const VkGpuMemory*", "pMems")]),
Courtney Goeltzenleuchterd3fb9552015-04-02 13:39:07 -0600294
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600295 Proto("VkResult", "QueueWaitIdle",
296 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800297
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600298 Proto("VkResult", "DeviceWaitIdle",
299 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800300
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600301 Proto("VkResult", "AllocMemory",
302 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600303 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600304 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800305
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600306 Proto("VkResult", "FreeMemory",
307 [Param("VkGpuMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800308
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600309 Proto("VkResult", "SetMemoryPriority",
310 [Param("VkGpuMemory", "mem"),
311 Param("VkMemoryPriority", "priority")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800312
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600313 Proto("VkResult", "MapMemory",
314 [Param("VkGpuMemory", "mem"),
315 Param("VkFlags", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600316 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800317
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600318 Proto("VkResult", "UnmapMemory",
319 [Param("VkGpuMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800320
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600321 Proto("VkResult", "PinSystemMemory",
322 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600323 Param("const void*", "pSysMem"),
324 Param("size_t", "memSize"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600325 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800326
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600327 Proto("VkResult", "GetMultiGpuCompatibility",
328 [Param("VkPhysicalGpu", "gpu0"),
329 Param("VkPhysicalGpu", "gpu1"),
330 Param("VkGpuCompatibilityInfo*", "pInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800331
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600332 Proto("VkResult", "OpenSharedMemory",
333 [Param("VkDevice", "device"),
334 Param("const VkMemoryOpenInfo*", "pOpenInfo"),
335 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800336
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600337 Proto("VkResult", "OpenSharedSemaphore",
338 [Param("VkDevice", "device"),
339 Param("const VkSemaphoreOpenInfo*", "pOpenInfo"),
340 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800341
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600342 Proto("VkResult", "OpenPeerMemory",
343 [Param("VkDevice", "device"),
344 Param("const VkPeerMemoryOpenInfo*", "pOpenInfo"),
345 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800346
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600347 Proto("VkResult", "OpenPeerImage",
348 [Param("VkDevice", "device"),
349 Param("const VkPeerImageOpenInfo*", "pOpenInfo"),
350 Param("VkImage*", "pImage"),
351 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800352
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600353 Proto("VkResult", "DestroyObject",
354 [Param("VkObject", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800355
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600356 Proto("VkResult", "GetObjectInfo",
357 [Param("VkBaseObject", "object"),
358 Param("VkObjectInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600359 Param("size_t*", "pDataSize"),
360 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800361
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500362 Proto("VkResult", "QueueBindObjectMemory",
363 [Param("VkQueue", "queue"),
364 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600365 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600366 Param("VkGpuMemory", "mem"),
367 Param("VkGpuSize", "offset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800368
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500369 Proto("VkResult", "QueueBindObjectMemoryRange",
370 [Param("VkQueue", "queue"),
371 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600372 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600373 Param("VkGpuSize", "rangeOffset"),
374 Param("VkGpuSize", "rangeSize"),
375 Param("VkGpuMemory", "mem"),
376 Param("VkGpuSize", "memOffset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800377
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500378 Proto("VkResult", "QueueBindImageMemoryRange",
379 [Param("VkQueue", "queue"),
380 Param("VkImage", "image"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600381 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600382 Param("const VkImageMemoryBindInfo*", "bindInfo"),
383 Param("VkGpuMemory", "mem"),
384 Param("VkGpuSize", "memOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800385
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600386 Proto("VkResult", "CreateFence",
387 [Param("VkDevice", "device"),
388 Param("const VkFenceCreateInfo*", "pCreateInfo"),
389 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800390
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600391 Proto("VkResult", "ResetFences",
392 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500393 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600394 Param("VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500395
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600396 Proto("VkResult", "GetFenceStatus",
397 [Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800398
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600399 Proto("VkResult", "WaitForFences",
400 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600401 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600402 Param("const VkFence*", "pFences"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600403 Param("bool32_t", "waitAll"),
404 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800405
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600406 Proto("VkResult", "CreateSemaphore",
407 [Param("VkDevice", "device"),
408 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
409 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800410
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600411 Proto("VkResult", "QueueSignalSemaphore",
412 [Param("VkQueue", "queue"),
413 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800414
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600415 Proto("VkResult", "QueueWaitSemaphore",
416 [Param("VkQueue", "queue"),
417 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800418
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600419 Proto("VkResult", "CreateEvent",
420 [Param("VkDevice", "device"),
421 Param("const VkEventCreateInfo*", "pCreateInfo"),
422 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800423
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600424 Proto("VkResult", "GetEventStatus",
425 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800426
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600427 Proto("VkResult", "SetEvent",
428 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800429
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600430 Proto("VkResult", "ResetEvent",
431 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800432
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600433 Proto("VkResult", "CreateQueryPool",
434 [Param("VkDevice", "device"),
435 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
436 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800437
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600438 Proto("VkResult", "GetQueryPoolResults",
439 [Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600440 Param("uint32_t", "startQuery"),
441 Param("uint32_t", "queryCount"),
442 Param("size_t*", "pDataSize"),
443 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800444
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600445 Proto("VkResult", "GetFormatInfo",
446 [Param("VkDevice", "device"),
447 Param("VkFormat", "format"),
448 Param("VkFormatInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600449 Param("size_t*", "pDataSize"),
450 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800451
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600452 Proto("VkResult", "CreateBuffer",
453 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600454 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600455 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800456
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600457 Proto("VkResult", "CreateBufferView",
458 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600459 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600460 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800461
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600462 Proto("VkResult", "CreateImage",
463 [Param("VkDevice", "device"),
464 Param("const VkImageCreateInfo*", "pCreateInfo"),
465 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800466
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600467 Proto("VkResult", "GetImageSubresourceInfo",
468 [Param("VkImage", "image"),
469 Param("const VkImageSubresource*", "pSubresource"),
470 Param("VkSubresourceInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600471 Param("size_t*", "pDataSize"),
472 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800473
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600474 Proto("VkResult", "CreateImageView",
475 [Param("VkDevice", "device"),
476 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
477 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800478
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600479 Proto("VkResult", "CreateColorAttachmentView",
480 [Param("VkDevice", "device"),
481 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
482 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800483
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600484 Proto("VkResult", "CreateDepthStencilView",
485 [Param("VkDevice", "device"),
486 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
487 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800488
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600489 Proto("VkResult", "CreateShader",
490 [Param("VkDevice", "device"),
491 Param("const VkShaderCreateInfo*", "pCreateInfo"),
492 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800493
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600494 Proto("VkResult", "CreateGraphicsPipeline",
495 [Param("VkDevice", "device"),
496 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
497 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800498
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600499 Proto("VkResult", "CreateGraphicsPipelineDerivative",
500 [Param("VkDevice", "device"),
501 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
502 Param("VkPipeline", "basePipeline"),
503 Param("VkPipeline*", "pPipeline")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600504
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600505 Proto("VkResult", "CreateComputePipeline",
506 [Param("VkDevice", "device"),
507 Param("const VkComputePipelineCreateInfo*", "pCreateInfo"),
508 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800509
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600510 Proto("VkResult", "StorePipeline",
511 [Param("VkPipeline", "pipeline"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600512 Param("size_t*", "pDataSize"),
513 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800514
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600515 Proto("VkResult", "LoadPipeline",
516 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600517 Param("size_t", "dataSize"),
518 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600519 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800520
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600521 Proto("VkResult", "LoadPipelineDerivative",
522 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600523 Param("size_t", "dataSize"),
524 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600525 Param("VkPipeline", "basePipeline"),
526 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800527
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600528 Proto("VkResult", "CreateSampler",
529 [Param("VkDevice", "device"),
530 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
531 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800532
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600533 Proto("VkResult", "CreateDescriptorSetLayout",
534 [Param("VkDevice", "device"),
535 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
536 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800537
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600538 Proto("VkResult", "CreateDescriptorSetLayoutChain",
539 [Param("VkDevice", "device"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800540 Param("uint32_t", "setLayoutArrayCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600541 Param("const VkDescriptorSetLayout*", "pSetLayoutArray"),
542 Param("VkDescriptorSetLayoutChain*", "pLayoutChain")]),
Chia-I Wu41126e52015-03-26 15:27:55 +0800543
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600544 Proto("VkResult", "BeginDescriptorPoolUpdate",
545 [Param("VkDevice", "device"),
546 Param("VkDescriptorUpdateMode", "updateMode")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800547
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600548 Proto("VkResult", "EndDescriptorPoolUpdate",
549 [Param("VkDevice", "device"),
550 Param("VkCmdBuffer", "cmd")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800551
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600552 Proto("VkResult", "CreateDescriptorPool",
553 [Param("VkDevice", "device"),
554 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600555 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600556 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
557 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800558
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600559 Proto("VkResult", "ResetDescriptorPool",
560 [Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800561
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600562 Proto("VkResult", "AllocDescriptorSets",
563 [Param("VkDescriptorPool", "descriptorPool"),
564 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600565 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600566 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
567 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600568 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800569
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600570 Proto("void", "ClearDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600571 [Param("VkDescriptorPool", "descriptorPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600572 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600573 Param("const VkDescriptorSet*", "pDescriptorSets")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800574
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600575 Proto("void", "UpdateDescriptors",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600576 [Param("VkDescriptorSet", "descriptorSet"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800577 Param("uint32_t", "updateCount"),
578 Param("const void**", "ppUpdateArray")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800579
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600580 Proto("VkResult", "CreateDynamicViewportState",
581 [Param("VkDevice", "device"),
582 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600583 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800584
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600585 Proto("VkResult", "CreateDynamicRasterState",
586 [Param("VkDevice", "device"),
587 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600588 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800589
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600590 Proto("VkResult", "CreateDynamicColorBlendState",
591 [Param("VkDevice", "device"),
592 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600593 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800594
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600595 Proto("VkResult", "CreateDynamicDepthStencilState",
596 [Param("VkDevice", "device"),
597 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600598 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800599
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600600 Proto("VkResult", "CreateCommandBuffer",
601 [Param("VkDevice", "device"),
602 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
603 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800604
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600605 Proto("VkResult", "BeginCommandBuffer",
606 [Param("VkCmdBuffer", "cmdBuffer"),
607 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800608
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600609 Proto("VkResult", "EndCommandBuffer",
610 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800611
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600612 Proto("VkResult", "ResetCommandBuffer",
613 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800614
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600615 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600616 [Param("VkCmdBuffer", "cmdBuffer"),
617 Param("VkPipelineBindPoint", "pipelineBindPoint"),
618 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800619
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600620 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600621 [Param("VkCmdBuffer", "cmdBuffer"),
622 Param("VkStateBindPoint", "stateBindPoint"),
623 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800624
Chia-I Wu53f07d72015-03-28 15:23:55 +0800625 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600626 [Param("VkCmdBuffer", "cmdBuffer"),
627 Param("VkPipelineBindPoint", "pipelineBindPoint"),
628 Param("VkDescriptorSetLayoutChain", "layoutChain"),
Chia-I Wu53f07d72015-03-28 15:23:55 +0800629 Param("uint32_t", "layoutChainSlot"),
630 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600631 Param("const VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600632 Param("const uint32_t*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800633
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600634 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600635 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600636 Param("uint32_t", "startBinding"),
637 Param("uint32_t", "bindingCount"),
638 Param("const VkBuffer*", "pBuffers"),
639 Param("const VkGpuSize*", "pOffsets")]),
Chia-I Wu7a42e122014-11-08 10:48:20 +0800640
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600641 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600642 [Param("VkCmdBuffer", "cmdBuffer"),
643 Param("VkBuffer", "buffer"),
644 Param("VkGpuSize", "offset"),
645 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800646
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600647 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600648 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600649 Param("uint32_t", "firstVertex"),
650 Param("uint32_t", "vertexCount"),
651 Param("uint32_t", "firstInstance"),
652 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800653
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600654 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600655 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600656 Param("uint32_t", "firstIndex"),
657 Param("uint32_t", "indexCount"),
658 Param("int32_t", "vertexOffset"),
659 Param("uint32_t", "firstInstance"),
660 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800661
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600662 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600663 [Param("VkCmdBuffer", "cmdBuffer"),
664 Param("VkBuffer", "buffer"),
665 Param("VkGpuSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600666 Param("uint32_t", "count"),
667 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800668
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600669 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600670 [Param("VkCmdBuffer", "cmdBuffer"),
671 Param("VkBuffer", "buffer"),
672 Param("VkGpuSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600673 Param("uint32_t", "count"),
674 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800675
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600676 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600677 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600678 Param("uint32_t", "x"),
679 Param("uint32_t", "y"),
680 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800681
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600682 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600683 [Param("VkCmdBuffer", "cmdBuffer"),
684 Param("VkBuffer", "buffer"),
685 Param("VkGpuSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800686
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600687 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600688 [Param("VkCmdBuffer", "cmdBuffer"),
689 Param("VkBuffer", "srcBuffer"),
690 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600691 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600692 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800693
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600694 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600695 [Param("VkCmdBuffer", "cmdBuffer"),
696 Param("VkImage", "srcImage"),
697 Param("VkImageLayout", "srcImageLayout"),
698 Param("VkImage", "destImage"),
699 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600700 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600701 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800702
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600703 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600704 [Param("VkCmdBuffer", "cmdBuffer"),
705 Param("VkImage", "srcImage"),
706 Param("VkImageLayout", "srcImageLayout"),
707 Param("VkImage", "destImage"),
708 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600709 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600710 Param("const VkImageBlit*", "pRegions")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600711
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600712 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600713 [Param("VkCmdBuffer", "cmdBuffer"),
714 Param("VkBuffer", "srcBuffer"),
715 Param("VkImage", "destImage"),
716 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600717 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600718 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800719
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600720 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600721 [Param("VkCmdBuffer", "cmdBuffer"),
722 Param("VkImage", "srcImage"),
723 Param("VkImageLayout", "srcImageLayout"),
724 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600725 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600726 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800727
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600728 Proto("void", "CmdCloneImageData",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600729 [Param("VkCmdBuffer", "cmdBuffer"),
730 Param("VkImage", "srcImage"),
731 Param("VkImageLayout", "srcImageLayout"),
732 Param("VkImage", "destImage"),
733 Param("VkImageLayout", "destImageLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800734
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600735 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600736 [Param("VkCmdBuffer", "cmdBuffer"),
737 Param("VkBuffer", "destBuffer"),
738 Param("VkGpuSize", "destOffset"),
739 Param("VkGpuSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600740 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800741
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600742 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600743 [Param("VkCmdBuffer", "cmdBuffer"),
744 Param("VkBuffer", "destBuffer"),
745 Param("VkGpuSize", "destOffset"),
746 Param("VkGpuSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600747 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800748
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600749 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600750 [Param("VkCmdBuffer", "cmdBuffer"),
751 Param("VkImage", "image"),
752 Param("VkImageLayout", "imageLayout"),
753 Param("VkClearColor", "color"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600754 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600755 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800756
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600757 Proto("void", "CmdClearDepthStencil",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600758 [Param("VkCmdBuffer", "cmdBuffer"),
759 Param("VkImage", "image"),
760 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600761 Param("float", "depth"),
762 Param("uint32_t", "stencil"),
763 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600764 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800765
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600766 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600767 [Param("VkCmdBuffer", "cmdBuffer"),
768 Param("VkImage", "srcImage"),
769 Param("VkImageLayout", "srcImageLayout"),
770 Param("VkImage", "destImage"),
771 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600772 Param("uint32_t", "regionCount"),
773 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800774
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600775 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600776 [Param("VkCmdBuffer", "cmdBuffer"),
777 Param("VkEvent", "event"),
778 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800779
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600780 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600781 [Param("VkCmdBuffer", "cmdBuffer"),
782 Param("VkEvent", "event"),
783 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800784
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600785 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600786 [Param("VkCmdBuffer", "cmdBuffer"),
787 Param("const VkEventWaitInfo*", "pWaitInfo")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000788
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600789 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600790 [Param("VkCmdBuffer", "cmdBuffer"),
791 Param("const VkPipelineBarrier*", "pBarrier")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000792
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600793 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600794 [Param("VkCmdBuffer", "cmdBuffer"),
795 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600796 Param("uint32_t", "slot"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600797 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800798
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600799 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600800 [Param("VkCmdBuffer", "cmdBuffer"),
801 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600802 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800803
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600804 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600805 [Param("VkCmdBuffer", "cmdBuffer"),
806 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600807 Param("uint32_t", "startQuery"),
808 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800809
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600810 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600811 [Param("VkCmdBuffer", "cmdBuffer"),
812 Param("VkTimestampType", "timestampType"),
813 Param("VkBuffer", "destBuffer"),
814 Param("VkGpuSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800815
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600816 Proto("void", "CmdCopyQueryPoolResults",
817 [Param("VkCmdBuffer", "cmdBuffer"),
818 Param("VkQueryPool", "queryPool"),
819 Param("uint32_t", "startQuery"),
820 Param("uint32_t", "queryCount"),
821 Param("VkBuffer", "destBuffer"),
822 Param("VkGpuSize", "destOffset"),
823 Param("VkGpuSize", "destStride"),
824 Param("VkFlags", "flags")]),
825
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600826 Proto("void", "CmdInitAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600827 [Param("VkCmdBuffer", "cmdBuffer"),
828 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600829 Param("uint32_t", "startCounter"),
830 Param("uint32_t", "counterCount"),
831 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800832
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600833 Proto("void", "CmdLoadAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600834 [Param("VkCmdBuffer", "cmdBuffer"),
835 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600836 Param("uint32_t", "startCounter"),
837 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600838 Param("VkBuffer", "srcBuffer"),
839 Param("VkGpuSize", "srcOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800840
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600841 Proto("void", "CmdSaveAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600842 [Param("VkCmdBuffer", "cmdBuffer"),
843 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600844 Param("uint32_t", "startCounter"),
845 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600846 Param("VkBuffer", "destBuffer"),
847 Param("VkGpuSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800848
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600849 Proto("VkResult", "CreateFramebuffer",
850 [Param("VkDevice", "device"),
851 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
852 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700853
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600854 Proto("VkResult", "CreateRenderPass",
855 [Param("VkDevice", "device"),
856 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
857 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700858
Jon Ashburne13f1982015-02-02 09:58:11 -0700859 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600860 [Param("VkCmdBuffer", "cmdBuffer"),
861 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700862
863 Proto("void", "CmdEndRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600864 [Param("VkCmdBuffer", "cmdBuffer"),
865 Param("VkRenderPass", "renderPass")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700866
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600867 Proto("VkResult", "DbgSetValidationLevel",
868 [Param("VkDevice", "device"),
869 Param("VkValidationLevel", "validationLevel")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800870
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600871 Proto("VkResult", "DbgRegisterMsgCallback",
872 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600873 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600874 Param("void*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800875
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600876 Proto("VkResult", "DbgUnregisterMsgCallback",
877 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600878 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800879
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600880 Proto("VkResult", "DbgSetMessageFilter",
881 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600882 Param("int32_t", "msgCode"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600883 Param("VK_DBG_MSG_FILTER", "filter")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800884
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600885 Proto("VkResult", "DbgSetObjectTag",
886 [Param("VkBaseObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600887 Param("size_t", "tagSize"),
888 Param("const void*", "pTag")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800889
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600890 Proto("VkResult", "DbgSetGlobalOption",
891 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600892 Param("VK_DBG_GLOBAL_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600893 Param("size_t", "dataSize"),
894 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800895
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600896 Proto("VkResult", "DbgSetDeviceOption",
897 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600898 Param("VK_DBG_DEVICE_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600899 Param("size_t", "dataSize"),
900 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800901
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600902 Proto("void", "CmdDbgMarkerBegin",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600903 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600904 Param("const char*", "pMarker")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800905
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600906 Proto("void", "CmdDbgMarkerEnd",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600907 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800908 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800909)
910
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800911wsi_x11 = Extension(
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600912 name="VK_WSI_X11",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600913 headers=["vkWsiX11Ext.h"],
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800914 objects=[],
Chia-I Wue442dc32015-01-01 09:31:15 +0800915 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600916 Proto("VkResult", "WsiX11AssociateConnection",
917 [Param("VkPhysicalGpu", "gpu"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600918 Param("const VK_WSI_X11_CONNECTION_INFO*", "pConnectionInfo")]),
Chia-I Wu6bdf0192014-09-13 13:36:06 +0800919
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600920 Proto("VkResult", "WsiX11GetMSC",
921 [Param("VkDevice", "device"),
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800922 Param("xcb_window_t", "window"),
923 Param("xcb_randr_crtc_t", "crtc"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600924 Param("uint64_t*", "pMsc")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800925
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600926 Proto("VkResult", "WsiX11CreatePresentableImage",
927 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600928 Param("const VK_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600929 Param("VkImage*", "pImage"),
930 Param("VkGpuMemory*", "pMem")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800931
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600932 Proto("VkResult", "WsiX11QueuePresent",
933 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600934 Param("const VK_WSI_X11_PRESENT_INFO*", "pPresentInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600935 Param("VkFence", "fence")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800936 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800937)
938
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800939extensions = [core, wsi_x11]
940
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700941object_root_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600942 "VkInstance",
943 "VkPhysicalGpu",
944 "VkBaseObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700945]
946
947object_base_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600948 "VkDevice",
949 "VkQueue",
950 "VkGpuMemory",
951 "VkObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700952]
953
954object_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600955 "VkBuffer",
956 "VkBufferView",
957 "VkImage",
958 "VkImageView",
959 "VkColorAttachmentView",
960 "VkDepthStencilView",
961 "VkShader",
962 "VkPipeline",
963 "VkSampler",
964 "VkDescriptorSet",
965 "VkDescriptorSetLayout",
966 "VkDescriptorSetLayoutChain",
967 "VkDescriptorPool",
968 "VkDynamicStateObject",
969 "VkCmdBuffer",
970 "VkFence",
971 "VkSemaphore",
972 "VkEvent",
973 "VkQueryPool",
974 "VkFramebuffer",
975 "VkRenderPass"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700976]
977
978object_dynamic_state_list = [
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600979 "VkDynamicVpState",
980 "VkDynamicRsState",
981 "VkDynamicCbState",
982 "VkDynamicDsState"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700983]
984
985object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
986
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600987object_parent_list = ["VkBaseObject", "VkObject", "VkDynamicStateObject"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700988
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800989headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800990objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800991protos = []
992for ext in extensions:
993 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800994 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800995 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800996
Chia-I Wu9a4ceb12015-01-01 14:45:58 +0800997proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +0800998
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600999def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +08001000 # read object and protoype typedefs
1001 object_lines = []
1002 proto_lines = []
1003 with open(filename, "r") as fp:
1004 for line in fp:
1005 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001006 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +08001007 begin = line.find("(") + 1
1008 end = line.find(",")
1009 # extract the object type
1010 object_lines.append(line[begin:end])
1011 if line.startswith("typedef") and line.endswith(");"):
1012 # drop leading "typedef " and trailing ");"
1013 proto_lines.append(line[8:-2])
1014
1015 # parse proto_lines to protos
1016 protos = []
1017 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001018 first, rest = line.split(" (VKAPI *PFN_vk")
1019 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001020
1021 # get the return type, no space before "*"
1022 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1023
1024 # get the name
1025 proto_name = second.strip()
1026
1027 # get the list of params
1028 param_strs = third.split(", ")
1029 params = []
1030 for s in param_strs:
1031 ty, name = s.rsplit(" ", 1)
1032
1033 # no space before "*"
1034 ty = "*".join([t.rstrip() for t in ty.split("*")])
1035 # attach [] to ty
1036 idx = name.rfind("[")
1037 if idx >= 0:
1038 ty += name[idx:]
1039 name = name[:idx]
1040
1041 params.append(Param(ty, name))
1042
1043 protos.append(Proto(proto_ret, proto_name, params))
1044
1045 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001046 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001047 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001048 objects=object_lines,
1049 protos=protos)
1050 print("core =", str(ext))
1051
1052 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001053 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001054 print("{")
1055 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001056 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001057 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001058
1059if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001060 parse_vk_h("include/vulkan.h")