blob: 6d5bd5859550e60a623e26f5901584aab9d9d56d [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 Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600285 Proto("VkResult", "QueueAddMemReference",
286 [Param("VkQueue", "queue"),
287 Param("VkGpuMemory", "mem")]),
Courtney Goeltzenleuchterd3fb9552015-04-02 13:39:07 -0600288
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600289 Proto("VkResult", "QueueRemoveMemReference",
290 [Param("VkQueue", "queue"),
291 Param("VkGpuMemory", "mem")]),
Courtney Goeltzenleuchterd3fb9552015-04-02 13:39:07 -0600292
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600293 Proto("VkResult", "QueueWaitIdle",
294 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800295
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600296 Proto("VkResult", "DeviceWaitIdle",
297 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800298
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600299 Proto("VkResult", "AllocMemory",
300 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600301 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600302 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800303
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600304 Proto("VkResult", "FreeMemory",
305 [Param("VkGpuMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800306
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600307 Proto("VkResult", "SetMemoryPriority",
308 [Param("VkGpuMemory", "mem"),
309 Param("VkMemoryPriority", "priority")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800310
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600311 Proto("VkResult", "MapMemory",
312 [Param("VkGpuMemory", "mem"),
313 Param("VkFlags", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600314 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800315
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600316 Proto("VkResult", "UnmapMemory",
317 [Param("VkGpuMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800318
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600319 Proto("VkResult", "PinSystemMemory",
320 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600321 Param("const void*", "pSysMem"),
322 Param("size_t", "memSize"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600323 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800324
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600325 Proto("VkResult", "GetMultiGpuCompatibility",
326 [Param("VkPhysicalGpu", "gpu0"),
327 Param("VkPhysicalGpu", "gpu1"),
328 Param("VkGpuCompatibilityInfo*", "pInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800329
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600330 Proto("VkResult", "OpenSharedMemory",
331 [Param("VkDevice", "device"),
332 Param("const VkMemoryOpenInfo*", "pOpenInfo"),
333 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800334
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600335 Proto("VkResult", "OpenSharedSemaphore",
336 [Param("VkDevice", "device"),
337 Param("const VkSemaphoreOpenInfo*", "pOpenInfo"),
338 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800339
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600340 Proto("VkResult", "OpenPeerMemory",
341 [Param("VkDevice", "device"),
342 Param("const VkPeerMemoryOpenInfo*", "pOpenInfo"),
343 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800344
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600345 Proto("VkResult", "OpenPeerImage",
346 [Param("VkDevice", "device"),
347 Param("const VkPeerImageOpenInfo*", "pOpenInfo"),
348 Param("VkImage*", "pImage"),
349 Param("VkGpuMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800350
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600351 Proto("VkResult", "DestroyObject",
352 [Param("VkObject", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800353
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600354 Proto("VkResult", "GetObjectInfo",
355 [Param("VkBaseObject", "object"),
356 Param("VkObjectInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600357 Param("size_t*", "pDataSize"),
358 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800359
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500360 Proto("VkResult", "QueueBindObjectMemory",
361 [Param("VkQueue", "queue"),
362 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600363 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600364 Param("VkGpuMemory", "mem"),
365 Param("VkGpuSize", "offset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800366
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500367 Proto("VkResult", "QueueBindObjectMemoryRange",
368 [Param("VkQueue", "queue"),
369 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600370 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600371 Param("VkGpuSize", "rangeOffset"),
372 Param("VkGpuSize", "rangeSize"),
373 Param("VkGpuMemory", "mem"),
374 Param("VkGpuSize", "memOffset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800375
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500376 Proto("VkResult", "QueueBindImageMemoryRange",
377 [Param("VkQueue", "queue"),
378 Param("VkImage", "image"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600379 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600380 Param("const VkImageMemoryBindInfo*", "bindInfo"),
381 Param("VkGpuMemory", "mem"),
382 Param("VkGpuSize", "memOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800383
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600384 Proto("VkResult", "CreateFence",
385 [Param("VkDevice", "device"),
386 Param("const VkFenceCreateInfo*", "pCreateInfo"),
387 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800388
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600389 Proto("VkResult", "ResetFences",
390 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500391 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600392 Param("VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500393
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600394 Proto("VkResult", "GetFenceStatus",
395 [Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800396
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600397 Proto("VkResult", "WaitForFences",
398 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600399 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600400 Param("const VkFence*", "pFences"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600401 Param("bool32_t", "waitAll"),
402 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800403
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600404 Proto("VkResult", "CreateSemaphore",
405 [Param("VkDevice", "device"),
406 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
407 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800408
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600409 Proto("VkResult", "QueueSignalSemaphore",
410 [Param("VkQueue", "queue"),
411 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800412
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600413 Proto("VkResult", "QueueWaitSemaphore",
414 [Param("VkQueue", "queue"),
415 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800416
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600417 Proto("VkResult", "CreateEvent",
418 [Param("VkDevice", "device"),
419 Param("const VkEventCreateInfo*", "pCreateInfo"),
420 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800421
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600422 Proto("VkResult", "GetEventStatus",
423 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800424
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600425 Proto("VkResult", "SetEvent",
426 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800427
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600428 Proto("VkResult", "ResetEvent",
429 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800430
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600431 Proto("VkResult", "CreateQueryPool",
432 [Param("VkDevice", "device"),
433 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
434 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800435
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600436 Proto("VkResult", "GetQueryPoolResults",
437 [Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600438 Param("uint32_t", "startQuery"),
439 Param("uint32_t", "queryCount"),
440 Param("size_t*", "pDataSize"),
441 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800442
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600443 Proto("VkResult", "GetFormatInfo",
444 [Param("VkDevice", "device"),
445 Param("VkFormat", "format"),
446 Param("VkFormatInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600447 Param("size_t*", "pDataSize"),
448 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800449
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600450 Proto("VkResult", "CreateBuffer",
451 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600452 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600453 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800454
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600455 Proto("VkResult", "CreateBufferView",
456 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600457 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600458 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800459
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600460 Proto("VkResult", "CreateImage",
461 [Param("VkDevice", "device"),
462 Param("const VkImageCreateInfo*", "pCreateInfo"),
463 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800464
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600465 Proto("VkResult", "GetImageSubresourceInfo",
466 [Param("VkImage", "image"),
467 Param("const VkImageSubresource*", "pSubresource"),
468 Param("VkSubresourceInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600469 Param("size_t*", "pDataSize"),
470 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800471
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600472 Proto("VkResult", "CreateImageView",
473 [Param("VkDevice", "device"),
474 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
475 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800476
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600477 Proto("VkResult", "CreateColorAttachmentView",
478 [Param("VkDevice", "device"),
479 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
480 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800481
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600482 Proto("VkResult", "CreateDepthStencilView",
483 [Param("VkDevice", "device"),
484 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
485 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800486
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600487 Proto("VkResult", "CreateShader",
488 [Param("VkDevice", "device"),
489 Param("const VkShaderCreateInfo*", "pCreateInfo"),
490 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800491
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600492 Proto("VkResult", "CreateGraphicsPipeline",
493 [Param("VkDevice", "device"),
494 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
495 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800496
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600497 Proto("VkResult", "CreateGraphicsPipelineDerivative",
498 [Param("VkDevice", "device"),
499 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
500 Param("VkPipeline", "basePipeline"),
501 Param("VkPipeline*", "pPipeline")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600502
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600503 Proto("VkResult", "CreateComputePipeline",
504 [Param("VkDevice", "device"),
505 Param("const VkComputePipelineCreateInfo*", "pCreateInfo"),
506 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800507
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600508 Proto("VkResult", "StorePipeline",
509 [Param("VkPipeline", "pipeline"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600510 Param("size_t*", "pDataSize"),
511 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800512
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600513 Proto("VkResult", "LoadPipeline",
514 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600515 Param("size_t", "dataSize"),
516 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600517 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800518
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600519 Proto("VkResult", "LoadPipelineDerivative",
520 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600521 Param("size_t", "dataSize"),
522 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600523 Param("VkPipeline", "basePipeline"),
524 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800525
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600526 Proto("VkResult", "CreateSampler",
527 [Param("VkDevice", "device"),
528 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
529 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800530
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600531 Proto("VkResult", "CreateDescriptorSetLayout",
532 [Param("VkDevice", "device"),
533 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
534 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800535
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600536 Proto("VkResult", "CreateDescriptorSetLayoutChain",
537 [Param("VkDevice", "device"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800538 Param("uint32_t", "setLayoutArrayCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600539 Param("const VkDescriptorSetLayout*", "pSetLayoutArray"),
540 Param("VkDescriptorSetLayoutChain*", "pLayoutChain")]),
Chia-I Wu41126e52015-03-26 15:27:55 +0800541
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600542 Proto("VkResult", "BeginDescriptorPoolUpdate",
543 [Param("VkDevice", "device"),
544 Param("VkDescriptorUpdateMode", "updateMode")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800545
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600546 Proto("VkResult", "EndDescriptorPoolUpdate",
547 [Param("VkDevice", "device"),
548 Param("VkCmdBuffer", "cmd")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800549
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600550 Proto("VkResult", "CreateDescriptorPool",
551 [Param("VkDevice", "device"),
552 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600553 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600554 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
555 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800556
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600557 Proto("VkResult", "ResetDescriptorPool",
558 [Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800559
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600560 Proto("VkResult", "AllocDescriptorSets",
561 [Param("VkDescriptorPool", "descriptorPool"),
562 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600563 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600564 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
565 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600566 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800567
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600568 Proto("void", "ClearDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600569 [Param("VkDescriptorPool", "descriptorPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600570 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600571 Param("const VkDescriptorSet*", "pDescriptorSets")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800572
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600573 Proto("void", "UpdateDescriptors",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600574 [Param("VkDescriptorSet", "descriptorSet"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800575 Param("uint32_t", "updateCount"),
576 Param("const void**", "ppUpdateArray")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800577
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600578 Proto("VkResult", "CreateDynamicViewportState",
579 [Param("VkDevice", "device"),
580 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600581 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800582
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600583 Proto("VkResult", "CreateDynamicRasterState",
584 [Param("VkDevice", "device"),
585 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600586 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800587
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600588 Proto("VkResult", "CreateDynamicColorBlendState",
589 [Param("VkDevice", "device"),
590 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600591 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800592
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600593 Proto("VkResult", "CreateDynamicDepthStencilState",
594 [Param("VkDevice", "device"),
595 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600596 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800597
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600598 Proto("VkResult", "CreateCommandBuffer",
599 [Param("VkDevice", "device"),
600 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
601 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800602
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600603 Proto("VkResult", "BeginCommandBuffer",
604 [Param("VkCmdBuffer", "cmdBuffer"),
605 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800606
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600607 Proto("VkResult", "EndCommandBuffer",
608 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800609
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600610 Proto("VkResult", "ResetCommandBuffer",
611 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800612
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600613 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600614 [Param("VkCmdBuffer", "cmdBuffer"),
615 Param("VkPipelineBindPoint", "pipelineBindPoint"),
616 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800617
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600618 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600619 [Param("VkCmdBuffer", "cmdBuffer"),
620 Param("VkStateBindPoint", "stateBindPoint"),
621 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800622
Chia-I Wu53f07d72015-03-28 15:23:55 +0800623 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600624 [Param("VkCmdBuffer", "cmdBuffer"),
625 Param("VkPipelineBindPoint", "pipelineBindPoint"),
626 Param("VkDescriptorSetLayoutChain", "layoutChain"),
Chia-I Wu53f07d72015-03-28 15:23:55 +0800627 Param("uint32_t", "layoutChainSlot"),
628 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600629 Param("const VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600630 Param("const uint32_t*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800631
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600632 Proto("void", "CmdBindVertexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600633 [Param("VkCmdBuffer", "cmdBuffer"),
634 Param("VkBuffer", "buffer"),
635 Param("VkGpuSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600636 Param("uint32_t", "binding")]),
Chia-I Wu7a42e122014-11-08 10:48:20 +0800637
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600638 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600639 [Param("VkCmdBuffer", "cmdBuffer"),
640 Param("VkBuffer", "buffer"),
641 Param("VkGpuSize", "offset"),
642 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800643
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600644 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600645 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600646 Param("uint32_t", "firstVertex"),
647 Param("uint32_t", "vertexCount"),
648 Param("uint32_t", "firstInstance"),
649 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800650
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600651 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600652 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600653 Param("uint32_t", "firstIndex"),
654 Param("uint32_t", "indexCount"),
655 Param("int32_t", "vertexOffset"),
656 Param("uint32_t", "firstInstance"),
657 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800658
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600659 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600660 [Param("VkCmdBuffer", "cmdBuffer"),
661 Param("VkBuffer", "buffer"),
662 Param("VkGpuSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600663 Param("uint32_t", "count"),
664 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800665
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600666 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600667 [Param("VkCmdBuffer", "cmdBuffer"),
668 Param("VkBuffer", "buffer"),
669 Param("VkGpuSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600670 Param("uint32_t", "count"),
671 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800672
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600673 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600674 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600675 Param("uint32_t", "x"),
676 Param("uint32_t", "y"),
677 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800678
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600679 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600680 [Param("VkCmdBuffer", "cmdBuffer"),
681 Param("VkBuffer", "buffer"),
682 Param("VkGpuSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800683
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600684 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600685 [Param("VkCmdBuffer", "cmdBuffer"),
686 Param("VkBuffer", "srcBuffer"),
687 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600688 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600689 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800690
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600691 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600692 [Param("VkCmdBuffer", "cmdBuffer"),
693 Param("VkImage", "srcImage"),
694 Param("VkImageLayout", "srcImageLayout"),
695 Param("VkImage", "destImage"),
696 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600697 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600698 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800699
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600700 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600701 [Param("VkCmdBuffer", "cmdBuffer"),
702 Param("VkImage", "srcImage"),
703 Param("VkImageLayout", "srcImageLayout"),
704 Param("VkImage", "destImage"),
705 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600706 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600707 Param("const VkImageBlit*", "pRegions")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600708
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600709 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600710 [Param("VkCmdBuffer", "cmdBuffer"),
711 Param("VkBuffer", "srcBuffer"),
712 Param("VkImage", "destImage"),
713 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600714 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600715 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800716
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600717 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600718 [Param("VkCmdBuffer", "cmdBuffer"),
719 Param("VkImage", "srcImage"),
720 Param("VkImageLayout", "srcImageLayout"),
721 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600722 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600723 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800724
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600725 Proto("void", "CmdCloneImageData",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600726 [Param("VkCmdBuffer", "cmdBuffer"),
727 Param("VkImage", "srcImage"),
728 Param("VkImageLayout", "srcImageLayout"),
729 Param("VkImage", "destImage"),
730 Param("VkImageLayout", "destImageLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800731
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600732 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600733 [Param("VkCmdBuffer", "cmdBuffer"),
734 Param("VkBuffer", "destBuffer"),
735 Param("VkGpuSize", "destOffset"),
736 Param("VkGpuSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600737 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800738
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600739 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600740 [Param("VkCmdBuffer", "cmdBuffer"),
741 Param("VkBuffer", "destBuffer"),
742 Param("VkGpuSize", "destOffset"),
743 Param("VkGpuSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600744 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800745
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600746 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600747 [Param("VkCmdBuffer", "cmdBuffer"),
748 Param("VkImage", "image"),
749 Param("VkImageLayout", "imageLayout"),
750 Param("VkClearColor", "color"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600751 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600752 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800753
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600754 Proto("void", "CmdClearDepthStencil",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600755 [Param("VkCmdBuffer", "cmdBuffer"),
756 Param("VkImage", "image"),
757 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600758 Param("float", "depth"),
759 Param("uint32_t", "stencil"),
760 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600761 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800762
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600763 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600764 [Param("VkCmdBuffer", "cmdBuffer"),
765 Param("VkImage", "srcImage"),
766 Param("VkImageLayout", "srcImageLayout"),
767 Param("VkImage", "destImage"),
768 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600769 Param("uint32_t", "regionCount"),
770 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800771
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600772 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600773 [Param("VkCmdBuffer", "cmdBuffer"),
774 Param("VkEvent", "event"),
775 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800776
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600777 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600778 [Param("VkCmdBuffer", "cmdBuffer"),
779 Param("VkEvent", "event"),
780 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800781
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600782 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600783 [Param("VkCmdBuffer", "cmdBuffer"),
784 Param("const VkEventWaitInfo*", "pWaitInfo")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000785
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600786 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600787 [Param("VkCmdBuffer", "cmdBuffer"),
788 Param("const VkPipelineBarrier*", "pBarrier")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000789
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600790 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600791 [Param("VkCmdBuffer", "cmdBuffer"),
792 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600793 Param("uint32_t", "slot"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600794 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800795
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600796 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600797 [Param("VkCmdBuffer", "cmdBuffer"),
798 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600799 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800800
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600801 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600802 [Param("VkCmdBuffer", "cmdBuffer"),
803 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600804 Param("uint32_t", "startQuery"),
805 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800806
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600807 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600808 [Param("VkCmdBuffer", "cmdBuffer"),
809 Param("VkTimestampType", "timestampType"),
810 Param("VkBuffer", "destBuffer"),
811 Param("VkGpuSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800812
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600813 Proto("void", "CmdCopyQueryPoolResults",
814 [Param("VkCmdBuffer", "cmdBuffer"),
815 Param("VkQueryPool", "queryPool"),
816 Param("uint32_t", "startQuery"),
817 Param("uint32_t", "queryCount"),
818 Param("VkBuffer", "destBuffer"),
819 Param("VkGpuSize", "destOffset"),
820 Param("VkGpuSize", "destStride"),
821 Param("VkFlags", "flags")]),
822
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600823 Proto("void", "CmdInitAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600824 [Param("VkCmdBuffer", "cmdBuffer"),
825 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600826 Param("uint32_t", "startCounter"),
827 Param("uint32_t", "counterCount"),
828 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800829
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600830 Proto("void", "CmdLoadAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600831 [Param("VkCmdBuffer", "cmdBuffer"),
832 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600833 Param("uint32_t", "startCounter"),
834 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600835 Param("VkBuffer", "srcBuffer"),
836 Param("VkGpuSize", "srcOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800837
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600838 Proto("void", "CmdSaveAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600839 [Param("VkCmdBuffer", "cmdBuffer"),
840 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600841 Param("uint32_t", "startCounter"),
842 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600843 Param("VkBuffer", "destBuffer"),
844 Param("VkGpuSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800845
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600846 Proto("VkResult", "CreateFramebuffer",
847 [Param("VkDevice", "device"),
848 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
849 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700850
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600851 Proto("VkResult", "CreateRenderPass",
852 [Param("VkDevice", "device"),
853 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
854 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700855
Jon Ashburne13f1982015-02-02 09:58:11 -0700856 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600857 [Param("VkCmdBuffer", "cmdBuffer"),
858 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700859
860 Proto("void", "CmdEndRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600861 [Param("VkCmdBuffer", "cmdBuffer"),
862 Param("VkRenderPass", "renderPass")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700863
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600864 Proto("VkResult", "DbgSetValidationLevel",
865 [Param("VkDevice", "device"),
866 Param("VkValidationLevel", "validationLevel")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800867
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600868 Proto("VkResult", "DbgRegisterMsgCallback",
869 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600870 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600871 Param("void*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800872
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600873 Proto("VkResult", "DbgUnregisterMsgCallback",
874 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600875 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800876
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600877 Proto("VkResult", "DbgSetMessageFilter",
878 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600879 Param("int32_t", "msgCode"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600880 Param("VK_DBG_MSG_FILTER", "filter")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800881
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600882 Proto("VkResult", "DbgSetObjectTag",
883 [Param("VkBaseObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600884 Param("size_t", "tagSize"),
885 Param("const void*", "pTag")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800886
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600887 Proto("VkResult", "DbgSetGlobalOption",
888 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600889 Param("VK_DBG_GLOBAL_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600890 Param("size_t", "dataSize"),
891 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800892
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600893 Proto("VkResult", "DbgSetDeviceOption",
894 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600895 Param("VK_DBG_DEVICE_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600896 Param("size_t", "dataSize"),
897 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800898
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600899 Proto("void", "CmdDbgMarkerBegin",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600900 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600901 Param("const char*", "pMarker")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800902
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600903 Proto("void", "CmdDbgMarkerEnd",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600904 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800905 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800906)
907
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800908wsi_x11 = Extension(
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600909 name="VK_WSI_X11",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600910 headers=["vkWsiX11Ext.h"],
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800911 objects=[],
Chia-I Wue442dc32015-01-01 09:31:15 +0800912 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600913 Proto("VkResult", "WsiX11AssociateConnection",
914 [Param("VkPhysicalGpu", "gpu"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600915 Param("const VK_WSI_X11_CONNECTION_INFO*", "pConnectionInfo")]),
Chia-I Wu6bdf0192014-09-13 13:36:06 +0800916
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600917 Proto("VkResult", "WsiX11GetMSC",
918 [Param("VkDevice", "device"),
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800919 Param("xcb_window_t", "window"),
920 Param("xcb_randr_crtc_t", "crtc"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600921 Param("uint64_t*", "pMsc")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800922
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600923 Proto("VkResult", "WsiX11CreatePresentableImage",
924 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600925 Param("const VK_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600926 Param("VkImage*", "pImage"),
927 Param("VkGpuMemory*", "pMem")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800928
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600929 Proto("VkResult", "WsiX11QueuePresent",
930 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600931 Param("const VK_WSI_X11_PRESENT_INFO*", "pPresentInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600932 Param("VkFence", "fence")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800933 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800934)
935
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800936extensions = [core, wsi_x11]
937
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700938object_root_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600939 "VkInstance",
940 "VkPhysicalGpu",
941 "VkBaseObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700942]
943
944object_base_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600945 "VkDevice",
946 "VkQueue",
947 "VkGpuMemory",
948 "VkObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700949]
950
951object_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600952 "VkBuffer",
953 "VkBufferView",
954 "VkImage",
955 "VkImageView",
956 "VkColorAttachmentView",
957 "VkDepthStencilView",
958 "VkShader",
959 "VkPipeline",
960 "VkSampler",
961 "VkDescriptorSet",
962 "VkDescriptorSetLayout",
963 "VkDescriptorSetLayoutChain",
964 "VkDescriptorPool",
965 "VkDynamicStateObject",
966 "VkCmdBuffer",
967 "VkFence",
968 "VkSemaphore",
969 "VkEvent",
970 "VkQueryPool",
971 "VkFramebuffer",
972 "VkRenderPass"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700973]
974
975object_dynamic_state_list = [
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600976 "VkDynamicVpState",
977 "VkDynamicRsState",
978 "VkDynamicCbState",
979 "VkDynamicDsState"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700980]
981
982object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
983
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600984object_parent_list = ["VkBaseObject", "VkObject", "VkDynamicStateObject"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700985
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800986headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800987objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800988protos = []
989for ext in extensions:
990 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800991 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800992 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800993
Chia-I Wu9a4ceb12015-01-01 14:45:58 +0800994proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +0800995
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600996def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +0800997 # read object and protoype typedefs
998 object_lines = []
999 proto_lines = []
1000 with open(filename, "r") as fp:
1001 for line in fp:
1002 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001003 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +08001004 begin = line.find("(") + 1
1005 end = line.find(",")
1006 # extract the object type
1007 object_lines.append(line[begin:end])
1008 if line.startswith("typedef") and line.endswith(");"):
1009 # drop leading "typedef " and trailing ");"
1010 proto_lines.append(line[8:-2])
1011
1012 # parse proto_lines to protos
1013 protos = []
1014 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001015 first, rest = line.split(" (VKAPI *PFN_vk")
1016 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001017
1018 # get the return type, no space before "*"
1019 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1020
1021 # get the name
1022 proto_name = second.strip()
1023
1024 # get the list of params
1025 param_strs = third.split(", ")
1026 params = []
1027 for s in param_strs:
1028 ty, name = s.rsplit(" ", 1)
1029
1030 # no space before "*"
1031 ty = "*".join([t.rstrip() for t in ty.split("*")])
1032 # attach [] to ty
1033 idx = name.rfind("[")
1034 if idx >= 0:
1035 ty += name[idx:]
1036 name = name[:idx]
1037
1038 params.append(Param(ty, name))
1039
1040 protos.append(Proto(proto_ret, proto_name, params))
1041
1042 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001043 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001044 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001045 objects=object_lines,
1046 protos=protos)
1047 print("core =", str(ext))
1048
1049 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001050 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001051 print("{")
1052 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001053 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001054 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001055
1056if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001057 parse_vk_h("include/vulkan.h")