blob: e795da17c558ece8151169aa98c76d6ab1ff85fb [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 "VkDevice",
190 "VkQueue",
Tony Barbourd1c35722015-04-16 15:59:00 -0600191 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600192 "VkObject",
193 "VkBuffer",
194 "VkBufferView",
195 "VkImage",
196 "VkImageView",
197 "VkColorAttachmentView",
198 "VkDepthStencilView",
199 "VkShader",
200 "VkPipeline",
201 "VkSampler",
202 "VkDescriptorSet",
203 "VkDescriptorSetLayout",
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500204 "VkPipelineLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600205 "VkDescriptorPool",
206 "VkDynamicStateObject",
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600207 "VkDynamicVpState",
208 "VkDynamicRsState",
209 "VkDynamicCbState",
210 "VkDynamicDsState",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600211 "VkCmdBuffer",
212 "VkFence",
213 "VkSemaphore",
214 "VkEvent",
215 "VkQueryPool",
216 "VkFramebuffer",
217 "VkRenderPass",
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800218 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800219 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600220 Proto("VkResult", "CreateInstance",
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600221 [Param("const VkInstanceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600222 Param("VkInstance*", "pInstance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700223
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600224 Proto("VkResult", "DestroyInstance",
225 [Param("VkInstance", "instance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700226
Jon Ashburn83a64252015-04-15 11:31:12 -0600227 Proto("VkResult", "EnumeratePhysicalDevices",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600228 [Param("VkInstance", "instance"),
Jon Ashburn83a64252015-04-15 11:31:12 -0600229 Param("uint32_t*", "pPhysicalDeviceCount"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600230 Param("VkPhysicalDevice*", "pPhysicalDevices")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700231
Tony Barbourd1c35722015-04-16 15:59:00 -0600232 Proto("VkResult", "GetPhysicalDeviceInfo",
233 [Param("VkPhysicalDevice", "gpu"),
234 Param("VkPhysicalDeviceInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600235 Param("size_t*", "pDataSize"),
236 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800237
Jon Ashburnb0fbe912015-05-06 10:15:07 -0600238 Proto("void*", "GetInstanceProcAddr",
239 [Param("VkInstance", "instance"),
240 Param("const char*", "pName")]),
241
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600242 Proto("void*", "GetProcAddr",
Tony Barbourd1c35722015-04-16 15:59:00 -0600243 [Param("VkPhysicalDevice", "gpu"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600244 Param("const char*", "pName")]),
Chia-I Wuf2ffc522015-01-04 14:51:06 +0800245
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600246 Proto("VkResult", "CreateDevice",
Tony Barbourd1c35722015-04-16 15:59:00 -0600247 [Param("VkPhysicalDevice", "gpu"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600248 Param("const VkDeviceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600249 Param("VkDevice*", "pDevice")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800250
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600251 Proto("VkResult", "DestroyDevice",
252 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800253
Jon Ashburn9fd4cc42015-04-10 14:33:07 -0600254 Proto("VkResult", "GetGlobalExtensionInfo",
255 [Param("VkExtensionInfoType", "infoType"),
256 Param("uint32_t", "extensionIndex"),
257 Param("size_t*", "pDataSize"),
258 Param("void*", "pData")]),
259
Tobin Ehlis01939012015-04-16 12:51:37 -0600260 Proto("VkResult", "GetPhysicalDeviceExtensionInfo",
Tony Barbourd1c35722015-04-16 15:59:00 -0600261 [Param("VkPhysicalDevice", "gpu"),
Tobin Ehlis01939012015-04-16 12:51:37 -0600262 Param("VkExtensionInfoType", "infoType"),
263 Param("uint32_t", "extensionIndex"),
264 Param("size_t*", "pDataSize"),
265 Param("void*", "pData")]),
266
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600267 Proto("VkResult", "EnumerateLayers",
Tony Barbourd1c35722015-04-16 15:59:00 -0600268 [Param("VkPhysicalDevice", "gpu"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600269 Param("size_t", "maxStringSize"),
Courtney Goeltzenleuchterd9dc0c72015-04-20 11:04:54 -0600270 Param("size_t*", "pLayerCount"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600271 Param("char* const*", "pOutLayers"),
272 Param("void*", "pReserved")]),
Jon Ashburnf7bcf9b2014-10-15 15:30:23 -0600273
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600274 Proto("VkResult", "GetDeviceQueue",
275 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter18248e62015-03-05 18:09:39 -0700276 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600277 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600278 Param("VkQueue*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800279
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600280 Proto("VkResult", "QueueSubmit",
281 [Param("VkQueue", "queue"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600282 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600283 Param("const VkCmdBuffer*", "pCmdBuffers"),
284 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800285
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600286 Proto("VkResult", "QueueWaitIdle",
287 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800288
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600289 Proto("VkResult", "DeviceWaitIdle",
290 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800291
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600292 Proto("VkResult", "AllocMemory",
293 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600294 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600295 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800296
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600297 Proto("VkResult", "FreeMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600298 [Param("VkDevice", "device"),
299 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800300
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600301 Proto("VkResult", "SetMemoryPriority",
Mike Stroyanb050c682015-04-17 12:36:38 -0600302 [Param("VkDevice", "device"),
303 Param("VkDeviceMemory", "mem"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600304 Param("VkMemoryPriority", "priority")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800305
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600306 Proto("VkResult", "MapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600307 [Param("VkDevice", "device"),
308 Param("VkDeviceMemory", "mem"),
Tony Barbour71a85122015-04-16 19:09:28 -0600309 Param("VkDeviceSize", "offset"),
310 Param("VkDeviceSize", "size"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600311 Param("VkFlags", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600312 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800313
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600314 Proto("VkResult", "UnmapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600315 [Param("VkDevice", "device"),
316 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800317
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600318 Proto("VkResult", "FlushMappedMemoryRanges",
Mike Stroyanb050c682015-04-17 12:36:38 -0600319 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600320 Param("uint32_t", "memRangeCount"),
321 Param("const VkMappedMemoryRange*", "pMemRanges")]),
322
323 Proto("VkResult", "InvalidateMappedMemoryRanges",
324 [Param("VkDevice", "device"),
325 Param("uint32_t", "memRangeCount"),
326 Param("const VkMappedMemoryRange*", "pMemRanges")]),
Tony Barbourb1250542015-04-16 19:23:13 -0600327
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600328 Proto("VkResult", "PinSystemMemory",
329 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600330 Param("const void*", "pSysMem"),
331 Param("size_t", "memSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600332 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800333
Tony Barbourd1c35722015-04-16 15:59:00 -0600334 Proto("VkResult", "GetMultiDeviceCompatibility",
335 [Param("VkPhysicalDevice", "gpu0"),
336 Param("VkPhysicalDevice", "gpu1"),
337 Param("VkPhysicalDeviceCompatibilityInfo*", "pInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800338
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600339 Proto("VkResult", "OpenSharedMemory",
340 [Param("VkDevice", "device"),
341 Param("const VkMemoryOpenInfo*", "pOpenInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600342 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800343
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600344 Proto("VkResult", "OpenSharedSemaphore",
345 [Param("VkDevice", "device"),
346 Param("const VkSemaphoreOpenInfo*", "pOpenInfo"),
347 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800348
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600349 Proto("VkResult", "OpenPeerMemory",
350 [Param("VkDevice", "device"),
351 Param("const VkPeerMemoryOpenInfo*", "pOpenInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600352 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800353
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600354 Proto("VkResult", "OpenPeerImage",
355 [Param("VkDevice", "device"),
356 Param("const VkPeerImageOpenInfo*", "pOpenInfo"),
357 Param("VkImage*", "pImage"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600358 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800359
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600360 Proto("VkResult", "DestroyObject",
Mike Stroyanb050c682015-04-17 12:36:38 -0600361 [Param("VkDevice", "device"),
362 Param("VkObjectType", "objType"),
363 Param("VkObject", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800364
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600365 Proto("VkResult", "GetObjectInfo",
Mike Stroyanb050c682015-04-17 12:36:38 -0600366 [Param("VkDevice", "device"),
367 Param("VkObjectType", "objType"),
368 Param("VkObject", "object"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600369 Param("VkObjectInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600370 Param("size_t*", "pDataSize"),
371 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800372
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500373 Proto("VkResult", "QueueBindObjectMemory",
374 [Param("VkQueue", "queue"),
Mike Stroyanb050c682015-04-17 12:36:38 -0600375 Param("VkObjectType", "objType"),
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500376 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600377 Param("uint32_t", "allocationIdx"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600378 Param("VkDeviceMemory", "mem"),
379 Param("VkDeviceSize", "offset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800380
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500381 Proto("VkResult", "QueueBindObjectMemoryRange",
382 [Param("VkQueue", "queue"),
Mike Stroyanb050c682015-04-17 12:36:38 -0600383 Param("VkObjectType", "objType"),
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500384 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600385 Param("uint32_t", "allocationIdx"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600386 Param("VkDeviceSize", "rangeOffset"),
387 Param("VkDeviceSize", "rangeSize"),
388 Param("VkDeviceMemory", "mem"),
389 Param("VkDeviceSize", "memOffset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800390
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500391 Proto("VkResult", "QueueBindImageMemoryRange",
392 [Param("VkQueue", "queue"),
393 Param("VkImage", "image"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600394 Param("uint32_t", "allocationIdx"),
Jeremy Hayesaf0d72c2015-04-15 15:20:03 -0600395 Param("const VkImageMemoryBindInfo*", "pBindInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600396 Param("VkDeviceMemory", "mem"),
397 Param("VkDeviceSize", "memOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800398
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600399 Proto("VkResult", "CreateFence",
400 [Param("VkDevice", "device"),
401 Param("const VkFenceCreateInfo*", "pCreateInfo"),
402 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800403
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600404 Proto("VkResult", "ResetFences",
405 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500406 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600407 Param("VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500408
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600409 Proto("VkResult", "GetFenceStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600410 [Param("VkDevice", "device"),
411 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800412
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600413 Proto("VkResult", "WaitForFences",
414 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600415 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600416 Param("const VkFence*", "pFences"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600417 Param("bool32_t", "waitAll"),
418 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800419
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600420 Proto("VkResult", "CreateSemaphore",
421 [Param("VkDevice", "device"),
422 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
423 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800424
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600425 Proto("VkResult", "QueueSignalSemaphore",
426 [Param("VkQueue", "queue"),
427 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800428
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600429 Proto("VkResult", "QueueWaitSemaphore",
430 [Param("VkQueue", "queue"),
431 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800432
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600433 Proto("VkResult", "CreateEvent",
434 [Param("VkDevice", "device"),
435 Param("const VkEventCreateInfo*", "pCreateInfo"),
436 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800437
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600438 Proto("VkResult", "GetEventStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600439 [Param("VkDevice", "device"),
440 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800441
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600442 Proto("VkResult", "SetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600443 [Param("VkDevice", "device"),
444 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800445
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600446 Proto("VkResult", "ResetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600447 [Param("VkDevice", "device"),
448 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800449
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600450 Proto("VkResult", "CreateQueryPool",
451 [Param("VkDevice", "device"),
452 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
453 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800454
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600455 Proto("VkResult", "GetQueryPoolResults",
Mike Stroyanb050c682015-04-17 12:36:38 -0600456 [Param("VkDevice", "device"),
457 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600458 Param("uint32_t", "startQuery"),
459 Param("uint32_t", "queryCount"),
460 Param("size_t*", "pDataSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600461 Param("void*", "pData"),
462 Param("VkQueryResultFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800463
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600464 Proto("VkResult", "GetFormatInfo",
465 [Param("VkDevice", "device"),
466 Param("VkFormat", "format"),
467 Param("VkFormatInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600468 Param("size_t*", "pDataSize"),
469 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800470
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600471 Proto("VkResult", "CreateBuffer",
472 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600473 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600474 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800475
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600476 Proto("VkResult", "CreateBufferView",
477 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600478 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600479 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800480
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600481 Proto("VkResult", "CreateImage",
482 [Param("VkDevice", "device"),
483 Param("const VkImageCreateInfo*", "pCreateInfo"),
484 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800485
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600486 Proto("VkResult", "GetImageSubresourceInfo",
Mike Stroyanb050c682015-04-17 12:36:38 -0600487 [Param("VkDevice", "device"),
488 Param("VkImage", "image"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600489 Param("const VkImageSubresource*", "pSubresource"),
490 Param("VkSubresourceInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600491 Param("size_t*", "pDataSize"),
492 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800493
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600494 Proto("VkResult", "CreateImageView",
495 [Param("VkDevice", "device"),
496 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
497 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800498
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600499 Proto("VkResult", "CreateColorAttachmentView",
500 [Param("VkDevice", "device"),
501 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
502 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800503
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600504 Proto("VkResult", "CreateDepthStencilView",
505 [Param("VkDevice", "device"),
506 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
507 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800508
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600509 Proto("VkResult", "CreateShader",
510 [Param("VkDevice", "device"),
511 Param("const VkShaderCreateInfo*", "pCreateInfo"),
512 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800513
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600514 Proto("VkResult", "CreateGraphicsPipeline",
515 [Param("VkDevice", "device"),
516 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
517 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800518
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600519 Proto("VkResult", "CreateGraphicsPipelineDerivative",
520 [Param("VkDevice", "device"),
521 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
522 Param("VkPipeline", "basePipeline"),
523 Param("VkPipeline*", "pPipeline")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600524
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600525 Proto("VkResult", "CreateComputePipeline",
526 [Param("VkDevice", "device"),
527 Param("const VkComputePipelineCreateInfo*", "pCreateInfo"),
528 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800529
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600530 Proto("VkResult", "StorePipeline",
Mike Stroyanb050c682015-04-17 12:36:38 -0600531 [Param("VkDevice", "device"),
532 Param("VkPipeline", "pipeline"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600533 Param("size_t*", "pDataSize"),
534 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800535
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600536 Proto("VkResult", "LoadPipeline",
537 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600538 Param("size_t", "dataSize"),
539 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600540 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800541
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600542 Proto("VkResult", "LoadPipelineDerivative",
543 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600544 Param("size_t", "dataSize"),
545 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600546 Param("VkPipeline", "basePipeline"),
547 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800548
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500549 Proto("VkResult", "CreatePipelineLayout",
550 [Param("VkDevice", "device"),
551 Param("const VkPipelineLayoutCreateInfo*", "pCreateInfo"),
552 Param("VkPipelineLayout*", "pPipelineLayout")]),
553
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600554 Proto("VkResult", "CreateSampler",
555 [Param("VkDevice", "device"),
556 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
557 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800558
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600559 Proto("VkResult", "CreateDescriptorSetLayout",
560 [Param("VkDevice", "device"),
561 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
562 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800563
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600564 Proto("VkResult", "BeginDescriptorPoolUpdate",
565 [Param("VkDevice", "device"),
566 Param("VkDescriptorUpdateMode", "updateMode")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800567
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600568 Proto("VkResult", "EndDescriptorPoolUpdate",
569 [Param("VkDevice", "device"),
570 Param("VkCmdBuffer", "cmd")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800571
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600572 Proto("VkResult", "CreateDescriptorPool",
573 [Param("VkDevice", "device"),
574 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600575 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600576 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
577 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800578
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600579 Proto("VkResult", "ResetDescriptorPool",
Mike Stroyanb050c682015-04-17 12:36:38 -0600580 [Param("VkDevice", "device"),
581 Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800582
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600583 Proto("VkResult", "AllocDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600584 [Param("VkDevice", "device"),
585 Param("VkDescriptorPool", "descriptorPool"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600586 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600587 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600588 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
589 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600590 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800591
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600592 Proto("void", "ClearDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600593 [Param("VkDevice", "device"),
594 Param("VkDescriptorPool", "descriptorPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600595 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600596 Param("const VkDescriptorSet*", "pDescriptorSets")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800597
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600598 Proto("void", "UpdateDescriptors",
Mike Stroyanb050c682015-04-17 12:36:38 -0600599 [Param("VkDevice", "device"),
600 Param("VkDescriptorSet", "descriptorSet"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800601 Param("uint32_t", "updateCount"),
602 Param("const void**", "ppUpdateArray")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800603
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600604 Proto("VkResult", "CreateDynamicViewportState",
605 [Param("VkDevice", "device"),
606 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600607 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800608
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600609 Proto("VkResult", "CreateDynamicRasterState",
610 [Param("VkDevice", "device"),
611 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600612 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800613
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600614 Proto("VkResult", "CreateDynamicColorBlendState",
615 [Param("VkDevice", "device"),
616 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600617 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800618
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600619 Proto("VkResult", "CreateDynamicDepthStencilState",
620 [Param("VkDevice", "device"),
621 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600622 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800623
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600624 Proto("VkResult", "CreateCommandBuffer",
625 [Param("VkDevice", "device"),
626 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
627 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800628
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600629 Proto("VkResult", "BeginCommandBuffer",
630 [Param("VkCmdBuffer", "cmdBuffer"),
631 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800632
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600633 Proto("VkResult", "EndCommandBuffer",
634 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800635
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600636 Proto("VkResult", "ResetCommandBuffer",
637 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800638
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600639 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600640 [Param("VkCmdBuffer", "cmdBuffer"),
641 Param("VkPipelineBindPoint", "pipelineBindPoint"),
642 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800643
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600644 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600645 [Param("VkCmdBuffer", "cmdBuffer"),
646 Param("VkStateBindPoint", "stateBindPoint"),
647 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800648
Chia-I Wu53f07d72015-03-28 15:23:55 +0800649 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600650 [Param("VkCmdBuffer", "cmdBuffer"),
651 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600652 Param("uint32_t", "firstSet"),
653 Param("uint32_t", "setCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600654 Param("const VkDescriptorSet*", "pDescriptorSets"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600655 Param("uint32_t", "dynamicOffsetCount"),
656 Param("const uint32_t*", "pDynamicOffsets")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800657
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600658 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600659 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600660 Param("uint32_t", "startBinding"),
661 Param("uint32_t", "bindingCount"),
662 Param("const VkBuffer*", "pBuffers"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600663 Param("const VkDeviceSize*", "pOffsets")]),
664
Chia-I Wu7a42e122014-11-08 10:48:20 +0800665
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600666 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600667 [Param("VkCmdBuffer", "cmdBuffer"),
668 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600669 Param("VkDeviceSize", "offset"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600670 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800671
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600672 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600673 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600674 Param("uint32_t", "firstVertex"),
675 Param("uint32_t", "vertexCount"),
676 Param("uint32_t", "firstInstance"),
677 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800678
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600679 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600680 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600681 Param("uint32_t", "firstIndex"),
682 Param("uint32_t", "indexCount"),
683 Param("int32_t", "vertexOffset"),
684 Param("uint32_t", "firstInstance"),
685 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800686
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600687 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600688 [Param("VkCmdBuffer", "cmdBuffer"),
689 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600690 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600691 Param("uint32_t", "count"),
692 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800693
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600694 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600695 [Param("VkCmdBuffer", "cmdBuffer"),
696 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600697 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600698 Param("uint32_t", "count"),
699 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800700
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600701 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600702 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600703 Param("uint32_t", "x"),
704 Param("uint32_t", "y"),
705 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800706
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600707 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600708 [Param("VkCmdBuffer", "cmdBuffer"),
709 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600710 Param("VkDeviceSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800711
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600712 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600713 [Param("VkCmdBuffer", "cmdBuffer"),
714 Param("VkBuffer", "srcBuffer"),
715 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600716 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600717 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800718
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600719 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600720 [Param("VkCmdBuffer", "cmdBuffer"),
721 Param("VkImage", "srcImage"),
722 Param("VkImageLayout", "srcImageLayout"),
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 VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800727
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600728 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600729 [Param("VkCmdBuffer", "cmdBuffer"),
730 Param("VkImage", "srcImage"),
731 Param("VkImageLayout", "srcImageLayout"),
732 Param("VkImage", "destImage"),
733 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600734 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600735 Param("const VkImageBlit*", "pRegions")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600736
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600737 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600738 [Param("VkCmdBuffer", "cmdBuffer"),
739 Param("VkBuffer", "srcBuffer"),
740 Param("VkImage", "destImage"),
741 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600742 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600743 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800744
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600745 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600746 [Param("VkCmdBuffer", "cmdBuffer"),
747 Param("VkImage", "srcImage"),
748 Param("VkImageLayout", "srcImageLayout"),
749 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600750 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600751 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800752
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600753 Proto("void", "CmdCloneImageData",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600754 [Param("VkCmdBuffer", "cmdBuffer"),
755 Param("VkImage", "srcImage"),
756 Param("VkImageLayout", "srcImageLayout"),
757 Param("VkImage", "destImage"),
758 Param("VkImageLayout", "destImageLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800759
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600760 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600761 [Param("VkCmdBuffer", "cmdBuffer"),
762 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600763 Param("VkDeviceSize", "destOffset"),
764 Param("VkDeviceSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600765 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800766
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600767 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600768 [Param("VkCmdBuffer", "cmdBuffer"),
769 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600770 Param("VkDeviceSize", "destOffset"),
771 Param("VkDeviceSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600772 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800773
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600774 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600775 [Param("VkCmdBuffer", "cmdBuffer"),
776 Param("VkImage", "image"),
777 Param("VkImageLayout", "imageLayout"),
Courtney Goeltzenleuchterd7a5cff2015-04-23 17:49:22 -0600778 Param("const VkClearColor*", "pColor"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600779 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600780 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800781
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600782 Proto("void", "CmdClearDepthStencil",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600783 [Param("VkCmdBuffer", "cmdBuffer"),
784 Param("VkImage", "image"),
785 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600786 Param("float", "depth"),
787 Param("uint32_t", "stencil"),
788 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600789 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800790
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600791 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600792 [Param("VkCmdBuffer", "cmdBuffer"),
793 Param("VkImage", "srcImage"),
794 Param("VkImageLayout", "srcImageLayout"),
795 Param("VkImage", "destImage"),
796 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600797 Param("uint32_t", "regionCount"),
798 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800799
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600800 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600801 [Param("VkCmdBuffer", "cmdBuffer"),
802 Param("VkEvent", "event"),
803 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800804
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600805 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600806 [Param("VkCmdBuffer", "cmdBuffer"),
807 Param("VkEvent", "event"),
808 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800809
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600810 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600811 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600812 Param("VkWaitEvent", "waitEvent"),
813 Param("uint32_t", "eventCount"),
814 Param("const VkEvent*", "pEvents"),
815 Param("uint32_t", "memBarrierCount"),
816 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000817
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600818 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600819 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600820 Param("VkWaitEvent", "waitEvent"),
821 Param("uint32_t", "pipeEventCount"),
822 Param("const VkPipeEvent*", "pPipeEvents"),
823 Param("uint32_t", "memBarrierCount"),
824 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000825
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600826 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600827 [Param("VkCmdBuffer", "cmdBuffer"),
828 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600829 Param("uint32_t", "slot"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600830 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800831
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600832 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600833 [Param("VkCmdBuffer", "cmdBuffer"),
834 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600835 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800836
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600837 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600838 [Param("VkCmdBuffer", "cmdBuffer"),
839 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600840 Param("uint32_t", "startQuery"),
841 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800842
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600843 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600844 [Param("VkCmdBuffer", "cmdBuffer"),
845 Param("VkTimestampType", "timestampType"),
846 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600847 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800848
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600849 Proto("void", "CmdCopyQueryPoolResults",
850 [Param("VkCmdBuffer", "cmdBuffer"),
851 Param("VkQueryPool", "queryPool"),
852 Param("uint32_t", "startQuery"),
853 Param("uint32_t", "queryCount"),
854 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600855 Param("VkDeviceSize", "destOffset"),
856 Param("VkDeviceSize", "destStride"),
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600857 Param("VkFlags", "flags")]),
858
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600859 Proto("void", "CmdInitAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600860 [Param("VkCmdBuffer", "cmdBuffer"),
861 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600862 Param("uint32_t", "startCounter"),
863 Param("uint32_t", "counterCount"),
864 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800865
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600866 Proto("void", "CmdLoadAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600867 [Param("VkCmdBuffer", "cmdBuffer"),
868 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600869 Param("uint32_t", "startCounter"),
870 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600871 Param("VkBuffer", "srcBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600872 Param("VkDeviceSize", "srcOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800873
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600874 Proto("void", "CmdSaveAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600875 [Param("VkCmdBuffer", "cmdBuffer"),
876 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600877 Param("uint32_t", "startCounter"),
878 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600879 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600880 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800881
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600882 Proto("VkResult", "CreateFramebuffer",
883 [Param("VkDevice", "device"),
884 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
885 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700886
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600887 Proto("VkResult", "CreateRenderPass",
888 [Param("VkDevice", "device"),
889 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
890 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700891
Jon Ashburne13f1982015-02-02 09:58:11 -0700892 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600893 [Param("VkCmdBuffer", "cmdBuffer"),
894 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700895
896 Proto("void", "CmdEndRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600897 [Param("VkCmdBuffer", "cmdBuffer"),
898 Param("VkRenderPass", "renderPass")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700899
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600900 Proto("VkResult", "DbgSetValidationLevel",
901 [Param("VkDevice", "device"),
902 Param("VkValidationLevel", "validationLevel")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800903
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600904 Proto("VkResult", "DbgRegisterMsgCallback",
905 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600906 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600907 Param("void*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800908
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600909 Proto("VkResult", "DbgUnregisterMsgCallback",
910 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600911 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800912
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600913 Proto("VkResult", "DbgSetMessageFilter",
914 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600915 Param("int32_t", "msgCode"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600916 Param("VK_DBG_MSG_FILTER", "filter")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800917
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600918 Proto("VkResult", "DbgSetObjectTag",
Mike Stroyanb050c682015-04-17 12:36:38 -0600919 [Param("VkDevice", "device"),
920 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600921 Param("size_t", "tagSize"),
922 Param("const void*", "pTag")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800923
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600924 Proto("VkResult", "DbgSetGlobalOption",
925 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600926 Param("VK_DBG_GLOBAL_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600927 Param("size_t", "dataSize"),
928 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800929
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600930 Proto("VkResult", "DbgSetDeviceOption",
931 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600932 Param("VK_DBG_DEVICE_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600933 Param("size_t", "dataSize"),
934 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800935
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600936 Proto("void", "CmdDbgMarkerBegin",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600937 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600938 Param("const char*", "pMarker")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800939
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600940 Proto("void", "CmdDbgMarkerEnd",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600941 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800942 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800943)
944
Chia-I Wuf8693382015-04-16 22:02:10 +0800945wsi_lunarg = Extension(
946 name="VK_WSI_LunarG",
947 headers=["vk_wsi_lunarg.h"],
948 objects=[
949 "VkDisplayWSI",
950 "VkSwapChainWSI",
951 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800952 protos=[
Chia-I Wuf8693382015-04-16 22:02:10 +0800953 Proto("VkResult", "GetDisplayInfoWSI",
954 [Param("VkDisplayWSI", "display"),
955 Param("VkDisplayInfoTypeWSI", "infoType"),
956 Param("size_t*", "pDataSize"),
957 Param("void*", "pData")]),
Chia-I Wu6bdf0192014-09-13 13:36:06 +0800958
Chia-I Wuf8693382015-04-16 22:02:10 +0800959 Proto("VkResult", "CreateSwapChainWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600960 [Param("VkDevice", "device"),
Chia-I Wuf8693382015-04-16 22:02:10 +0800961 Param("const VkSwapChainCreateInfoWSI*", "pCreateInfo"),
962 Param("VkSwapChainWSI*", "pSwapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800963
Chia-I Wuf8693382015-04-16 22:02:10 +0800964 Proto("VkResult", "DestroySwapChainWSI",
965 [Param("VkSwapChainWSI", "swapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800966
Chia-I Wuf8693382015-04-16 22:02:10 +0800967 Proto("VkResult", "GetSwapChainInfoWSI",
968 [Param("VkSwapChainWSI", "swapChain"),
969 Param("VkSwapChainInfoTypeWSI", "infoType"),
970 Param("size_t*", "pDataSize"),
971 Param("void*", "pData")]),
972
973 Proto("VkResult", "QueuePresentWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600974 [Param("VkQueue", "queue"),
Chia-I Wuf8693382015-04-16 22:02:10 +0800975 Param("const VkPresentInfoWSI*", "pPresentInfo")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800976 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800977)
978
Chia-I Wuf8693382015-04-16 22:02:10 +0800979extensions = [core, wsi_lunarg]
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800980
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700981object_root_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600982 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -0600983 "VkPhysicalDevice",
Chia-I Wuf8693382015-04-16 22:02:10 +0800984 "VkDisplayWSI",
985 "VkSwapChainWSI",
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700986]
987
988object_base_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600989 "VkDevice",
990 "VkQueue",
Tony Barbourd1c35722015-04-16 15:59:00 -0600991 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600992 "VkObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700993]
994
995object_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600996 "VkBuffer",
997 "VkBufferView",
998 "VkImage",
999 "VkImageView",
1000 "VkColorAttachmentView",
1001 "VkDepthStencilView",
1002 "VkShader",
1003 "VkPipeline",
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -05001004 "VkPipelineLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001005 "VkSampler",
1006 "VkDescriptorSet",
1007 "VkDescriptorSetLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001008 "VkDescriptorPool",
1009 "VkDynamicStateObject",
1010 "VkCmdBuffer",
1011 "VkFence",
1012 "VkSemaphore",
1013 "VkEvent",
1014 "VkQueryPool",
1015 "VkFramebuffer",
1016 "VkRenderPass"
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001017]
1018
1019object_dynamic_state_list = [
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -06001020 "VkDynamicVpState",
1021 "VkDynamicRsState",
1022 "VkDynamicCbState",
1023 "VkDynamicDsState"
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001024]
1025
1026object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
1027
Mike Stroyanb050c682015-04-17 12:36:38 -06001028object_parent_list = ["VkObject", "VkDynamicStateObject"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001029
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001030headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001031objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001032protos = []
1033for ext in extensions:
1034 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001035 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001036 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001037
Chia-I Wu9a4ceb12015-01-01 14:45:58 +08001038proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +08001039
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001040def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +08001041 # read object and protoype typedefs
1042 object_lines = []
1043 proto_lines = []
1044 with open(filename, "r") as fp:
1045 for line in fp:
1046 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001047 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +08001048 begin = line.find("(") + 1
1049 end = line.find(",")
1050 # extract the object type
1051 object_lines.append(line[begin:end])
1052 if line.startswith("typedef") and line.endswith(");"):
1053 # drop leading "typedef " and trailing ");"
1054 proto_lines.append(line[8:-2])
1055
1056 # parse proto_lines to protos
1057 protos = []
1058 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001059 first, rest = line.split(" (VKAPI *PFN_vk")
1060 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001061
1062 # get the return type, no space before "*"
1063 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1064
1065 # get the name
1066 proto_name = second.strip()
1067
1068 # get the list of params
1069 param_strs = third.split(", ")
1070 params = []
1071 for s in param_strs:
1072 ty, name = s.rsplit(" ", 1)
1073
1074 # no space before "*"
1075 ty = "*".join([t.rstrip() for t in ty.split("*")])
1076 # attach [] to ty
1077 idx = name.rfind("[")
1078 if idx >= 0:
1079 ty += name[idx:]
1080 name = name[:idx]
1081
1082 params.append(Param(ty, name))
1083
1084 protos.append(Proto(proto_ret, proto_name, params))
1085
1086 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001087 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001088 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001089 objects=object_lines,
1090 protos=protos)
1091 print("core =", str(ext))
1092
1093 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001094 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001095 print("{")
1096 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001097 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001098 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001099
1100if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001101 parse_vk_h("include/vulkan.h")