blob: 18b6793994d2e4e0473b7ed030736efad6c42b98 [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"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600314 Param("VkFlags", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600315 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800316
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600317 Proto("VkResult", "UnmapMemory",
Tony Barbourd1c35722015-04-16 15:59:00 -0600318 [Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800319
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600320 Proto("VkResult", "PinSystemMemory",
321 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600322 Param("const void*", "pSysMem"),
323 Param("size_t", "memSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600324 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800325
Tony Barbourd1c35722015-04-16 15:59:00 -0600326 Proto("VkResult", "GetMultiDeviceCompatibility",
327 [Param("VkPhysicalDevice", "gpu0"),
328 Param("VkPhysicalDevice", "gpu1"),
329 Param("VkPhysicalDeviceCompatibilityInfo*", "pInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800330
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600331 Proto("VkResult", "OpenSharedMemory",
332 [Param("VkDevice", "device"),
333 Param("const VkMemoryOpenInfo*", "pOpenInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600334 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800335
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600336 Proto("VkResult", "OpenSharedSemaphore",
337 [Param("VkDevice", "device"),
338 Param("const VkSemaphoreOpenInfo*", "pOpenInfo"),
339 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800340
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600341 Proto("VkResult", "OpenPeerMemory",
342 [Param("VkDevice", "device"),
343 Param("const VkPeerMemoryOpenInfo*", "pOpenInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600344 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800345
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600346 Proto("VkResult", "OpenPeerImage",
347 [Param("VkDevice", "device"),
348 Param("const VkPeerImageOpenInfo*", "pOpenInfo"),
349 Param("VkImage*", "pImage"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600350 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800351
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600352 Proto("VkResult", "DestroyObject",
353 [Param("VkObject", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800354
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600355 Proto("VkResult", "GetObjectInfo",
356 [Param("VkBaseObject", "object"),
357 Param("VkObjectInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600358 Param("size_t*", "pDataSize"),
359 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800360
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500361 Proto("VkResult", "QueueBindObjectMemory",
362 [Param("VkQueue", "queue"),
363 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600364 Param("uint32_t", "allocationIdx"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600365 Param("VkDeviceMemory", "mem"),
366 Param("VkDeviceSize", "offset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800367
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500368 Proto("VkResult", "QueueBindObjectMemoryRange",
369 [Param("VkQueue", "queue"),
370 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600371 Param("uint32_t", "allocationIdx"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600372 Param("VkDeviceSize", "rangeOffset"),
373 Param("VkDeviceSize", "rangeSize"),
374 Param("VkDeviceMemory", "mem"),
375 Param("VkDeviceSize", "memOffset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800376
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500377 Proto("VkResult", "QueueBindImageMemoryRange",
378 [Param("VkQueue", "queue"),
379 Param("VkImage", "image"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600380 Param("uint32_t", "allocationIdx"),
Jeremy Hayesaf0d72c2015-04-15 15:20:03 -0600381 Param("const VkImageMemoryBindInfo*", "pBindInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600382 Param("VkDeviceMemory", "mem"),
383 Param("VkDeviceSize", "memOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800384
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600385 Proto("VkResult", "CreateFence",
386 [Param("VkDevice", "device"),
387 Param("const VkFenceCreateInfo*", "pCreateInfo"),
388 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800389
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600390 Proto("VkResult", "ResetFences",
391 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500392 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600393 Param("VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500394
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600395 Proto("VkResult", "GetFenceStatus",
396 [Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800397
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600398 Proto("VkResult", "WaitForFences",
399 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600400 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600401 Param("const VkFence*", "pFences"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600402 Param("bool32_t", "waitAll"),
403 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800404
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600405 Proto("VkResult", "CreateSemaphore",
406 [Param("VkDevice", "device"),
407 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
408 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800409
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600410 Proto("VkResult", "QueueSignalSemaphore",
411 [Param("VkQueue", "queue"),
412 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800413
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600414 Proto("VkResult", "QueueWaitSemaphore",
415 [Param("VkQueue", "queue"),
416 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800417
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600418 Proto("VkResult", "CreateEvent",
419 [Param("VkDevice", "device"),
420 Param("const VkEventCreateInfo*", "pCreateInfo"),
421 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800422
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600423 Proto("VkResult", "GetEventStatus",
424 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800425
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600426 Proto("VkResult", "SetEvent",
427 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800428
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600429 Proto("VkResult", "ResetEvent",
430 [Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800431
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600432 Proto("VkResult", "CreateQueryPool",
433 [Param("VkDevice", "device"),
434 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
435 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800436
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600437 Proto("VkResult", "GetQueryPoolResults",
438 [Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600439 Param("uint32_t", "startQuery"),
440 Param("uint32_t", "queryCount"),
441 Param("size_t*", "pDataSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600442 Param("void*", "pData"),
443 Param("VkQueryResultFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800444
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600445 Proto("VkResult", "GetFormatInfo",
446 [Param("VkDevice", "device"),
447 Param("VkFormat", "format"),
448 Param("VkFormatInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600449 Param("size_t*", "pDataSize"),
450 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800451
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600452 Proto("VkResult", "CreateBuffer",
453 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600454 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600455 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800456
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600457 Proto("VkResult", "CreateBufferView",
458 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600459 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600460 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800461
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600462 Proto("VkResult", "CreateImage",
463 [Param("VkDevice", "device"),
464 Param("const VkImageCreateInfo*", "pCreateInfo"),
465 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800466
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600467 Proto("VkResult", "GetImageSubresourceInfo",
468 [Param("VkImage", "image"),
469 Param("const VkImageSubresource*", "pSubresource"),
470 Param("VkSubresourceInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600471 Param("size_t*", "pDataSize"),
472 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800473
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600474 Proto("VkResult", "CreateImageView",
475 [Param("VkDevice", "device"),
476 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
477 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800478
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600479 Proto("VkResult", "CreateColorAttachmentView",
480 [Param("VkDevice", "device"),
481 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
482 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800483
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600484 Proto("VkResult", "CreateDepthStencilView",
485 [Param("VkDevice", "device"),
486 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
487 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800488
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600489 Proto("VkResult", "CreateShader",
490 [Param("VkDevice", "device"),
491 Param("const VkShaderCreateInfo*", "pCreateInfo"),
492 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800493
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600494 Proto("VkResult", "CreateGraphicsPipeline",
495 [Param("VkDevice", "device"),
496 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
497 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800498
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600499 Proto("VkResult", "CreateGraphicsPipelineDerivative",
500 [Param("VkDevice", "device"),
501 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
502 Param("VkPipeline", "basePipeline"),
503 Param("VkPipeline*", "pPipeline")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600504
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600505 Proto("VkResult", "CreateComputePipeline",
506 [Param("VkDevice", "device"),
507 Param("const VkComputePipelineCreateInfo*", "pCreateInfo"),
508 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800509
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600510 Proto("VkResult", "StorePipeline",
511 [Param("VkPipeline", "pipeline"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600512 Param("size_t*", "pDataSize"),
513 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800514
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600515 Proto("VkResult", "LoadPipeline",
516 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600517 Param("size_t", "dataSize"),
518 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600519 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800520
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600521 Proto("VkResult", "LoadPipelineDerivative",
522 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600523 Param("size_t", "dataSize"),
524 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600525 Param("VkPipeline", "basePipeline"),
526 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800527
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600528 Proto("VkResult", "CreateSampler",
529 [Param("VkDevice", "device"),
530 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
531 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800532
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600533 Proto("VkResult", "CreateDescriptorSetLayout",
534 [Param("VkDevice", "device"),
535 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
536 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800537
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600538 Proto("VkResult", "CreateDescriptorSetLayoutChain",
539 [Param("VkDevice", "device"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800540 Param("uint32_t", "setLayoutArrayCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600541 Param("const VkDescriptorSetLayout*", "pSetLayoutArray"),
542 Param("VkDescriptorSetLayoutChain*", "pLayoutChain")]),
Chia-I Wu41126e52015-03-26 15:27:55 +0800543
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600544 Proto("VkResult", "BeginDescriptorPoolUpdate",
545 [Param("VkDevice", "device"),
546 Param("VkDescriptorUpdateMode", "updateMode")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800547
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600548 Proto("VkResult", "EndDescriptorPoolUpdate",
549 [Param("VkDevice", "device"),
550 Param("VkCmdBuffer", "cmd")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800551
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600552 Proto("VkResult", "CreateDescriptorPool",
553 [Param("VkDevice", "device"),
554 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600555 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600556 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
557 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800558
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600559 Proto("VkResult", "ResetDescriptorPool",
560 [Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800561
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600562 Proto("VkResult", "AllocDescriptorSets",
563 [Param("VkDescriptorPool", "descriptorPool"),
564 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600565 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600566 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
567 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600568 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800569
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600570 Proto("void", "ClearDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600571 [Param("VkDescriptorPool", "descriptorPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600572 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600573 Param("const VkDescriptorSet*", "pDescriptorSets")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800574
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600575 Proto("void", "UpdateDescriptors",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600576 [Param("VkDescriptorSet", "descriptorSet"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800577 Param("uint32_t", "updateCount"),
578 Param("const void**", "ppUpdateArray")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800579
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600580 Proto("VkResult", "CreateDynamicViewportState",
581 [Param("VkDevice", "device"),
582 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600583 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800584
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600585 Proto("VkResult", "CreateDynamicRasterState",
586 [Param("VkDevice", "device"),
587 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600588 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800589
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600590 Proto("VkResult", "CreateDynamicColorBlendState",
591 [Param("VkDevice", "device"),
592 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600593 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800594
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600595 Proto("VkResult", "CreateDynamicDepthStencilState",
596 [Param("VkDevice", "device"),
597 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600598 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800599
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600600 Proto("VkResult", "CreateCommandBuffer",
601 [Param("VkDevice", "device"),
602 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
603 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800604
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600605 Proto("VkResult", "BeginCommandBuffer",
606 [Param("VkCmdBuffer", "cmdBuffer"),
607 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800608
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600609 Proto("VkResult", "EndCommandBuffer",
610 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800611
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600612 Proto("VkResult", "ResetCommandBuffer",
613 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800614
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600615 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600616 [Param("VkCmdBuffer", "cmdBuffer"),
617 Param("VkPipelineBindPoint", "pipelineBindPoint"),
618 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800619
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600620 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600621 [Param("VkCmdBuffer", "cmdBuffer"),
622 Param("VkStateBindPoint", "stateBindPoint"),
623 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800624
Chia-I Wu53f07d72015-03-28 15:23:55 +0800625 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600626 [Param("VkCmdBuffer", "cmdBuffer"),
627 Param("VkPipelineBindPoint", "pipelineBindPoint"),
628 Param("VkDescriptorSetLayoutChain", "layoutChain"),
Chia-I Wu53f07d72015-03-28 15:23:55 +0800629 Param("uint32_t", "layoutChainSlot"),
630 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600631 Param("const VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600632 Param("const uint32_t*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800633
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600634 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600635 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600636 Param("uint32_t", "startBinding"),
637 Param("uint32_t", "bindingCount"),
638 Param("const VkBuffer*", "pBuffers"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600639 Param("const VkDeviceSize*", "pOffsets")]),
640
Chia-I Wu7a42e122014-11-08 10:48:20 +0800641
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600642 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600643 [Param("VkCmdBuffer", "cmdBuffer"),
644 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600645 Param("VkDeviceSize", "offset"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600646 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800647
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600648 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600649 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600650 Param("uint32_t", "firstVertex"),
651 Param("uint32_t", "vertexCount"),
652 Param("uint32_t", "firstInstance"),
653 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800654
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600655 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600656 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600657 Param("uint32_t", "firstIndex"),
658 Param("uint32_t", "indexCount"),
659 Param("int32_t", "vertexOffset"),
660 Param("uint32_t", "firstInstance"),
661 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800662
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600663 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600664 [Param("VkCmdBuffer", "cmdBuffer"),
665 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600666 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600667 Param("uint32_t", "count"),
668 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800669
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600670 Proto("void", "CmdDrawIndexedIndirect",
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", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600678 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600679 Param("uint32_t", "x"),
680 Param("uint32_t", "y"),
681 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800682
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600683 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600684 [Param("VkCmdBuffer", "cmdBuffer"),
685 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600686 Param("VkDeviceSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800687
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600688 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600689 [Param("VkCmdBuffer", "cmdBuffer"),
690 Param("VkBuffer", "srcBuffer"),
691 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600692 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600693 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800694
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600695 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600696 [Param("VkCmdBuffer", "cmdBuffer"),
697 Param("VkImage", "srcImage"),
698 Param("VkImageLayout", "srcImageLayout"),
699 Param("VkImage", "destImage"),
700 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600701 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600702 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800703
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600704 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600705 [Param("VkCmdBuffer", "cmdBuffer"),
706 Param("VkImage", "srcImage"),
707 Param("VkImageLayout", "srcImageLayout"),
708 Param("VkImage", "destImage"),
709 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600710 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600711 Param("const VkImageBlit*", "pRegions")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600712
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600713 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600714 [Param("VkCmdBuffer", "cmdBuffer"),
715 Param("VkBuffer", "srcBuffer"),
716 Param("VkImage", "destImage"),
717 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600718 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600719 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800720
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600721 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600722 [Param("VkCmdBuffer", "cmdBuffer"),
723 Param("VkImage", "srcImage"),
724 Param("VkImageLayout", "srcImageLayout"),
725 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600726 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600727 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800728
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600729 Proto("void", "CmdCloneImageData",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600730 [Param("VkCmdBuffer", "cmdBuffer"),
731 Param("VkImage", "srcImage"),
732 Param("VkImageLayout", "srcImageLayout"),
733 Param("VkImage", "destImage"),
734 Param("VkImageLayout", "destImageLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800735
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600736 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600737 [Param("VkCmdBuffer", "cmdBuffer"),
738 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600739 Param("VkDeviceSize", "destOffset"),
740 Param("VkDeviceSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600741 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800742
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600743 Proto("void", "CmdFillBuffer",
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", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600748 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800749
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600750 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600751 [Param("VkCmdBuffer", "cmdBuffer"),
752 Param("VkImage", "image"),
753 Param("VkImageLayout", "imageLayout"),
754 Param("VkClearColor", "color"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600755 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600756 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800757
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600758 Proto("void", "CmdClearDepthStencil",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600759 [Param("VkCmdBuffer", "cmdBuffer"),
760 Param("VkImage", "image"),
761 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600762 Param("float", "depth"),
763 Param("uint32_t", "stencil"),
764 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600765 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800766
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600767 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600768 [Param("VkCmdBuffer", "cmdBuffer"),
769 Param("VkImage", "srcImage"),
770 Param("VkImageLayout", "srcImageLayout"),
771 Param("VkImage", "destImage"),
772 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600773 Param("uint32_t", "regionCount"),
774 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800775
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600776 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600777 [Param("VkCmdBuffer", "cmdBuffer"),
778 Param("VkEvent", "event"),
779 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800780
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600781 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600782 [Param("VkCmdBuffer", "cmdBuffer"),
783 Param("VkEvent", "event"),
784 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800785
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600786 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600787 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600788 Param("VkWaitEvent", "waitEvent"),
789 Param("uint32_t", "eventCount"),
790 Param("const VkEvent*", "pEvents"),
791 Param("uint32_t", "memBarrierCount"),
792 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000793
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600794 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600795 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600796 Param("VkWaitEvent", "waitEvent"),
797 Param("uint32_t", "pipeEventCount"),
798 Param("const VkPipeEvent*", "pPipeEvents"),
799 Param("uint32_t", "memBarrierCount"),
800 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000801
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600802 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600803 [Param("VkCmdBuffer", "cmdBuffer"),
804 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600805 Param("uint32_t", "slot"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600806 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800807
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600808 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600809 [Param("VkCmdBuffer", "cmdBuffer"),
810 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600811 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800812
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600813 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600814 [Param("VkCmdBuffer", "cmdBuffer"),
815 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600816 Param("uint32_t", "startQuery"),
817 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800818
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600819 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600820 [Param("VkCmdBuffer", "cmdBuffer"),
821 Param("VkTimestampType", "timestampType"),
822 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600823 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800824
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600825 Proto("void", "CmdCopyQueryPoolResults",
826 [Param("VkCmdBuffer", "cmdBuffer"),
827 Param("VkQueryPool", "queryPool"),
828 Param("uint32_t", "startQuery"),
829 Param("uint32_t", "queryCount"),
830 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600831 Param("VkDeviceSize", "destOffset"),
832 Param("VkDeviceSize", "destStride"),
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600833 Param("VkFlags", "flags")]),
834
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600835 Proto("void", "CmdInitAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600836 [Param("VkCmdBuffer", "cmdBuffer"),
837 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600838 Param("uint32_t", "startCounter"),
839 Param("uint32_t", "counterCount"),
840 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800841
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600842 Proto("void", "CmdLoadAtomicCounters",
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"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600847 Param("VkBuffer", "srcBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600848 Param("VkDeviceSize", "srcOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800849
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600850 Proto("void", "CmdSaveAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600851 [Param("VkCmdBuffer", "cmdBuffer"),
852 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600853 Param("uint32_t", "startCounter"),
854 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600855 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600856 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800857
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600858 Proto("VkResult", "CreateFramebuffer",
859 [Param("VkDevice", "device"),
860 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
861 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700862
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600863 Proto("VkResult", "CreateRenderPass",
864 [Param("VkDevice", "device"),
865 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
866 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700867
Jon Ashburne13f1982015-02-02 09:58:11 -0700868 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600869 [Param("VkCmdBuffer", "cmdBuffer"),
870 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700871
872 Proto("void", "CmdEndRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600873 [Param("VkCmdBuffer", "cmdBuffer"),
874 Param("VkRenderPass", "renderPass")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700875
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600876 Proto("VkResult", "DbgSetValidationLevel",
877 [Param("VkDevice", "device"),
878 Param("VkValidationLevel", "validationLevel")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800879
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600880 Proto("VkResult", "DbgRegisterMsgCallback",
881 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600882 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600883 Param("void*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800884
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600885 Proto("VkResult", "DbgUnregisterMsgCallback",
886 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600887 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800888
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600889 Proto("VkResult", "DbgSetMessageFilter",
890 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600891 Param("int32_t", "msgCode"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600892 Param("VK_DBG_MSG_FILTER", "filter")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800893
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600894 Proto("VkResult", "DbgSetObjectTag",
895 [Param("VkBaseObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600896 Param("size_t", "tagSize"),
897 Param("const void*", "pTag")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800898
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600899 Proto("VkResult", "DbgSetGlobalOption",
900 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600901 Param("VK_DBG_GLOBAL_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600902 Param("size_t", "dataSize"),
903 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800904
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600905 Proto("VkResult", "DbgSetDeviceOption",
906 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600907 Param("VK_DBG_DEVICE_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600908 Param("size_t", "dataSize"),
909 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800910
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600911 Proto("void", "CmdDbgMarkerBegin",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600912 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600913 Param("const char*", "pMarker")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800914
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600915 Proto("void", "CmdDbgMarkerEnd",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600916 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800917 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800918)
919
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800920wsi_x11 = Extension(
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600921 name="VK_WSI_X11",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600922 headers=["vkWsiX11Ext.h"],
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800923 objects=[],
Chia-I Wue442dc32015-01-01 09:31:15 +0800924 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600925 Proto("VkResult", "WsiX11AssociateConnection",
Tony Barbourd1c35722015-04-16 15:59:00 -0600926 [Param("VkPhysicalDevice", "gpu"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600927 Param("const VK_WSI_X11_CONNECTION_INFO*", "pConnectionInfo")]),
Chia-I Wu6bdf0192014-09-13 13:36:06 +0800928
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600929 Proto("VkResult", "WsiX11GetMSC",
930 [Param("VkDevice", "device"),
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800931 Param("xcb_window_t", "window"),
932 Param("xcb_randr_crtc_t", "crtc"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600933 Param("uint64_t*", "pMsc")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800934
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600935 Proto("VkResult", "WsiX11CreatePresentableImage",
936 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600937 Param("const VK_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600938 Param("VkImage*", "pImage"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600939 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800940
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600941 Proto("VkResult", "WsiX11QueuePresent",
942 [Param("VkQueue", "queue"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600943 Param("const VK_WSI_X11_PRESENT_INFO*", "pPresentInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600944 Param("VkFence", "fence")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800945 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800946)
947
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800948extensions = [core, wsi_x11]
949
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700950object_root_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600951 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -0600952 "VkPhysicalDevice",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600953 "VkBaseObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700954]
955
956object_base_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600957 "VkDevice",
958 "VkQueue",
Tony Barbourd1c35722015-04-16 15:59:00 -0600959 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600960 "VkObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700961]
962
963object_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600964 "VkBuffer",
965 "VkBufferView",
966 "VkImage",
967 "VkImageView",
968 "VkColorAttachmentView",
969 "VkDepthStencilView",
970 "VkShader",
971 "VkPipeline",
972 "VkSampler",
973 "VkDescriptorSet",
974 "VkDescriptorSetLayout",
975 "VkDescriptorSetLayoutChain",
976 "VkDescriptorPool",
977 "VkDynamicStateObject",
978 "VkCmdBuffer",
979 "VkFence",
980 "VkSemaphore",
981 "VkEvent",
982 "VkQueryPool",
983 "VkFramebuffer",
984 "VkRenderPass"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700985]
986
987object_dynamic_state_list = [
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600988 "VkDynamicVpState",
989 "VkDynamicRsState",
990 "VkDynamicCbState",
991 "VkDynamicDsState"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700992]
993
994object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
995
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600996object_parent_list = ["VkBaseObject", "VkObject", "VkDynamicStateObject"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700997
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800998headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800999objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001000protos = []
1001for ext in extensions:
1002 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001003 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001004 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001005
Chia-I Wu9a4ceb12015-01-01 14:45:58 +08001006proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +08001007
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001008def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +08001009 # read object and protoype typedefs
1010 object_lines = []
1011 proto_lines = []
1012 with open(filename, "r") as fp:
1013 for line in fp:
1014 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001015 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +08001016 begin = line.find("(") + 1
1017 end = line.find(",")
1018 # extract the object type
1019 object_lines.append(line[begin:end])
1020 if line.startswith("typedef") and line.endswith(");"):
1021 # drop leading "typedef " and trailing ");"
1022 proto_lines.append(line[8:-2])
1023
1024 # parse proto_lines to protos
1025 protos = []
1026 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001027 first, rest = line.split(" (VKAPI *PFN_vk")
1028 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001029
1030 # get the return type, no space before "*"
1031 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1032
1033 # get the name
1034 proto_name = second.strip()
1035
1036 # get the list of params
1037 param_strs = third.split(", ")
1038 params = []
1039 for s in param_strs:
1040 ty, name = s.rsplit(" ", 1)
1041
1042 # no space before "*"
1043 ty = "*".join([t.rstrip() for t in ty.split("*")])
1044 # attach [] to ty
1045 idx = name.rfind("[")
1046 if idx >= 0:
1047 ty += name[idx:]
1048 name = name[:idx]
1049
1050 params.append(Param(ty, name))
1051
1052 protos.append(Proto(proto_ret, proto_name, params))
1053
1054 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001055 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001056 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001057 objects=object_lines,
1058 protos=protos)
1059 print("core =", str(ext))
1060
1061 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001062 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001063 print("{")
1064 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001065 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001066 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001067
1068if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001069 parse_vk_h("include/vulkan.h")