blob: 9a708fa2bff493278c2e5feb62ad259990d9bf87 [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
Tony Barbourb1250542015-04-16 19:23:13 -0600322 Proto("VkResult", "FlushMappedMemory",
323 [Param("VkDeviceMemory", "mem"),
324 Param("VkDeviceSize", "offset"),
325 Param("VkDeviceSize", "size")]),
326
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600327 Proto("VkResult", "PinSystemMemory",
328 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600329 Param("const void*", "pSysMem"),
330 Param("size_t", "memSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600331 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800332
Tony Barbourd1c35722015-04-16 15:59:00 -0600333 Proto("VkResult", "GetMultiDeviceCompatibility",
334 [Param("VkPhysicalDevice", "gpu0"),
335 Param("VkPhysicalDevice", "gpu1"),
336 Param("VkPhysicalDeviceCompatibilityInfo*", "pInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800337
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600338 Proto("VkResult", "OpenSharedMemory",
339 [Param("VkDevice", "device"),
340 Param("const VkMemoryOpenInfo*", "pOpenInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600341 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800342
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600343 Proto("VkResult", "OpenSharedSemaphore",
344 [Param("VkDevice", "device"),
345 Param("const VkSemaphoreOpenInfo*", "pOpenInfo"),
346 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800347
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600348 Proto("VkResult", "OpenPeerMemory",
349 [Param("VkDevice", "device"),
350 Param("const VkPeerMemoryOpenInfo*", "pOpenInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600351 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800352
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600353 Proto("VkResult", "OpenPeerImage",
354 [Param("VkDevice", "device"),
355 Param("const VkPeerImageOpenInfo*", "pOpenInfo"),
356 Param("VkImage*", "pImage"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600357 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800358
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600359 Proto("VkResult", "DestroyObject",
360 [Param("VkObject", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800361
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600362 Proto("VkResult", "GetObjectInfo",
363 [Param("VkBaseObject", "object"),
364 Param("VkObjectInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600365 Param("size_t*", "pDataSize"),
366 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800367
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500368 Proto("VkResult", "QueueBindObjectMemory",
369 [Param("VkQueue", "queue"),
370 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600371 Param("uint32_t", "allocationIdx"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600372 Param("VkDeviceMemory", "mem"),
373 Param("VkDeviceSize", "offset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800374
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500375 Proto("VkResult", "QueueBindObjectMemoryRange",
376 [Param("VkQueue", "queue"),
377 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600378 Param("uint32_t", "allocationIdx"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600379 Param("VkDeviceSize", "rangeOffset"),
380 Param("VkDeviceSize", "rangeSize"),
381 Param("VkDeviceMemory", "mem"),
382 Param("VkDeviceSize", "memOffset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800383
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500384 Proto("VkResult", "QueueBindImageMemoryRange",
385 [Param("VkQueue", "queue"),
386 Param("VkImage", "image"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600387 Param("uint32_t", "allocationIdx"),
Jeremy Hayesaf0d72c2015-04-15 15:20:03 -0600388 Param("const VkImageMemoryBindInfo*", "pBindInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600389 Param("VkDeviceMemory", "mem"),
390 Param("VkDeviceSize", "memOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800391
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600392 Proto("VkResult", "CreateFence",
393 [Param("VkDevice", "device"),
394 Param("const VkFenceCreateInfo*", "pCreateInfo"),
395 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800396
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600397 Proto("VkResult", "ResetFences",
398 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500399 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600400 Param("VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500401
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600402 Proto("VkResult", "GetFenceStatus",
403 [Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800404
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600405 Proto("VkResult", "WaitForFences",
406 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600407 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600408 Param("const VkFence*", "pFences"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600409 Param("bool32_t", "waitAll"),
410 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800411
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600412 Proto("VkResult", "CreateSemaphore",
413 [Param("VkDevice", "device"),
414 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
415 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800416
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600417 Proto("VkResult", "QueueSignalSemaphore",
418 [Param("VkQueue", "queue"),
419 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800420
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600421 Proto("VkResult", "QueueWaitSemaphore",
422 [Param("VkQueue", "queue"),
423 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800424
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600425 Proto("VkResult", "CreateEvent",
426 [Param("VkDevice", "device"),
427 Param("const VkEventCreateInfo*", "pCreateInfo"),
428 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800429
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600430 Proto("VkResult", "GetEventStatus",
431 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800432
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600433 Proto("VkResult", "SetEvent",
434 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800435
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600436 Proto("VkResult", "ResetEvent",
437 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800438
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600439 Proto("VkResult", "CreateQueryPool",
440 [Param("VkDevice", "device"),
441 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
442 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800443
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600444 Proto("VkResult", "GetQueryPoolResults",
445 [Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600446 Param("uint32_t", "startQuery"),
447 Param("uint32_t", "queryCount"),
448 Param("size_t*", "pDataSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600449 Param("void*", "pData"),
450 Param("VkQueryResultFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800451
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600452 Proto("VkResult", "GetFormatInfo",
453 [Param("VkDevice", "device"),
454 Param("VkFormat", "format"),
455 Param("VkFormatInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600456 Param("size_t*", "pDataSize"),
457 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800458
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600459 Proto("VkResult", "CreateBuffer",
460 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600461 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600462 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800463
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600464 Proto("VkResult", "CreateBufferView",
465 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600466 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600467 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800468
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600469 Proto("VkResult", "CreateImage",
470 [Param("VkDevice", "device"),
471 Param("const VkImageCreateInfo*", "pCreateInfo"),
472 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800473
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600474 Proto("VkResult", "GetImageSubresourceInfo",
475 [Param("VkImage", "image"),
476 Param("const VkImageSubresource*", "pSubresource"),
477 Param("VkSubresourceInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600478 Param("size_t*", "pDataSize"),
479 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800480
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600481 Proto("VkResult", "CreateImageView",
482 [Param("VkDevice", "device"),
483 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
484 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800485
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600486 Proto("VkResult", "CreateColorAttachmentView",
487 [Param("VkDevice", "device"),
488 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
489 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800490
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600491 Proto("VkResult", "CreateDepthStencilView",
492 [Param("VkDevice", "device"),
493 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
494 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800495
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600496 Proto("VkResult", "CreateShader",
497 [Param("VkDevice", "device"),
498 Param("const VkShaderCreateInfo*", "pCreateInfo"),
499 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800500
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600501 Proto("VkResult", "CreateGraphicsPipeline",
502 [Param("VkDevice", "device"),
503 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
504 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800505
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600506 Proto("VkResult", "CreateGraphicsPipelineDerivative",
507 [Param("VkDevice", "device"),
508 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
509 Param("VkPipeline", "basePipeline"),
510 Param("VkPipeline*", "pPipeline")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600511
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600512 Proto("VkResult", "CreateComputePipeline",
513 [Param("VkDevice", "device"),
514 Param("const VkComputePipelineCreateInfo*", "pCreateInfo"),
515 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800516
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600517 Proto("VkResult", "StorePipeline",
518 [Param("VkPipeline", "pipeline"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600519 Param("size_t*", "pDataSize"),
520 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800521
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600522 Proto("VkResult", "LoadPipeline",
523 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600524 Param("size_t", "dataSize"),
525 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600526 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800527
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600528 Proto("VkResult", "LoadPipelineDerivative",
529 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600530 Param("size_t", "dataSize"),
531 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600532 Param("VkPipeline", "basePipeline"),
533 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800534
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600535 Proto("VkResult", "CreateSampler",
536 [Param("VkDevice", "device"),
537 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
538 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800539
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600540 Proto("VkResult", "CreateDescriptorSetLayout",
541 [Param("VkDevice", "device"),
542 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
543 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800544
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600545 Proto("VkResult", "CreateDescriptorSetLayoutChain",
546 [Param("VkDevice", "device"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800547 Param("uint32_t", "setLayoutArrayCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600548 Param("const VkDescriptorSetLayout*", "pSetLayoutArray"),
549 Param("VkDescriptorSetLayoutChain*", "pLayoutChain")]),
Chia-I Wu41126e52015-03-26 15:27:55 +0800550
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600551 Proto("VkResult", "BeginDescriptorPoolUpdate",
552 [Param("VkDevice", "device"),
553 Param("VkDescriptorUpdateMode", "updateMode")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800554
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600555 Proto("VkResult", "EndDescriptorPoolUpdate",
556 [Param("VkDevice", "device"),
557 Param("VkCmdBuffer", "cmd")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800558
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600559 Proto("VkResult", "CreateDescriptorPool",
560 [Param("VkDevice", "device"),
561 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600562 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600563 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
564 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800565
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600566 Proto("VkResult", "ResetDescriptorPool",
567 [Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800568
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600569 Proto("VkResult", "AllocDescriptorSets",
570 [Param("VkDescriptorPool", "descriptorPool"),
571 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600572 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600573 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
574 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600575 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800576
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600577 Proto("void", "ClearDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600578 [Param("VkDescriptorPool", "descriptorPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600579 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600580 Param("const VkDescriptorSet*", "pDescriptorSets")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800581
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600582 Proto("void", "UpdateDescriptors",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600583 [Param("VkDescriptorSet", "descriptorSet"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800584 Param("uint32_t", "updateCount"),
585 Param("const void**", "ppUpdateArray")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800586
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600587 Proto("VkResult", "CreateDynamicViewportState",
588 [Param("VkDevice", "device"),
589 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600590 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800591
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600592 Proto("VkResult", "CreateDynamicRasterState",
593 [Param("VkDevice", "device"),
594 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600595 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800596
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600597 Proto("VkResult", "CreateDynamicColorBlendState",
598 [Param("VkDevice", "device"),
599 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600600 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800601
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600602 Proto("VkResult", "CreateDynamicDepthStencilState",
603 [Param("VkDevice", "device"),
604 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600605 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800606
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600607 Proto("VkResult", "CreateCommandBuffer",
608 [Param("VkDevice", "device"),
609 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
610 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800611
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600612 Proto("VkResult", "BeginCommandBuffer",
613 [Param("VkCmdBuffer", "cmdBuffer"),
614 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800615
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600616 Proto("VkResult", "EndCommandBuffer",
617 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800618
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600619 Proto("VkResult", "ResetCommandBuffer",
620 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800621
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600622 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600623 [Param("VkCmdBuffer", "cmdBuffer"),
624 Param("VkPipelineBindPoint", "pipelineBindPoint"),
625 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800626
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600627 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600628 [Param("VkCmdBuffer", "cmdBuffer"),
629 Param("VkStateBindPoint", "stateBindPoint"),
630 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800631
Chia-I Wu53f07d72015-03-28 15:23:55 +0800632 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600633 [Param("VkCmdBuffer", "cmdBuffer"),
634 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600635 Param("uint32_t", "firstSet"),
636 Param("uint32_t", "setCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600637 Param("const VkDescriptorSet*", "pDescriptorSets"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600638 Param("uint32_t", "dynamicOffsetCount"),
639 Param("const uint32_t*", "pDynamicOffsets")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800640
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600641 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600642 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600643 Param("uint32_t", "startBinding"),
644 Param("uint32_t", "bindingCount"),
645 Param("const VkBuffer*", "pBuffers"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600646 Param("const VkDeviceSize*", "pOffsets")]),
647
Chia-I Wu7a42e122014-11-08 10:48:20 +0800648
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600649 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600650 [Param("VkCmdBuffer", "cmdBuffer"),
651 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600652 Param("VkDeviceSize", "offset"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600653 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800654
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600655 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600656 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600657 Param("uint32_t", "firstVertex"),
658 Param("uint32_t", "vertexCount"),
659 Param("uint32_t", "firstInstance"),
660 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800661
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600662 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600663 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600664 Param("uint32_t", "firstIndex"),
665 Param("uint32_t", "indexCount"),
666 Param("int32_t", "vertexOffset"),
667 Param("uint32_t", "firstInstance"),
668 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800669
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600670 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600671 [Param("VkCmdBuffer", "cmdBuffer"),
672 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600673 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600674 Param("uint32_t", "count"),
675 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800676
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600677 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600678 [Param("VkCmdBuffer", "cmdBuffer"),
679 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600680 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600681 Param("uint32_t", "count"),
682 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800683
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600684 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600685 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600686 Param("uint32_t", "x"),
687 Param("uint32_t", "y"),
688 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800689
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600690 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600691 [Param("VkCmdBuffer", "cmdBuffer"),
692 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600693 Param("VkDeviceSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800694
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600695 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600696 [Param("VkCmdBuffer", "cmdBuffer"),
697 Param("VkBuffer", "srcBuffer"),
698 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600699 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600700 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800701
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600702 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600703 [Param("VkCmdBuffer", "cmdBuffer"),
704 Param("VkImage", "srcImage"),
705 Param("VkImageLayout", "srcImageLayout"),
706 Param("VkImage", "destImage"),
707 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600708 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600709 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800710
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600711 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600712 [Param("VkCmdBuffer", "cmdBuffer"),
713 Param("VkImage", "srcImage"),
714 Param("VkImageLayout", "srcImageLayout"),
715 Param("VkImage", "destImage"),
716 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600717 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600718 Param("const VkImageBlit*", "pRegions")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600719
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600720 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600721 [Param("VkCmdBuffer", "cmdBuffer"),
722 Param("VkBuffer", "srcBuffer"),
723 Param("VkImage", "destImage"),
724 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600725 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600726 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800727
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600728 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600729 [Param("VkCmdBuffer", "cmdBuffer"),
730 Param("VkImage", "srcImage"),
731 Param("VkImageLayout", "srcImageLayout"),
732 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600733 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600734 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800735
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600736 Proto("void", "CmdCloneImageData",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600737 [Param("VkCmdBuffer", "cmdBuffer"),
738 Param("VkImage", "srcImage"),
739 Param("VkImageLayout", "srcImageLayout"),
740 Param("VkImage", "destImage"),
741 Param("VkImageLayout", "destImageLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800742
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600743 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600744 [Param("VkCmdBuffer", "cmdBuffer"),
745 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600746 Param("VkDeviceSize", "destOffset"),
747 Param("VkDeviceSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600748 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800749
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600750 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600751 [Param("VkCmdBuffer", "cmdBuffer"),
752 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600753 Param("VkDeviceSize", "destOffset"),
754 Param("VkDeviceSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600755 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800756
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600757 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600758 [Param("VkCmdBuffer", "cmdBuffer"),
759 Param("VkImage", "image"),
760 Param("VkImageLayout", "imageLayout"),
761 Param("VkClearColor", "color"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600762 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600763 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800764
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600765 Proto("void", "CmdClearDepthStencil",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600766 [Param("VkCmdBuffer", "cmdBuffer"),
767 Param("VkImage", "image"),
768 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600769 Param("float", "depth"),
770 Param("uint32_t", "stencil"),
771 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600772 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800773
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600774 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600775 [Param("VkCmdBuffer", "cmdBuffer"),
776 Param("VkImage", "srcImage"),
777 Param("VkImageLayout", "srcImageLayout"),
778 Param("VkImage", "destImage"),
779 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600780 Param("uint32_t", "regionCount"),
781 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800782
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600783 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600784 [Param("VkCmdBuffer", "cmdBuffer"),
785 Param("VkEvent", "event"),
786 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800787
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600788 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600789 [Param("VkCmdBuffer", "cmdBuffer"),
790 Param("VkEvent", "event"),
791 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800792
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600793 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600794 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600795 Param("VkWaitEvent", "waitEvent"),
796 Param("uint32_t", "eventCount"),
797 Param("const VkEvent*", "pEvents"),
798 Param("uint32_t", "memBarrierCount"),
799 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000800
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600801 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600802 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600803 Param("VkWaitEvent", "waitEvent"),
804 Param("uint32_t", "pipeEventCount"),
805 Param("const VkPipeEvent*", "pPipeEvents"),
806 Param("uint32_t", "memBarrierCount"),
807 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000808
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600809 Proto("void", "CmdBeginQuery",
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"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600813 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800814
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600815 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600816 [Param("VkCmdBuffer", "cmdBuffer"),
817 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600818 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800819
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600820 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600821 [Param("VkCmdBuffer", "cmdBuffer"),
822 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600823 Param("uint32_t", "startQuery"),
824 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800825
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600826 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600827 [Param("VkCmdBuffer", "cmdBuffer"),
828 Param("VkTimestampType", "timestampType"),
829 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600830 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800831
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600832 Proto("void", "CmdCopyQueryPoolResults",
833 [Param("VkCmdBuffer", "cmdBuffer"),
834 Param("VkQueryPool", "queryPool"),
835 Param("uint32_t", "startQuery"),
836 Param("uint32_t", "queryCount"),
837 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600838 Param("VkDeviceSize", "destOffset"),
839 Param("VkDeviceSize", "destStride"),
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600840 Param("VkFlags", "flags")]),
841
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600842 Proto("void", "CmdInitAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600843 [Param("VkCmdBuffer", "cmdBuffer"),
844 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600845 Param("uint32_t", "startCounter"),
846 Param("uint32_t", "counterCount"),
847 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800848
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600849 Proto("void", "CmdLoadAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600850 [Param("VkCmdBuffer", "cmdBuffer"),
851 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600852 Param("uint32_t", "startCounter"),
853 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600854 Param("VkBuffer", "srcBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600855 Param("VkDeviceSize", "srcOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800856
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600857 Proto("void", "CmdSaveAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600858 [Param("VkCmdBuffer", "cmdBuffer"),
859 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600860 Param("uint32_t", "startCounter"),
861 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600862 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600863 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800864
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600865 Proto("VkResult", "CreateFramebuffer",
866 [Param("VkDevice", "device"),
867 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
868 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700869
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600870 Proto("VkResult", "CreateRenderPass",
871 [Param("VkDevice", "device"),
872 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
873 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700874
Jon Ashburne13f1982015-02-02 09:58:11 -0700875 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600876 [Param("VkCmdBuffer", "cmdBuffer"),
877 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700878
879 Proto("void", "CmdEndRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600880 [Param("VkCmdBuffer", "cmdBuffer"),
881 Param("VkRenderPass", "renderPass")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700882
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600883 Proto("VkResult", "DbgSetValidationLevel",
884 [Param("VkDevice", "device"),
885 Param("VkValidationLevel", "validationLevel")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800886
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600887 Proto("VkResult", "DbgRegisterMsgCallback",
888 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600889 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600890 Param("void*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800891
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600892 Proto("VkResult", "DbgUnregisterMsgCallback",
893 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600894 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800895
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600896 Proto("VkResult", "DbgSetMessageFilter",
897 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600898 Param("int32_t", "msgCode"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600899 Param("VK_DBG_MSG_FILTER", "filter")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800900
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600901 Proto("VkResult", "DbgSetObjectTag",
902 [Param("VkBaseObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600903 Param("size_t", "tagSize"),
904 Param("const void*", "pTag")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800905
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600906 Proto("VkResult", "DbgSetGlobalOption",
907 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600908 Param("VK_DBG_GLOBAL_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
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600912 Proto("VkResult", "DbgSetDeviceOption",
913 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600914 Param("VK_DBG_DEVICE_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600915 Param("size_t", "dataSize"),
916 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800917
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600918 Proto("void", "CmdDbgMarkerBegin",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600919 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600920 Param("const char*", "pMarker")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800921
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600922 Proto("void", "CmdDbgMarkerEnd",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600923 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800924 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800925)
926
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800927wsi_x11 = Extension(
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600928 name="VK_WSI_X11",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600929 headers=["vkWsiX11Ext.h"],
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800930 objects=[],
Chia-I Wue442dc32015-01-01 09:31:15 +0800931 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600932 Proto("VkResult", "WsiX11AssociateConnection",
Tony Barbourd1c35722015-04-16 15:59:00 -0600933 [Param("VkPhysicalDevice", "gpu"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600934 Param("const VK_WSI_X11_CONNECTION_INFO*", "pConnectionInfo")]),
Chia-I Wu6bdf0192014-09-13 13:36:06 +0800935
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600936 Proto("VkResult", "WsiX11GetMSC",
937 [Param("VkDevice", "device"),
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800938 Param("xcb_window_t", "window"),
939 Param("xcb_randr_crtc_t", "crtc"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600940 Param("uint64_t*", "pMsc")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800941
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600942 Proto("VkResult", "WsiX11CreatePresentableImage",
943 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600944 Param("const VK_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600945 Param("VkImage*", "pImage"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600946 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800947
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600948 Proto("VkResult", "WsiX11QueuePresent",
949 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600950 Param("const VK_WSI_X11_PRESENT_INFO*", "pPresentInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600951 Param("VkFence", "fence")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800952 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800953)
954
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800955extensions = [core, wsi_x11]
956
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700957object_root_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600958 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -0600959 "VkPhysicalDevice",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600960 "VkBaseObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700961]
962
963object_base_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600964 "VkDevice",
965 "VkQueue",
Tony Barbourd1c35722015-04-16 15:59:00 -0600966 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600967 "VkObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700968]
969
970object_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600971 "VkBuffer",
972 "VkBufferView",
973 "VkImage",
974 "VkImageView",
975 "VkColorAttachmentView",
976 "VkDepthStencilView",
977 "VkShader",
978 "VkPipeline",
979 "VkSampler",
980 "VkDescriptorSet",
981 "VkDescriptorSetLayout",
982 "VkDescriptorSetLayoutChain",
983 "VkDescriptorPool",
984 "VkDynamicStateObject",
985 "VkCmdBuffer",
986 "VkFence",
987 "VkSemaphore",
988 "VkEvent",
989 "VkQueryPool",
990 "VkFramebuffer",
991 "VkRenderPass"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700992]
993
994object_dynamic_state_list = [
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600995 "VkDynamicVpState",
996 "VkDynamicRsState",
997 "VkDynamicCbState",
998 "VkDynamicDsState"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700999]
1000
1001object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
1002
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001003object_parent_list = ["VkBaseObject", "VkObject", "VkDynamicStateObject"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001004
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001005headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001006objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001007protos = []
1008for ext in extensions:
1009 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001010 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001011 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001012
Chia-I Wu9a4ceb12015-01-01 14:45:58 +08001013proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +08001014
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001015def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +08001016 # read object and protoype typedefs
1017 object_lines = []
1018 proto_lines = []
1019 with open(filename, "r") as fp:
1020 for line in fp:
1021 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001022 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +08001023 begin = line.find("(") + 1
1024 end = line.find(",")
1025 # extract the object type
1026 object_lines.append(line[begin:end])
1027 if line.startswith("typedef") and line.endswith(");"):
1028 # drop leading "typedef " and trailing ");"
1029 proto_lines.append(line[8:-2])
1030
1031 # parse proto_lines to protos
1032 protos = []
1033 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001034 first, rest = line.split(" (VKAPI *PFN_vk")
1035 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001036
1037 # get the return type, no space before "*"
1038 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1039
1040 # get the name
1041 proto_name = second.strip()
1042
1043 # get the list of params
1044 param_strs = third.split(", ")
1045 params = []
1046 for s in param_strs:
1047 ty, name = s.rsplit(" ", 1)
1048
1049 # no space before "*"
1050 ty = "*".join([t.rstrip() for t in ty.split("*")])
1051 # attach [] to ty
1052 idx = name.rfind("[")
1053 if idx >= 0:
1054 ty += name[idx:]
1055 name = name[:idx]
1056
1057 params.append(Param(ty, name))
1058
1059 protos.append(Proto(proto_ret, proto_name, params))
1060
1061 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001062 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001063 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001064 objects=object_lines,
1065 protos=protos)
1066 print("core =", str(ext))
1067
1068 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001069 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001070 print("{")
1071 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001072 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001073 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001074
1075if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001076 parse_vk_h("include/vulkan.h")