blob: e2a6905e814404c66a482605afea5e57de408017 [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 Lobodzinski942b1722015-05-11 17:21:15 -0500373 Proto("VkResult", "BindObjectMemory",
374 [Param("VkDevice", "device"),
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 Lobodzinski942b1722015-05-11 17:21:15 -0500381 Proto("VkResult", "QueueBindSparseBufferMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500382 [Param("VkQueue", "queue"),
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500383 Param("VkBuffer", "buffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600384 Param("uint32_t", "allocationIdx"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600385 Param("VkDeviceSize", "rangeOffset"),
386 Param("VkDeviceSize", "rangeSize"),
387 Param("VkDeviceMemory", "mem"),
388 Param("VkDeviceSize", "memOffset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800389
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500390 Proto("VkResult", "QueueBindSparseImageMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500391 [Param("VkQueue", "queue"),
392 Param("VkImage", "image"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600393 Param("uint32_t", "allocationIdx"),
Jeremy Hayesaf0d72c2015-04-15 15:20:03 -0600394 Param("const VkImageMemoryBindInfo*", "pBindInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600395 Param("VkDeviceMemory", "mem"),
396 Param("VkDeviceSize", "memOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800397
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600398 Proto("VkResult", "CreateFence",
399 [Param("VkDevice", "device"),
400 Param("const VkFenceCreateInfo*", "pCreateInfo"),
401 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800402
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600403 Proto("VkResult", "ResetFences",
404 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500405 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600406 Param("VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500407
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600408 Proto("VkResult", "GetFenceStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600409 [Param("VkDevice", "device"),
410 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800411
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600412 Proto("VkResult", "WaitForFences",
413 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600414 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600415 Param("const VkFence*", "pFences"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600416 Param("bool32_t", "waitAll"),
417 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800418
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600419 Proto("VkResult", "CreateSemaphore",
420 [Param("VkDevice", "device"),
421 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
422 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800423
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600424 Proto("VkResult", "QueueSignalSemaphore",
425 [Param("VkQueue", "queue"),
426 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800427
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600428 Proto("VkResult", "QueueWaitSemaphore",
429 [Param("VkQueue", "queue"),
430 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800431
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600432 Proto("VkResult", "CreateEvent",
433 [Param("VkDevice", "device"),
434 Param("const VkEventCreateInfo*", "pCreateInfo"),
435 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800436
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600437 Proto("VkResult", "GetEventStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600438 [Param("VkDevice", "device"),
439 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800440
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600441 Proto("VkResult", "SetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600442 [Param("VkDevice", "device"),
443 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800444
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600445 Proto("VkResult", "ResetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600446 [Param("VkDevice", "device"),
447 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800448
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600449 Proto("VkResult", "CreateQueryPool",
450 [Param("VkDevice", "device"),
451 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
452 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800453
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600454 Proto("VkResult", "GetQueryPoolResults",
Mike Stroyanb050c682015-04-17 12:36:38 -0600455 [Param("VkDevice", "device"),
456 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600457 Param("uint32_t", "startQuery"),
458 Param("uint32_t", "queryCount"),
459 Param("size_t*", "pDataSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600460 Param("void*", "pData"),
461 Param("VkQueryResultFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800462
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600463 Proto("VkResult", "GetFormatInfo",
464 [Param("VkDevice", "device"),
465 Param("VkFormat", "format"),
466 Param("VkFormatInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600467 Param("size_t*", "pDataSize"),
468 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800469
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600470 Proto("VkResult", "CreateBuffer",
471 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600472 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600473 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800474
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600475 Proto("VkResult", "CreateBufferView",
476 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600477 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600478 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800479
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600480 Proto("VkResult", "CreateImage",
481 [Param("VkDevice", "device"),
482 Param("const VkImageCreateInfo*", "pCreateInfo"),
483 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800484
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600485 Proto("VkResult", "GetImageSubresourceInfo",
Mike Stroyanb050c682015-04-17 12:36:38 -0600486 [Param("VkDevice", "device"),
487 Param("VkImage", "image"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600488 Param("const VkImageSubresource*", "pSubresource"),
489 Param("VkSubresourceInfoType", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600490 Param("size_t*", "pDataSize"),
491 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800492
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600493 Proto("VkResult", "CreateImageView",
494 [Param("VkDevice", "device"),
495 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
496 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800497
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600498 Proto("VkResult", "CreateColorAttachmentView",
499 [Param("VkDevice", "device"),
500 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
501 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800502
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600503 Proto("VkResult", "CreateDepthStencilView",
504 [Param("VkDevice", "device"),
505 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
506 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800507
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600508 Proto("VkResult", "CreateShader",
509 [Param("VkDevice", "device"),
510 Param("const VkShaderCreateInfo*", "pCreateInfo"),
511 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800512
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600513 Proto("VkResult", "CreateGraphicsPipeline",
514 [Param("VkDevice", "device"),
515 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
516 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800517
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600518 Proto("VkResult", "CreateGraphicsPipelineDerivative",
519 [Param("VkDevice", "device"),
520 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
521 Param("VkPipeline", "basePipeline"),
522 Param("VkPipeline*", "pPipeline")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600523
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600524 Proto("VkResult", "CreateComputePipeline",
525 [Param("VkDevice", "device"),
526 Param("const VkComputePipelineCreateInfo*", "pCreateInfo"),
527 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800528
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600529 Proto("VkResult", "StorePipeline",
Mike Stroyanb050c682015-04-17 12:36:38 -0600530 [Param("VkDevice", "device"),
531 Param("VkPipeline", "pipeline"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600532 Param("size_t*", "pDataSize"),
533 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800534
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600535 Proto("VkResult", "LoadPipeline",
536 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600537 Param("size_t", "dataSize"),
538 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600539 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800540
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600541 Proto("VkResult", "LoadPipelineDerivative",
542 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600543 Param("size_t", "dataSize"),
544 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600545 Param("VkPipeline", "basePipeline"),
546 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800547
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500548 Proto("VkResult", "CreatePipelineLayout",
549 [Param("VkDevice", "device"),
550 Param("const VkPipelineLayoutCreateInfo*", "pCreateInfo"),
551 Param("VkPipelineLayout*", "pPipelineLayout")]),
552
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600553 Proto("VkResult", "CreateSampler",
554 [Param("VkDevice", "device"),
555 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
556 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800557
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600558 Proto("VkResult", "CreateDescriptorSetLayout",
559 [Param("VkDevice", "device"),
560 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
561 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800562
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600563 Proto("VkResult", "BeginDescriptorPoolUpdate",
564 [Param("VkDevice", "device"),
565 Param("VkDescriptorUpdateMode", "updateMode")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800566
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600567 Proto("VkResult", "EndDescriptorPoolUpdate",
568 [Param("VkDevice", "device"),
569 Param("VkCmdBuffer", "cmd")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800570
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600571 Proto("VkResult", "CreateDescriptorPool",
572 [Param("VkDevice", "device"),
573 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600574 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600575 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
576 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800577
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600578 Proto("VkResult", "ResetDescriptorPool",
Mike Stroyanb050c682015-04-17 12:36:38 -0600579 [Param("VkDevice", "device"),
580 Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800581
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600582 Proto("VkResult", "AllocDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600583 [Param("VkDevice", "device"),
584 Param("VkDescriptorPool", "descriptorPool"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600585 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600586 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600587 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
588 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600589 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800590
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600591 Proto("void", "ClearDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600592 [Param("VkDevice", "device"),
593 Param("VkDescriptorPool", "descriptorPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600594 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600595 Param("const VkDescriptorSet*", "pDescriptorSets")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800596
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600597 Proto("void", "UpdateDescriptors",
Mike Stroyanb050c682015-04-17 12:36:38 -0600598 [Param("VkDevice", "device"),
599 Param("VkDescriptorSet", "descriptorSet"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800600 Param("uint32_t", "updateCount"),
601 Param("const void**", "ppUpdateArray")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800602
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600603 Proto("VkResult", "CreateDynamicViewportState",
604 [Param("VkDevice", "device"),
605 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600606 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800607
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600608 Proto("VkResult", "CreateDynamicRasterState",
609 [Param("VkDevice", "device"),
610 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600611 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800612
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600613 Proto("VkResult", "CreateDynamicColorBlendState",
614 [Param("VkDevice", "device"),
615 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600616 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800617
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600618 Proto("VkResult", "CreateDynamicDepthStencilState",
619 [Param("VkDevice", "device"),
620 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600621 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800622
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600623 Proto("VkResult", "CreateCommandBuffer",
624 [Param("VkDevice", "device"),
625 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
626 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800627
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600628 Proto("VkResult", "BeginCommandBuffer",
629 [Param("VkCmdBuffer", "cmdBuffer"),
630 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800631
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600632 Proto("VkResult", "EndCommandBuffer",
633 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800634
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600635 Proto("VkResult", "ResetCommandBuffer",
636 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800637
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600638 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600639 [Param("VkCmdBuffer", "cmdBuffer"),
640 Param("VkPipelineBindPoint", "pipelineBindPoint"),
641 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800642
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600643 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600644 [Param("VkCmdBuffer", "cmdBuffer"),
645 Param("VkStateBindPoint", "stateBindPoint"),
646 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800647
Chia-I Wu53f07d72015-03-28 15:23:55 +0800648 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600649 [Param("VkCmdBuffer", "cmdBuffer"),
650 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600651 Param("uint32_t", "firstSet"),
652 Param("uint32_t", "setCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600653 Param("const VkDescriptorSet*", "pDescriptorSets"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600654 Param("uint32_t", "dynamicOffsetCount"),
655 Param("const uint32_t*", "pDynamicOffsets")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800656
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600657 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600658 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600659 Param("uint32_t", "startBinding"),
660 Param("uint32_t", "bindingCount"),
661 Param("const VkBuffer*", "pBuffers"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600662 Param("const VkDeviceSize*", "pOffsets")]),
663
Chia-I Wu7a42e122014-11-08 10:48:20 +0800664
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600665 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600666 [Param("VkCmdBuffer", "cmdBuffer"),
667 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600668 Param("VkDeviceSize", "offset"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600669 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800670
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600671 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600672 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600673 Param("uint32_t", "firstVertex"),
674 Param("uint32_t", "vertexCount"),
675 Param("uint32_t", "firstInstance"),
676 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800677
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600678 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600679 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600680 Param("uint32_t", "firstIndex"),
681 Param("uint32_t", "indexCount"),
682 Param("int32_t", "vertexOffset"),
683 Param("uint32_t", "firstInstance"),
684 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800685
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600686 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600687 [Param("VkCmdBuffer", "cmdBuffer"),
688 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600689 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600690 Param("uint32_t", "count"),
691 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800692
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600693 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600694 [Param("VkCmdBuffer", "cmdBuffer"),
695 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600696 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600697 Param("uint32_t", "count"),
698 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800699
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600700 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600701 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600702 Param("uint32_t", "x"),
703 Param("uint32_t", "y"),
704 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800705
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600706 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600707 [Param("VkCmdBuffer", "cmdBuffer"),
708 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600709 Param("VkDeviceSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800710
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600711 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600712 [Param("VkCmdBuffer", "cmdBuffer"),
713 Param("VkBuffer", "srcBuffer"),
714 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600715 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600716 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800717
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600718 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600719 [Param("VkCmdBuffer", "cmdBuffer"),
720 Param("VkImage", "srcImage"),
721 Param("VkImageLayout", "srcImageLayout"),
722 Param("VkImage", "destImage"),
723 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600724 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600725 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800726
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600727 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600728 [Param("VkCmdBuffer", "cmdBuffer"),
729 Param("VkImage", "srcImage"),
730 Param("VkImageLayout", "srcImageLayout"),
731 Param("VkImage", "destImage"),
732 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600733 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600734 Param("const VkImageBlit*", "pRegions")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600735
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600736 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600737 [Param("VkCmdBuffer", "cmdBuffer"),
738 Param("VkBuffer", "srcBuffer"),
739 Param("VkImage", "destImage"),
740 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600741 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600742 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800743
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600744 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600745 [Param("VkCmdBuffer", "cmdBuffer"),
746 Param("VkImage", "srcImage"),
747 Param("VkImageLayout", "srcImageLayout"),
748 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600749 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600750 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800751
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600752 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600753 [Param("VkCmdBuffer", "cmdBuffer"),
754 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600755 Param("VkDeviceSize", "destOffset"),
756 Param("VkDeviceSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600757 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800758
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600759 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600760 [Param("VkCmdBuffer", "cmdBuffer"),
761 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600762 Param("VkDeviceSize", "destOffset"),
763 Param("VkDeviceSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600764 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800765
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600766 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600767 [Param("VkCmdBuffer", "cmdBuffer"),
768 Param("VkImage", "image"),
769 Param("VkImageLayout", "imageLayout"),
Courtney Goeltzenleuchterd7a5cff2015-04-23 17:49:22 -0600770 Param("const VkClearColor*", "pColor"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600771 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600772 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800773
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600774 Proto("void", "CmdClearDepthStencil",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600775 [Param("VkCmdBuffer", "cmdBuffer"),
776 Param("VkImage", "image"),
777 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600778 Param("float", "depth"),
779 Param("uint32_t", "stencil"),
780 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600781 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800782
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600783 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600784 [Param("VkCmdBuffer", "cmdBuffer"),
785 Param("VkImage", "srcImage"),
786 Param("VkImageLayout", "srcImageLayout"),
787 Param("VkImage", "destImage"),
788 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600789 Param("uint32_t", "regionCount"),
790 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800791
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600792 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600793 [Param("VkCmdBuffer", "cmdBuffer"),
794 Param("VkEvent", "event"),
795 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800796
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600797 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600798 [Param("VkCmdBuffer", "cmdBuffer"),
799 Param("VkEvent", "event"),
800 Param("VkPipeEvent", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800801
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600802 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600803 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600804 Param("VkWaitEvent", "waitEvent"),
805 Param("uint32_t", "eventCount"),
806 Param("const VkEvent*", "pEvents"),
807 Param("uint32_t", "memBarrierCount"),
808 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000809
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600810 Proto("void", "CmdPipelineBarrier",
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", "pipeEventCount"),
814 Param("const VkPipeEvent*", "pPipeEvents"),
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", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600819 [Param("VkCmdBuffer", "cmdBuffer"),
820 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600821 Param("uint32_t", "slot"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600822 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800823
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600824 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600825 [Param("VkCmdBuffer", "cmdBuffer"),
826 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600827 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800828
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600829 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600830 [Param("VkCmdBuffer", "cmdBuffer"),
831 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600832 Param("uint32_t", "startQuery"),
833 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800834
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600835 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600836 [Param("VkCmdBuffer", "cmdBuffer"),
837 Param("VkTimestampType", "timestampType"),
838 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600839 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800840
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600841 Proto("void", "CmdCopyQueryPoolResults",
842 [Param("VkCmdBuffer", "cmdBuffer"),
843 Param("VkQueryPool", "queryPool"),
844 Param("uint32_t", "startQuery"),
845 Param("uint32_t", "queryCount"),
846 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600847 Param("VkDeviceSize", "destOffset"),
848 Param("VkDeviceSize", "destStride"),
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600849 Param("VkFlags", "flags")]),
850
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600851 Proto("void", "CmdInitAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600852 [Param("VkCmdBuffer", "cmdBuffer"),
853 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600854 Param("uint32_t", "startCounter"),
855 Param("uint32_t", "counterCount"),
856 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800857
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600858 Proto("void", "CmdLoadAtomicCounters",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600859 [Param("VkCmdBuffer", "cmdBuffer"),
860 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600861 Param("uint32_t", "startCounter"),
862 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600863 Param("VkBuffer", "srcBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600864 Param("VkDeviceSize", "srcOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800865
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600866 Proto("void", "CmdSaveAtomicCounters",
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", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600872 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800873
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600874 Proto("VkResult", "CreateFramebuffer",
875 [Param("VkDevice", "device"),
876 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
877 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700878
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600879 Proto("VkResult", "CreateRenderPass",
880 [Param("VkDevice", "device"),
881 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
882 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700883
Jon Ashburne13f1982015-02-02 09:58:11 -0700884 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600885 [Param("VkCmdBuffer", "cmdBuffer"),
886 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700887
888 Proto("void", "CmdEndRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600889 [Param("VkCmdBuffer", "cmdBuffer"),
890 Param("VkRenderPass", "renderPass")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700891
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600892 Proto("VkResult", "DbgSetValidationLevel",
893 [Param("VkDevice", "device"),
894 Param("VkValidationLevel", "validationLevel")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800895
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600896 Proto("VkResult", "DbgRegisterMsgCallback",
897 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600898 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600899 Param("void*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800900
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600901 Proto("VkResult", "DbgUnregisterMsgCallback",
902 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600903 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800904
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600905 Proto("VkResult", "DbgSetMessageFilter",
906 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600907 Param("int32_t", "msgCode"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600908 Param("VK_DBG_MSG_FILTER", "filter")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800909
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600910 Proto("VkResult", "DbgSetObjectTag",
Mike Stroyanb050c682015-04-17 12:36:38 -0600911 [Param("VkDevice", "device"),
912 Param("VkObject", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600913 Param("size_t", "tagSize"),
914 Param("const void*", "pTag")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800915
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600916 Proto("VkResult", "DbgSetGlobalOption",
917 [Param("VkInstance", "instance"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600918 Param("VK_DBG_GLOBAL_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600919 Param("size_t", "dataSize"),
920 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800921
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600922 Proto("VkResult", "DbgSetDeviceOption",
923 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600924 Param("VK_DBG_DEVICE_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600925 Param("size_t", "dataSize"),
926 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800927
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600928 Proto("void", "CmdDbgMarkerBegin",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600929 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600930 Param("const char*", "pMarker")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800931
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600932 Proto("void", "CmdDbgMarkerEnd",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600933 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800934 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800935)
936
Chia-I Wuf8693382015-04-16 22:02:10 +0800937wsi_lunarg = Extension(
938 name="VK_WSI_LunarG",
939 headers=["vk_wsi_lunarg.h"],
940 objects=[
941 "VkDisplayWSI",
942 "VkSwapChainWSI",
943 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800944 protos=[
Chia-I Wuf8693382015-04-16 22:02:10 +0800945 Proto("VkResult", "GetDisplayInfoWSI",
946 [Param("VkDisplayWSI", "display"),
947 Param("VkDisplayInfoTypeWSI", "infoType"),
948 Param("size_t*", "pDataSize"),
949 Param("void*", "pData")]),
Chia-I Wu6bdf0192014-09-13 13:36:06 +0800950
Chia-I Wuf8693382015-04-16 22:02:10 +0800951 Proto("VkResult", "CreateSwapChainWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600952 [Param("VkDevice", "device"),
Chia-I Wuf8693382015-04-16 22:02:10 +0800953 Param("const VkSwapChainCreateInfoWSI*", "pCreateInfo"),
954 Param("VkSwapChainWSI*", "pSwapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800955
Chia-I Wuf8693382015-04-16 22:02:10 +0800956 Proto("VkResult", "DestroySwapChainWSI",
957 [Param("VkSwapChainWSI", "swapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800958
Chia-I Wuf8693382015-04-16 22:02:10 +0800959 Proto("VkResult", "GetSwapChainInfoWSI",
960 [Param("VkSwapChainWSI", "swapChain"),
961 Param("VkSwapChainInfoTypeWSI", "infoType"),
962 Param("size_t*", "pDataSize"),
963 Param("void*", "pData")]),
964
965 Proto("VkResult", "QueuePresentWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600966 [Param("VkQueue", "queue"),
Chia-I Wuf8693382015-04-16 22:02:10 +0800967 Param("const VkPresentInfoWSI*", "pPresentInfo")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800968 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800969)
970
Chia-I Wuf8693382015-04-16 22:02:10 +0800971extensions = [core, wsi_lunarg]
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800972
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700973object_root_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600974 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -0600975 "VkPhysicalDevice",
Chia-I Wuf8693382015-04-16 22:02:10 +0800976 "VkDisplayWSI",
977 "VkSwapChainWSI",
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700978]
979
980object_base_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600981 "VkDevice",
982 "VkQueue",
Tony Barbourd1c35722015-04-16 15:59:00 -0600983 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600984 "VkObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700985]
986
987object_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600988 "VkBuffer",
989 "VkBufferView",
990 "VkImage",
991 "VkImageView",
992 "VkColorAttachmentView",
993 "VkDepthStencilView",
994 "VkShader",
995 "VkPipeline",
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500996 "VkPipelineLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600997 "VkSampler",
998 "VkDescriptorSet",
999 "VkDescriptorSetLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001000 "VkDescriptorPool",
1001 "VkDynamicStateObject",
1002 "VkCmdBuffer",
1003 "VkFence",
1004 "VkSemaphore",
1005 "VkEvent",
1006 "VkQueryPool",
1007 "VkFramebuffer",
1008 "VkRenderPass"
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001009]
1010
1011object_dynamic_state_list = [
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -06001012 "VkDynamicVpState",
1013 "VkDynamicRsState",
1014 "VkDynamicCbState",
1015 "VkDynamicDsState"
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001016]
1017
1018object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
1019
Mike Stroyanb050c682015-04-17 12:36:38 -06001020object_parent_list = ["VkObject", "VkDynamicStateObject"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001021
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001022headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001023objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001024protos = []
1025for ext in extensions:
1026 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001027 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001028 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001029
Chia-I Wu9a4ceb12015-01-01 14:45:58 +08001030proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +08001031
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001032def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +08001033 # read object and protoype typedefs
1034 object_lines = []
1035 proto_lines = []
1036 with open(filename, "r") as fp:
1037 for line in fp:
1038 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001039 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +08001040 begin = line.find("(") + 1
1041 end = line.find(",")
1042 # extract the object type
1043 object_lines.append(line[begin:end])
1044 if line.startswith("typedef") and line.endswith(");"):
1045 # drop leading "typedef " and trailing ");"
1046 proto_lines.append(line[8:-2])
1047
1048 # parse proto_lines to protos
1049 protos = []
1050 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001051 first, rest = line.split(" (VKAPI *PFN_vk")
1052 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001053
1054 # get the return type, no space before "*"
1055 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1056
1057 # get the name
1058 proto_name = second.strip()
1059
1060 # get the list of params
1061 param_strs = third.split(", ")
1062 params = []
1063 for s in param_strs:
1064 ty, name = s.rsplit(" ", 1)
1065
1066 # no space before "*"
1067 ty = "*".join([t.rstrip() for t in ty.split("*")])
1068 # attach [] to ty
1069 idx = name.rfind("[")
1070 if idx >= 0:
1071 ty += name[idx:]
1072 name = name[:idx]
1073
1074 params.append(Param(ty, name))
1075
1076 protos.append(Proto(proto_ret, proto_name, params))
1077
1078 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001079 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001080 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001081 objects=object_lines,
1082 protos=protos)
1083 print("core =", str(ext))
1084
1085 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001086 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001087 print("{")
1088 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001089 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001090 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001091
1092if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001093 parse_vk_h("include/vulkan.h")