blob: 5112e367f150f26e90527b70fb0354ff1365ed69 [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",
Tony Barbourd1c35722015-04-16 15:59:00 -0600188 "VkPhysicalDevice",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600189 "VkBaseObject",
190 "VkDevice",
191 "VkQueue",
Tony Barbourd1c35722015-04-16 15:59:00 -0600192 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600193 "VkObject",
194 "VkBuffer",
195 "VkBufferView",
196 "VkImage",
197 "VkImageView",
198 "VkColorAttachmentView",
199 "VkDepthStencilView",
200 "VkShader",
201 "VkPipeline",
202 "VkSampler",
203 "VkDescriptorSet",
204 "VkDescriptorSetLayout",
205 "VkDescriptorSetLayoutChain",
206 "VkDescriptorPool",
207 "VkDynamicStateObject",
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600208 "VkDynamicVpState",
209 "VkDynamicRsState",
210 "VkDynamicCbState",
211 "VkDynamicDsState",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600212 "VkCmdBuffer",
213 "VkFence",
214 "VkSemaphore",
215 "VkEvent",
216 "VkQueryPool",
217 "VkFramebuffer",
218 "VkRenderPass",
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800219 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800220 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600221 Proto("VkResult", "CreateInstance",
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600222 [Param("const VkInstanceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600223 Param("VkInstance*", "pInstance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700224
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600225 Proto("VkResult", "DestroyInstance",
226 [Param("VkInstance", "instance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700227
Jon Ashburn83a64252015-04-15 11:31:12 -0600228 Proto("VkResult", "EnumeratePhysicalDevices",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600229 [Param("VkInstance", "instance"),
Jon Ashburn83a64252015-04-15 11:31:12 -0600230 Param("uint32_t*", "pPhysicalDeviceCount"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600231 Param("VkPhysicalDevice*", "pPhysicalDevices")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700232
Tony Barbourd1c35722015-04-16 15:59:00 -0600233 Proto("VkResult", "GetPhysicalDeviceInfo",
234 [Param("VkPhysicalDevice", "gpu"),
235 Param("VkPhysicalDeviceInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600236 Param("size_t*", "pDataSize"),
237 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800238
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600239 Proto("void*", "GetProcAddr",
Tony Barbourd1c35722015-04-16 15:59:00 -0600240 [Param("VkPhysicalDevice", "gpu"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600241 Param("const char*", "pName")]),
Chia-I Wuf2ffc522015-01-04 14:51:06 +0800242
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600243 Proto("VkResult", "CreateDevice",
Tony Barbourd1c35722015-04-16 15:59:00 -0600244 [Param("VkPhysicalDevice", "gpu"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600245 Param("const VkDeviceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600246 Param("VkDevice*", "pDevice")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800247
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600248 Proto("VkResult", "DestroyDevice",
249 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800250
Jon Ashburn9fd4cc42015-04-10 14:33:07 -0600251 Proto("VkResult", "GetGlobalExtensionInfo",
252 [Param("VkExtensionInfoType", "infoType"),
253 Param("uint32_t", "extensionIndex"),
254 Param("size_t*", "pDataSize"),
255 Param("void*", "pData")]),
256
Tobin Ehlis01939012015-04-16 12:51:37 -0600257 Proto("VkResult", "GetPhysicalDeviceExtensionInfo",
Tony Barbourd1c35722015-04-16 15:59:00 -0600258 [Param("VkPhysicalDevice", "gpu"),
Tobin Ehlis01939012015-04-16 12:51:37 -0600259 Param("VkExtensionInfoType", "infoType"),
260 Param("uint32_t", "extensionIndex"),
261 Param("size_t*", "pDataSize"),
262 Param("void*", "pData")]),
263
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600264 Proto("VkResult", "EnumerateLayers",
Tony Barbourd1c35722015-04-16 15:59:00 -0600265 [Param("VkPhysicalDevice", "gpu"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600266 Param("size_t", "maxLayerCount"),
267 Param("size_t", "maxStringSize"),
268 Param("size_t*", "pOutLayerCount"),
269 Param("char* const*", "pOutLayers"),
270 Param("void*", "pReserved")]),
Jon Ashburnf7bcf9b2014-10-15 15:30:23 -0600271
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600272 Proto("VkResult", "GetDeviceQueue",
273 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter18248e62015-03-05 18:09:39 -0700274 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600275 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600276 Param("VkQueue*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800277
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600278 Proto("VkResult", "QueueSubmit",
279 [Param("VkQueue", "queue"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600280 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600281 Param("const VkCmdBuffer*", "pCmdBuffers"),
282 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800283
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600284 Proto("VkResult", "QueueAddMemReferences",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600285 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600286 Param("uint32_t", "count"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600287 Param("const VkDeviceMemory*", "pMems")]),
Courtney Goeltzenleuchterd3fb9552015-04-02 13:39:07 -0600288
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600289 Proto("VkResult", "QueueRemoveMemReferences",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600290 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600291 Param("uint32_t", "count"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600292 Param("const VkDeviceMemory*", "pMems")]),
Courtney Goeltzenleuchterd3fb9552015-04-02 13:39:07 -0600293
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600294 Proto("VkResult", "QueueWaitIdle",
295 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800296
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600297 Proto("VkResult", "DeviceWaitIdle",
298 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800299
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600300 Proto("VkResult", "AllocMemory",
301 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600302 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600303 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800304
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600305 Proto("VkResult", "FreeMemory",
Tony Barbourd1c35722015-04-16 15:59:00 -0600306 [Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800307
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600308 Proto("VkResult", "SetMemoryPriority",
Tony Barbourd1c35722015-04-16 15:59:00 -0600309 [Param("VkDeviceMemory", "mem"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600310 Param("VkMemoryPriority", "priority")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800311
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600312 Proto("VkResult", "MapMemory",
Tony Barbourd1c35722015-04-16 15:59:00 -0600313 [Param("VkDeviceMemory", "mem"),
Tony Barbour71a85122015-04-16 19:09:28 -0600314 Param("VkDeviceSize", "offset"),
315 Param("VkDeviceSize", "size"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600316 Param("VkFlags", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600317 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800318
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600319 Proto("VkResult", "UnmapMemory",
Tony Barbourd1c35722015-04-16 15:59:00 -0600320 [Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800321
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600322 Proto("VkResult", "PinSystemMemory",
323 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600324 Param("const void*", "pSysMem"),
325 Param("size_t", "memSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600326 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800327
Tony Barbourd1c35722015-04-16 15:59:00 -0600328 Proto("VkResult", "GetMultiDeviceCompatibility",
329 [Param("VkPhysicalDevice", "gpu0"),
330 Param("VkPhysicalDevice", "gpu1"),
331 Param("VkPhysicalDeviceCompatibilityInfo*", "pInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800332
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600333 Proto("VkResult", "OpenSharedMemory",
334 [Param("VkDevice", "device"),
335 Param("const VkMemoryOpenInfo*", "pOpenInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600336 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800337
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600338 Proto("VkResult", "OpenSharedSemaphore",
339 [Param("VkDevice", "device"),
340 Param("const VkSemaphoreOpenInfo*", "pOpenInfo"),
341 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800342
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600343 Proto("VkResult", "OpenPeerMemory",
344 [Param("VkDevice", "device"),
345 Param("const VkPeerMemoryOpenInfo*", "pOpenInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600346 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800347
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600348 Proto("VkResult", "OpenPeerImage",
349 [Param("VkDevice", "device"),
350 Param("const VkPeerImageOpenInfo*", "pOpenInfo"),
351 Param("VkImage*", "pImage"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600352 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800353
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600354 Proto("VkResult", "DestroyObject",
355 [Param("VkObject", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800356
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600357 Proto("VkResult", "GetObjectInfo",
358 [Param("VkBaseObject", "object"),
359 Param("VkObjectInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600360 Param("size_t*", "pDataSize"),
361 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800362
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500363 Proto("VkResult", "QueueBindObjectMemory",
364 [Param("VkQueue", "queue"),
365 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600366 Param("uint32_t", "allocationIdx"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600367 Param("VkDeviceMemory", "mem"),
368 Param("VkDeviceSize", "offset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800369
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500370 Proto("VkResult", "QueueBindObjectMemoryRange",
371 [Param("VkQueue", "queue"),
372 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600373 Param("uint32_t", "allocationIdx"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600374 Param("VkDeviceSize", "rangeOffset"),
375 Param("VkDeviceSize", "rangeSize"),
376 Param("VkDeviceMemory", "mem"),
377 Param("VkDeviceSize", "memOffset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800378
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500379 Proto("VkResult", "QueueBindImageMemoryRange",
380 [Param("VkQueue", "queue"),
381 Param("VkImage", "image"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600382 Param("uint32_t", "allocationIdx"),
Jeremy Hayesaf0d72c2015-04-15 15:20:03 -0600383 Param("const VkImageMemoryBindInfo*", "pBindInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600384 Param("VkDeviceMemory", "mem"),
385 Param("VkDeviceSize", "memOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800386
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600387 Proto("VkResult", "CreateFence",
388 [Param("VkDevice", "device"),
389 Param("const VkFenceCreateInfo*", "pCreateInfo"),
390 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800391
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600392 Proto("VkResult", "ResetFences",
393 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500394 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600395 Param("VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500396
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600397 Proto("VkResult", "GetFenceStatus",
398 [Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800399
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600400 Proto("VkResult", "WaitForFences",
401 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600402 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600403 Param("const VkFence*", "pFences"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600404 Param("bool32_t", "waitAll"),
405 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800406
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600407 Proto("VkResult", "CreateSemaphore",
408 [Param("VkDevice", "device"),
409 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
410 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800411
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600412 Proto("VkResult", "QueueSignalSemaphore",
413 [Param("VkQueue", "queue"),
414 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800415
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600416 Proto("VkResult", "QueueWaitSemaphore",
417 [Param("VkQueue", "queue"),
418 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800419
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600420 Proto("VkResult", "CreateEvent",
421 [Param("VkDevice", "device"),
422 Param("const VkEventCreateInfo*", "pCreateInfo"),
423 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800424
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600425 Proto("VkResult", "GetEventStatus",
426 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800427
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600428 Proto("VkResult", "SetEvent",
429 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800430
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600431 Proto("VkResult", "ResetEvent",
432 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800433
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600434 Proto("VkResult", "CreateQueryPool",
435 [Param("VkDevice", "device"),
436 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
437 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800438
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600439 Proto("VkResult", "GetQueryPoolResults",
440 [Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600441 Param("uint32_t", "startQuery"),
442 Param("uint32_t", "queryCount"),
443 Param("size_t*", "pDataSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600444 Param("void*", "pData"),
445 Param("VkQueryResultFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800446
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600447 Proto("VkResult", "GetFormatInfo",
448 [Param("VkDevice", "device"),
449 Param("VkFormat", "format"),
450 Param("VkFormatInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600451 Param("size_t*", "pDataSize"),
452 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800453
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600454 Proto("VkResult", "CreateBuffer",
455 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600456 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600457 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800458
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600459 Proto("VkResult", "CreateBufferView",
460 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600461 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600462 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800463
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600464 Proto("VkResult", "CreateImage",
465 [Param("VkDevice", "device"),
466 Param("const VkImageCreateInfo*", "pCreateInfo"),
467 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800468
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600469 Proto("VkResult", "GetImageSubresourceInfo",
470 [Param("VkImage", "image"),
471 Param("const VkImageSubresource*", "pSubresource"),
472 Param("VkSubresourceInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600473 Param("size_t*", "pDataSize"),
474 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800475
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600476 Proto("VkResult", "CreateImageView",
477 [Param("VkDevice", "device"),
478 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
479 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800480
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600481 Proto("VkResult", "CreateColorAttachmentView",
482 [Param("VkDevice", "device"),
483 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
484 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800485
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600486 Proto("VkResult", "CreateDepthStencilView",
487 [Param("VkDevice", "device"),
488 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
489 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800490
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600491 Proto("VkResult", "CreateShader",
492 [Param("VkDevice", "device"),
493 Param("const VkShaderCreateInfo*", "pCreateInfo"),
494 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800495
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600496 Proto("VkResult", "CreateGraphicsPipeline",
497 [Param("VkDevice", "device"),
498 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
499 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800500
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600501 Proto("VkResult", "CreateGraphicsPipelineDerivative",
502 [Param("VkDevice", "device"),
503 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
504 Param("VkPipeline", "basePipeline"),
505 Param("VkPipeline*", "pPipeline")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600506
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600507 Proto("VkResult", "CreateComputePipeline",
508 [Param("VkDevice", "device"),
509 Param("const VkComputePipelineCreateInfo*", "pCreateInfo"),
510 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800511
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600512 Proto("VkResult", "StorePipeline",
513 [Param("VkPipeline", "pipeline"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600514 Param("size_t*", "pDataSize"),
515 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800516
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600517 Proto("VkResult", "LoadPipeline",
518 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600519 Param("size_t", "dataSize"),
520 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600521 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800522
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600523 Proto("VkResult", "LoadPipelineDerivative",
524 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600525 Param("size_t", "dataSize"),
526 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600527 Param("VkPipeline", "basePipeline"),
528 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800529
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600530 Proto("VkResult", "CreateSampler",
531 [Param("VkDevice", "device"),
532 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
533 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800534
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600535 Proto("VkResult", "CreateDescriptorSetLayout",
536 [Param("VkDevice", "device"),
537 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
538 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800539
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600540 Proto("VkResult", "CreateDescriptorSetLayoutChain",
541 [Param("VkDevice", "device"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800542 Param("uint32_t", "setLayoutArrayCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600543 Param("const VkDescriptorSetLayout*", "pSetLayoutArray"),
544 Param("VkDescriptorSetLayoutChain*", "pLayoutChain")]),
Chia-I Wu41126e52015-03-26 15:27:55 +0800545
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600546 Proto("VkResult", "BeginDescriptorPoolUpdate",
547 [Param("VkDevice", "device"),
548 Param("VkDescriptorUpdateMode", "updateMode")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800549
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600550 Proto("VkResult", "EndDescriptorPoolUpdate",
551 [Param("VkDevice", "device"),
552 Param("VkCmdBuffer", "cmd")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800553
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600554 Proto("VkResult", "CreateDescriptorPool",
555 [Param("VkDevice", "device"),
556 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600557 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600558 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
559 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800560
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600561 Proto("VkResult", "ResetDescriptorPool",
562 [Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800563
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600564 Proto("VkResult", "AllocDescriptorSets",
565 [Param("VkDescriptorPool", "descriptorPool"),
566 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600567 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600568 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
569 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600570 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800571
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600572 Proto("void", "ClearDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600573 [Param("VkDescriptorPool", "descriptorPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600574 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600575 Param("const VkDescriptorSet*", "pDescriptorSets")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800576
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600577 Proto("void", "UpdateDescriptors",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600578 [Param("VkDescriptorSet", "descriptorSet"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800579 Param("uint32_t", "updateCount"),
580 Param("const void**", "ppUpdateArray")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800581
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600582 Proto("VkResult", "CreateDynamicViewportState",
583 [Param("VkDevice", "device"),
584 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600585 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800586
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600587 Proto("VkResult", "CreateDynamicRasterState",
588 [Param("VkDevice", "device"),
589 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600590 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800591
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600592 Proto("VkResult", "CreateDynamicColorBlendState",
593 [Param("VkDevice", "device"),
594 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600595 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800596
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600597 Proto("VkResult", "CreateDynamicDepthStencilState",
598 [Param("VkDevice", "device"),
599 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600600 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800601
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600602 Proto("VkResult", "CreateCommandBuffer",
603 [Param("VkDevice", "device"),
604 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
605 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800606
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600607 Proto("VkResult", "BeginCommandBuffer",
608 [Param("VkCmdBuffer", "cmdBuffer"),
609 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800610
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600611 Proto("VkResult", "EndCommandBuffer",
612 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800613
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600614 Proto("VkResult", "ResetCommandBuffer",
615 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800616
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600617 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600618 [Param("VkCmdBuffer", "cmdBuffer"),
619 Param("VkPipelineBindPoint", "pipelineBindPoint"),
620 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800621
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600622 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600623 [Param("VkCmdBuffer", "cmdBuffer"),
624 Param("VkStateBindPoint", "stateBindPoint"),
625 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800626
Chia-I Wu53f07d72015-03-28 15:23:55 +0800627 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600628 [Param("VkCmdBuffer", "cmdBuffer"),
629 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Chia-I Wu53f07d72015-03-28 15:23:55 +0800630 Param("uint32_t", "layoutChainSlot"),
631 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600632 Param("const VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600633 Param("const uint32_t*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800634
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600635 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600636 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600637 Param("uint32_t", "startBinding"),
638 Param("uint32_t", "bindingCount"),
639 Param("const VkBuffer*", "pBuffers"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600640 Param("const VkDeviceSize*", "pOffsets")]),
641
Chia-I Wu7a42e122014-11-08 10:48:20 +0800642
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600643 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600644 [Param("VkCmdBuffer", "cmdBuffer"),
645 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600646 Param("VkDeviceSize", "offset"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600647 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800648
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600649 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600650 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600651 Param("uint32_t", "firstVertex"),
652 Param("uint32_t", "vertexCount"),
653 Param("uint32_t", "firstInstance"),
654 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800655
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600656 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600657 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600658 Param("uint32_t", "firstIndex"),
659 Param("uint32_t", "indexCount"),
660 Param("int32_t", "vertexOffset"),
661 Param("uint32_t", "firstInstance"),
662 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800663
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600664 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600665 [Param("VkCmdBuffer", "cmdBuffer"),
666 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600667 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600668 Param("uint32_t", "count"),
669 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800670
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600671 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600672 [Param("VkCmdBuffer", "cmdBuffer"),
673 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600674 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600675 Param("uint32_t", "count"),
676 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800677
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600678 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600679 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600680 Param("uint32_t", "x"),
681 Param("uint32_t", "y"),
682 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800683
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600684 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600685 [Param("VkCmdBuffer", "cmdBuffer"),
686 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600687 Param("VkDeviceSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800688
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600689 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600690 [Param("VkCmdBuffer", "cmdBuffer"),
691 Param("VkBuffer", "srcBuffer"),
692 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600693 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600694 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800695
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600696 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600697 [Param("VkCmdBuffer", "cmdBuffer"),
698 Param("VkImage", "srcImage"),
699 Param("VkImageLayout", "srcImageLayout"),
700 Param("VkImage", "destImage"),
701 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600702 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600703 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800704
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600705 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600706 [Param("VkCmdBuffer", "cmdBuffer"),
707 Param("VkImage", "srcImage"),
708 Param("VkImageLayout", "srcImageLayout"),
709 Param("VkImage", "destImage"),
710 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600711 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600712 Param("const VkImageBlit*", "pRegions")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600713
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600714 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600715 [Param("VkCmdBuffer", "cmdBuffer"),
716 Param("VkBuffer", "srcBuffer"),
717 Param("VkImage", "destImage"),
718 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600719 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600720 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800721
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600722 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600723 [Param("VkCmdBuffer", "cmdBuffer"),
724 Param("VkImage", "srcImage"),
725 Param("VkImageLayout", "srcImageLayout"),
726 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600727 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600728 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800729
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600730 Proto("void", "CmdCloneImageData",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600731 [Param("VkCmdBuffer", "cmdBuffer"),
732 Param("VkImage", "srcImage"),
733 Param("VkImageLayout", "srcImageLayout"),
734 Param("VkImage", "destImage"),
735 Param("VkImageLayout", "destImageLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800736
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600737 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600738 [Param("VkCmdBuffer", "cmdBuffer"),
739 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600740 Param("VkDeviceSize", "destOffset"),
741 Param("VkDeviceSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600742 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800743
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600744 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600745 [Param("VkCmdBuffer", "cmdBuffer"),
746 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600747 Param("VkDeviceSize", "destOffset"),
748 Param("VkDeviceSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600749 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800750
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600751 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600752 [Param("VkCmdBuffer", "cmdBuffer"),
753 Param("VkImage", "image"),
754 Param("VkImageLayout", "imageLayout"),
755 Param("VkClearColor", "color"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600756 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600757 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800758
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600759 Proto("void", "CmdClearDepthStencil",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600760 [Param("VkCmdBuffer", "cmdBuffer"),
761 Param("VkImage", "image"),
762 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600763 Param("float", "depth"),
764 Param("uint32_t", "stencil"),
765 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600766 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800767
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600768 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600769 [Param("VkCmdBuffer", "cmdBuffer"),
770 Param("VkImage", "srcImage"),
771 Param("VkImageLayout", "srcImageLayout"),
772 Param("VkImage", "destImage"),
773 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600774 Param("uint32_t", "regionCount"),
775 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800776
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600777 Proto("void", "CmdSetEvent",
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", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600783 [Param("VkCmdBuffer", "cmdBuffer"),
784 Param("VkEvent", "event"),
785 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800786
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600787 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600788 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600789 Param("VkWaitEvent", "waitEvent"),
790 Param("uint32_t", "eventCount"),
791 Param("const VkEvent*", "pEvents"),
792 Param("uint32_t", "memBarrierCount"),
793 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000794
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600795 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600796 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600797 Param("VkWaitEvent", "waitEvent"),
798 Param("uint32_t", "pipeEventCount"),
799 Param("const VkPipeEvent*", "pPipeEvents"),
800 Param("uint32_t", "memBarrierCount"),
801 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000802
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600803 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600804 [Param("VkCmdBuffer", "cmdBuffer"),
805 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600806 Param("uint32_t", "slot"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600807 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800808
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600809 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600810 [Param("VkCmdBuffer", "cmdBuffer"),
811 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600812 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800813
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600814 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600815 [Param("VkCmdBuffer", "cmdBuffer"),
816 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600817 Param("uint32_t", "startQuery"),
818 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800819
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600820 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600821 [Param("VkCmdBuffer", "cmdBuffer"),
822 Param("VkTimestampType", "timestampType"),
823 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600824 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800825
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600826 Proto("void", "CmdCopyQueryPoolResults",
827 [Param("VkCmdBuffer", "cmdBuffer"),
828 Param("VkQueryPool", "queryPool"),
829 Param("uint32_t", "startQuery"),
830 Param("uint32_t", "queryCount"),
831 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600832 Param("VkDeviceSize", "destOffset"),
833 Param("VkDeviceSize", "destStride"),
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600834 Param("VkFlags", "flags")]),
835
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600836 Proto("void", "CmdInitAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600837 [Param("VkCmdBuffer", "cmdBuffer"),
838 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600839 Param("uint32_t", "startCounter"),
840 Param("uint32_t", "counterCount"),
841 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800842
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600843 Proto("void", "CmdLoadAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600844 [Param("VkCmdBuffer", "cmdBuffer"),
845 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600846 Param("uint32_t", "startCounter"),
847 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600848 Param("VkBuffer", "srcBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600849 Param("VkDeviceSize", "srcOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800850
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600851 Proto("void", "CmdSaveAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600852 [Param("VkCmdBuffer", "cmdBuffer"),
853 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600854 Param("uint32_t", "startCounter"),
855 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600856 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600857 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800858
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600859 Proto("VkResult", "CreateFramebuffer",
860 [Param("VkDevice", "device"),
861 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
862 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700863
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600864 Proto("VkResult", "CreateRenderPass",
865 [Param("VkDevice", "device"),
866 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
867 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700868
Jon Ashburne13f1982015-02-02 09:58:11 -0700869 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600870 [Param("VkCmdBuffer", "cmdBuffer"),
871 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700872
873 Proto("void", "CmdEndRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600874 [Param("VkCmdBuffer", "cmdBuffer"),
875 Param("VkRenderPass", "renderPass")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700876
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600877 Proto("VkResult", "DbgSetValidationLevel",
878 [Param("VkDevice", "device"),
879 Param("VkValidationLevel", "validationLevel")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800880
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600881 Proto("VkResult", "DbgRegisterMsgCallback",
882 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600883 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600884 Param("void*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800885
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600886 Proto("VkResult", "DbgUnregisterMsgCallback",
887 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600888 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800889
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600890 Proto("VkResult", "DbgSetMessageFilter",
891 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600892 Param("int32_t", "msgCode"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600893 Param("VK_DBG_MSG_FILTER", "filter")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800894
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600895 Proto("VkResult", "DbgSetObjectTag",
896 [Param("VkBaseObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600897 Param("size_t", "tagSize"),
898 Param("const void*", "pTag")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800899
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600900 Proto("VkResult", "DbgSetGlobalOption",
901 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600902 Param("VK_DBG_GLOBAL_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600903 Param("size_t", "dataSize"),
904 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800905
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600906 Proto("VkResult", "DbgSetDeviceOption",
907 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600908 Param("VK_DBG_DEVICE_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600909 Param("size_t", "dataSize"),
910 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800911
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600912 Proto("void", "CmdDbgMarkerBegin",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600913 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600914 Param("const char*", "pMarker")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800915
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600916 Proto("void", "CmdDbgMarkerEnd",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600917 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800918 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800919)
920
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800921wsi_x11 = Extension(
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600922 name="VK_WSI_X11",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600923 headers=["vkWsiX11Ext.h"],
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800924 objects=[],
Chia-I Wue442dc32015-01-01 09:31:15 +0800925 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600926 Proto("VkResult", "WsiX11AssociateConnection",
Tony Barbourd1c35722015-04-16 15:59:00 -0600927 [Param("VkPhysicalDevice", "gpu"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600928 Param("const VK_WSI_X11_CONNECTION_INFO*", "pConnectionInfo")]),
Chia-I Wu6bdf0192014-09-13 13:36:06 +0800929
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600930 Proto("VkResult", "WsiX11GetMSC",
931 [Param("VkDevice", "device"),
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800932 Param("xcb_window_t", "window"),
933 Param("xcb_randr_crtc_t", "crtc"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600934 Param("uint64_t*", "pMsc")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800935
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600936 Proto("VkResult", "WsiX11CreatePresentableImage",
937 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600938 Param("const VK_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600939 Param("VkImage*", "pImage"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600940 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800941
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600942 Proto("VkResult", "WsiX11QueuePresent",
943 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600944 Param("const VK_WSI_X11_PRESENT_INFO*", "pPresentInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600945 Param("VkFence", "fence")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800946 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800947)
948
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800949extensions = [core, wsi_x11]
950
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700951object_root_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600952 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -0600953 "VkPhysicalDevice",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600954 "VkBaseObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700955]
956
957object_base_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600958 "VkDevice",
959 "VkQueue",
Tony Barbourd1c35722015-04-16 15:59:00 -0600960 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600961 "VkObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700962]
963
964object_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600965 "VkBuffer",
966 "VkBufferView",
967 "VkImage",
968 "VkImageView",
969 "VkColorAttachmentView",
970 "VkDepthStencilView",
971 "VkShader",
972 "VkPipeline",
973 "VkSampler",
974 "VkDescriptorSet",
975 "VkDescriptorSetLayout",
976 "VkDescriptorSetLayoutChain",
977 "VkDescriptorPool",
978 "VkDynamicStateObject",
979 "VkCmdBuffer",
980 "VkFence",
981 "VkSemaphore",
982 "VkEvent",
983 "VkQueryPool",
984 "VkFramebuffer",
985 "VkRenderPass"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700986]
987
988object_dynamic_state_list = [
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600989 "VkDynamicVpState",
990 "VkDynamicRsState",
991 "VkDynamicCbState",
992 "VkDynamicDsState"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700993]
994
995object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
996
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600997object_parent_list = ["VkBaseObject", "VkObject", "VkDynamicStateObject"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700998
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800999headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001000objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001001protos = []
1002for ext in extensions:
1003 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001004 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001005 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001006
Chia-I Wu9a4ceb12015-01-01 14:45:58 +08001007proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +08001008
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001009def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +08001010 # read object and protoype typedefs
1011 object_lines = []
1012 proto_lines = []
1013 with open(filename, "r") as fp:
1014 for line in fp:
1015 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001016 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +08001017 begin = line.find("(") + 1
1018 end = line.find(",")
1019 # extract the object type
1020 object_lines.append(line[begin:end])
1021 if line.startswith("typedef") and line.endswith(");"):
1022 # drop leading "typedef " and trailing ");"
1023 proto_lines.append(line[8:-2])
1024
1025 # parse proto_lines to protos
1026 protos = []
1027 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001028 first, rest = line.split(" (VKAPI *PFN_vk")
1029 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001030
1031 # get the return type, no space before "*"
1032 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1033
1034 # get the name
1035 proto_name = second.strip()
1036
1037 # get the list of params
1038 param_strs = third.split(", ")
1039 params = []
1040 for s in param_strs:
1041 ty, name = s.rsplit(" ", 1)
1042
1043 # no space before "*"
1044 ty = "*".join([t.rstrip() for t in ty.split("*")])
1045 # attach [] to ty
1046 idx = name.rfind("[")
1047 if idx >= 0:
1048 ty += name[idx:]
1049 name = name[:idx]
1050
1051 params.append(Param(ty, name))
1052
1053 protos.append(Proto(proto_ret, proto_name, params))
1054
1055 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001056 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001057 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001058 objects=object_lines,
1059 protos=protos)
1060 print("core =", str(ext))
1061
1062 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001063 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001064 print("{")
1065 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001066 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001067 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001068
1069if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001070 parse_vk_h("include/vulkan.h")