blob: 01112c794d4d101c8b468302e0b5e044a51e7531 [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 Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600184 headers=["vulkan.h", "vk_debug_report_lunarg.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 Barbour59a47322015-06-24 16:06:58 -0600232 Proto("VkResult", "GetPhysicalDeviceProperties",
Tony Barbourd1c35722015-04-16 15:59:00 -0600233 [Param("VkPhysicalDevice", "gpu"),
Tony Barbour59a47322015-06-24 16:06:58 -0600234 Param("VkPhysicalDeviceProperties*", "pProperties")]),
235
236 Proto("VkResult", "GetPhysicalDevicePerformance",
237 [Param("VkPhysicalDevice", "gpu"),
238 Param("VkPhysicalDevicePerformance*", "pPerformance")]),
239
240 Proto("VkResult", "GetPhysicalDeviceQueueCount",
241 [Param("VkPhysicalDevice", "gpu"),
242 Param("uint32_t*", "pCount")]),
243
244 Proto("VkResult", "GetPhysicalDeviceQueueProperties",
245 [Param("VkPhysicalDevice", "gpu"),
246 Param("uint32_t", "count"),
247 Param("VkPhysicalDeviceQueueProperties*", "pProperties")]),
248
249 Proto("VkResult", "GetPhysicalDeviceMemoryProperties",
250 [Param("VkPhysicalDevice", "gpu"),
251 Param("VkPhysicalDeviceMemoryProperties*", "pProperties")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800252
Chris Forbesbc0bb772015-06-21 22:55:02 +1200253 Proto("VkResult", "GetPhysicalDeviceFeatures",
254 [Param("VkPhysicalDevice", "physicalDevice"),
255 Param("VkPhysicalDeviceFeatures*", "pFeatures")]),
256
257 Proto("VkResult", "GetPhysicalDeviceFormatInfo",
258 [Param("VkPhysicalDevice", "physicalDevice"),
259 Param("VkFormat", "format"),
260 Param("VkFormatProperties*", "pFormatInfo")]),
261
262 Proto("VkResult", "GetPhysicalDeviceLimits",
263 [Param("VkPhysicalDevice", "physicalDevice"),
264 Param("VkPhysicalDeviceLimits*", "pLimits")]),
265
Jon Ashburnb0fbe912015-05-06 10:15:07 -0600266 Proto("void*", "GetInstanceProcAddr",
267 [Param("VkInstance", "instance"),
268 Param("const char*", "pName")]),
269
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600270 Proto("void*", "GetDeviceProcAddr",
271 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600272 Param("const char*", "pName")]),
Chia-I Wuf2ffc522015-01-04 14:51:06 +0800273
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600274 Proto("VkResult", "CreateDevice",
Tony Barbourd1c35722015-04-16 15:59:00 -0600275 [Param("VkPhysicalDevice", "gpu"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600276 Param("const VkDeviceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600277 Param("VkDevice*", "pDevice")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800278
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600279 Proto("VkResult", "DestroyDevice",
280 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800281
Tony Barbour59a47322015-06-24 16:06:58 -0600282 Proto("VkResult", "GetPhysicalDeviceExtensionProperties",
Tony Barbourd1c35722015-04-16 15:59:00 -0600283 [Param("VkPhysicalDevice", "gpu"),
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600284 Param("const char*", "pLayerName"),
285 Param("uint32_t*", "pCount"),
Tony Barbour59a47322015-06-24 16:06:58 -0600286 Param("VkExtensionProperties*", "pProperties")]),
287
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600288 Proto("VkResult", "GetPhysicalDeviceLayerProperties",
Tony Barbour59a47322015-06-24 16:06:58 -0600289 [Param("VkPhysicalDevice", "gpu"),
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600290 Param("const char*", "pLayerName"),
291 Param("uint32_t*", "pCount"),
292 Param("VkLayerProperties*", "pProperties")]),
Tony Barbour59a47322015-06-24 16:06:58 -0600293
294 Proto("VkResult", "GetGlobalExtensionProperties",
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600295 [Param("const char*", "pLayerName"),
296 Param("uint32_t*", "pCount"),
Tony Barbour59a47322015-06-24 16:06:58 -0600297 Param("VkExtensionProperties*", "pProperties")]),
298
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600299 Proto("VkResult", "GetGlobalLayerProperties",
300 [Param("uint32_t*", "pCount"),
301 Param("VkExtensionProperties*", "pProperties")]),
Tobin Ehlis01939012015-04-16 12:51:37 -0600302
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600303 Proto("VkResult", "GetDeviceQueue",
304 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter18248e62015-03-05 18:09:39 -0700305 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600306 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600307 Param("VkQueue*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800308
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600309 Proto("VkResult", "QueueSubmit",
310 [Param("VkQueue", "queue"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600311 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600312 Param("const VkCmdBuffer*", "pCmdBuffers"),
313 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800314
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600315 Proto("VkResult", "QueueWaitIdle",
316 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800317
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600318 Proto("VkResult", "DeviceWaitIdle",
319 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800320
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600321 Proto("VkResult", "AllocMemory",
322 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600323 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600324 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800325
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600326 Proto("VkResult", "FreeMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600327 [Param("VkDevice", "device"),
328 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800329
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600330 Proto("VkResult", "MapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600331 [Param("VkDevice", "device"),
332 Param("VkDeviceMemory", "mem"),
Tony Barbour71a85122015-04-16 19:09:28 -0600333 Param("VkDeviceSize", "offset"),
334 Param("VkDeviceSize", "size"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600335 Param("VkFlags", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600336 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800337
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600338 Proto("VkResult", "UnmapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600339 [Param("VkDevice", "device"),
340 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800341
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600342 Proto("VkResult", "FlushMappedMemoryRanges",
Mike Stroyanb050c682015-04-17 12:36:38 -0600343 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600344 Param("uint32_t", "memRangeCount"),
345 Param("const VkMappedMemoryRange*", "pMemRanges")]),
346
347 Proto("VkResult", "InvalidateMappedMemoryRanges",
348 [Param("VkDevice", "device"),
349 Param("uint32_t", "memRangeCount"),
350 Param("const VkMappedMemoryRange*", "pMemRanges")]),
Tony Barbourb1250542015-04-16 19:23:13 -0600351
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600352 Proto("VkResult", "DestroyObject",
Mike Stroyanb050c682015-04-17 12:36:38 -0600353 [Param("VkDevice", "device"),
Mark Lobodzinski23065352015-05-29 09:32:35 -0500354 Param("VkObjectType", "objType"),
Mike Stroyanb050c682015-04-17 12:36:38 -0600355 Param("VkObject", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800356
Tony Barbour59a47322015-06-24 16:06:58 -0600357 Proto("VkResult", "GetObjectMemoryRequirements",
Mike Stroyanb050c682015-04-17 12:36:38 -0600358 [Param("VkDevice", "device"),
Mark Lobodzinski23065352015-05-29 09:32:35 -0500359 Param("VkObjectType", "objType"),
Mike Stroyanb050c682015-04-17 12:36:38 -0600360 Param("VkObject", "object"),
Tony Barbour59a47322015-06-24 16:06:58 -0600361 Param("VkMemoryRequirements*", "pMemoryRequirements")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800362
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500363 Proto("VkResult", "BindObjectMemory",
364 [Param("VkDevice", "device"),
Mark Lobodzinski23065352015-05-29 09:32:35 -0500365 Param("VkObjectType", "objType"),
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500366 Param("VkObject", "object"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600367 Param("VkDeviceMemory", "mem"),
368 Param("VkDeviceSize", "offset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800369
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600370 Proto("VkResult", "GetImageSparseMemoryRequirements",
371 [Param("VkDevice", "device"),
372 Param("VkImage", "image"),
373 Param("uint32_t*", "pNumRequirements"),
374 Param("VkSparseImageMemoryRequirements*", "pSparseMemoryRequirements"),]),
375
376 Proto("VkResult", "GetPhysicalDeviceSparseImageFormatProperties",
377 [Param("VkPhysicalDevice", "physicalDevice"),
378 Param("VkFormat", "format"),
379 Param("VkImageType", "type"),
380 Param("uint32_t", "samples"),
381 Param("VkImageUsageFlags", "usage"),
382 Param("VkImageTiling", "tiling"),
383 Param("uint32_t*", "pNumProperties"),
384 Param("VkSparseImageFormatProperties*", "pProperties"),]),
385
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500386 Proto("VkResult", "QueueBindSparseBufferMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500387 [Param("VkQueue", "queue"),
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500388 Param("VkBuffer", "buffer"),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600389 Param("uint32_t", "numBindings"),
390 Param("const VkSparseMemoryBindInfo*", "pBindInfo"),]),
391
392 Proto("VkResult", "QueueBindSparseImageOpaqueMemory",
393 [Param("VkQueue", "queue"),
394 Param("VkImage", "image"),
395 Param("uint32_t", "numBindings"),
396 Param("const VkSparseMemoryBindInfo*", "pBindInfo"),]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800397
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500398 Proto("VkResult", "QueueBindSparseImageMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500399 [Param("VkQueue", "queue"),
400 Param("VkImage", "image"),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600401 Param("uint32_t", "numBindings"),
402 Param("const VkSparseImageMemoryBindInfo*", "pBindInfo"),]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800403
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600404 Proto("VkResult", "CreateFence",
405 [Param("VkDevice", "device"),
406 Param("const VkFenceCreateInfo*", "pCreateInfo"),
407 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800408
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600409 Proto("VkResult", "ResetFences",
410 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500411 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchter2bf8f902015-06-18 17:28:20 -0600412 Param("const VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500413
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600414 Proto("VkResult", "GetFenceStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600415 [Param("VkDevice", "device"),
416 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800417
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600418 Proto("VkResult", "WaitForFences",
419 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600420 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600421 Param("const VkFence*", "pFences"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600422 Param("bool32_t", "waitAll"),
423 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800424
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600425 Proto("VkResult", "CreateSemaphore",
426 [Param("VkDevice", "device"),
427 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
428 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800429
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600430 Proto("VkResult", "QueueSignalSemaphore",
431 [Param("VkQueue", "queue"),
432 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800433
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600434 Proto("VkResult", "QueueWaitSemaphore",
435 [Param("VkQueue", "queue"),
436 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800437
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600438 Proto("VkResult", "CreateEvent",
439 [Param("VkDevice", "device"),
440 Param("const VkEventCreateInfo*", "pCreateInfo"),
441 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800442
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600443 Proto("VkResult", "GetEventStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600444 [Param("VkDevice", "device"),
445 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800446
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600447 Proto("VkResult", "SetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600448 [Param("VkDevice", "device"),
449 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800450
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600451 Proto("VkResult", "ResetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600452 [Param("VkDevice", "device"),
453 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800454
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600455 Proto("VkResult", "CreateQueryPool",
456 [Param("VkDevice", "device"),
457 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
458 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800459
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600460 Proto("VkResult", "GetQueryPoolResults",
Mike Stroyanb050c682015-04-17 12:36:38 -0600461 [Param("VkDevice", "device"),
462 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600463 Param("uint32_t", "startQuery"),
464 Param("uint32_t", "queryCount"),
465 Param("size_t*", "pDataSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600466 Param("void*", "pData"),
467 Param("VkQueryResultFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800468
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600469 Proto("VkResult", "CreateBuffer",
470 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600471 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600472 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800473
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600474 Proto("VkResult", "CreateBufferView",
475 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600476 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600477 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800478
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600479 Proto("VkResult", "CreateImage",
480 [Param("VkDevice", "device"),
481 Param("const VkImageCreateInfo*", "pCreateInfo"),
482 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800483
Tony Barbour59a47322015-06-24 16:06:58 -0600484 Proto("VkResult", "GetImageSubresourceLayout",
Mike Stroyanb050c682015-04-17 12:36:38 -0600485 [Param("VkDevice", "device"),
486 Param("VkImage", "image"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600487 Param("const VkImageSubresource*", "pSubresource"),
Tony Barbour59a47322015-06-24 16:06:58 -0600488 Param("VkSubresourceLayout*", "pLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800489
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600490 Proto("VkResult", "CreateImageView",
491 [Param("VkDevice", "device"),
492 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
493 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800494
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600495 Proto("VkResult", "CreateColorAttachmentView",
496 [Param("VkDevice", "device"),
497 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
498 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800499
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600500 Proto("VkResult", "CreateDepthStencilView",
501 [Param("VkDevice", "device"),
502 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
503 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800504
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600505 Proto("VkResult", "CreateShaderModule",
506 [Param("VkDevice", "device"),
507 Param("const VkShaderModuleCreateInfo*", "pCreateInfo"),
508 Param("VkShaderModule*", "pShaderModule")]),
509
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600510 Proto("VkResult", "CreateShader",
511 [Param("VkDevice", "device"),
512 Param("const VkShaderCreateInfo*", "pCreateInfo"),
513 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800514
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600515 Proto("VkResult", "CreateGraphicsPipeline",
516 [Param("VkDevice", "device"),
517 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
518 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800519
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600520 Proto("VkResult", "CreateGraphicsPipelineDerivative",
521 [Param("VkDevice", "device"),
522 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfo"),
523 Param("VkPipeline", "basePipeline"),
524 Param("VkPipeline*", "pPipeline")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600525
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600526 Proto("VkResult", "CreateComputePipeline",
527 [Param("VkDevice", "device"),
528 Param("const VkComputePipelineCreateInfo*", "pCreateInfo"),
529 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800530
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600531 Proto("VkResult", "StorePipeline",
Mike Stroyanb050c682015-04-17 12:36:38 -0600532 [Param("VkDevice", "device"),
533 Param("VkPipeline", "pipeline"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600534 Param("size_t*", "pDataSize"),
535 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800536
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600537 Proto("VkResult", "LoadPipeline",
538 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600539 Param("size_t", "dataSize"),
540 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600541 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800542
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600543 Proto("VkResult", "LoadPipelineDerivative",
544 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600545 Param("size_t", "dataSize"),
546 Param("const void*", "pData"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600547 Param("VkPipeline", "basePipeline"),
548 Param("VkPipeline*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800549
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500550 Proto("VkResult", "CreatePipelineLayout",
551 [Param("VkDevice", "device"),
552 Param("const VkPipelineLayoutCreateInfo*", "pCreateInfo"),
553 Param("VkPipelineLayout*", "pPipelineLayout")]),
554
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600555 Proto("VkResult", "CreateSampler",
556 [Param("VkDevice", "device"),
557 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
558 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800559
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600560 Proto("VkResult", "CreateDescriptorSetLayout",
561 [Param("VkDevice", "device"),
562 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
563 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800564
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600565 Proto("VkResult", "CreateDescriptorPool",
566 [Param("VkDevice", "device"),
567 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600568 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600569 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
570 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800571
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600572 Proto("VkResult", "ResetDescriptorPool",
Mike Stroyanb050c682015-04-17 12:36:38 -0600573 [Param("VkDevice", "device"),
574 Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800575
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600576 Proto("VkResult", "AllocDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600577 [Param("VkDevice", "device"),
578 Param("VkDescriptorPool", "descriptorPool"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600579 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600580 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600581 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
582 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600583 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800584
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800585 Proto("VkResult", "UpdateDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600586 [Param("VkDevice", "device"),
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800587 Param("uint32_t", "writeCount"),
588 Param("const VkWriteDescriptorSet*", "pDescriptorWrites"),
589 Param("uint32_t", "copyCount"),
590 Param("const VkCopyDescriptorSet*", "pDescriptorCopies")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800591
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600592 Proto("VkResult", "CreateDynamicViewportState",
593 [Param("VkDevice", "device"),
594 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600595 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800596
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600597 Proto("VkResult", "CreateDynamicRasterState",
598 [Param("VkDevice", "device"),
599 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600600 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800601
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600602 Proto("VkResult", "CreateDynamicColorBlendState",
603 [Param("VkDevice", "device"),
604 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600605 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800606
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600607 Proto("VkResult", "CreateDynamicDepthStencilState",
608 [Param("VkDevice", "device"),
609 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600610 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800611
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600612 Proto("VkResult", "CreateCommandBuffer",
613 [Param("VkDevice", "device"),
614 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
615 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800616
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600617 Proto("VkResult", "BeginCommandBuffer",
618 [Param("VkCmdBuffer", "cmdBuffer"),
619 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800620
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600621 Proto("VkResult", "EndCommandBuffer",
622 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800623
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600624 Proto("VkResult", "ResetCommandBuffer",
625 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800626
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600627 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600628 [Param("VkCmdBuffer", "cmdBuffer"),
629 Param("VkPipelineBindPoint", "pipelineBindPoint"),
630 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800631
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600632 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600633 [Param("VkCmdBuffer", "cmdBuffer"),
634 Param("VkStateBindPoint", "stateBindPoint"),
635 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800636
Chia-I Wu53f07d72015-03-28 15:23:55 +0800637 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600638 [Param("VkCmdBuffer", "cmdBuffer"),
639 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskif2093b62015-06-15 13:21:21 -0600640 Param("VkPipelineLayout", "layout"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600641 Param("uint32_t", "firstSet"),
642 Param("uint32_t", "setCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600643 Param("const VkDescriptorSet*", "pDescriptorSets"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600644 Param("uint32_t", "dynamicOffsetCount"),
645 Param("const uint32_t*", "pDynamicOffsets")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800646
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600647 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600648 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600649 Param("uint32_t", "startBinding"),
650 Param("uint32_t", "bindingCount"),
651 Param("const VkBuffer*", "pBuffers"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600652 Param("const VkDeviceSize*", "pOffsets")]),
653
Chia-I Wu7a42e122014-11-08 10:48:20 +0800654
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600655 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600656 [Param("VkCmdBuffer", "cmdBuffer"),
657 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600658 Param("VkDeviceSize", "offset"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600659 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800660
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600661 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600662 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600663 Param("uint32_t", "firstVertex"),
664 Param("uint32_t", "vertexCount"),
665 Param("uint32_t", "firstInstance"),
666 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800667
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600668 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600669 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600670 Param("uint32_t", "firstIndex"),
671 Param("uint32_t", "indexCount"),
672 Param("int32_t", "vertexOffset"),
673 Param("uint32_t", "firstInstance"),
674 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800675
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600676 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600677 [Param("VkCmdBuffer", "cmdBuffer"),
678 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600679 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600680 Param("uint32_t", "count"),
681 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800682
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600683 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600684 [Param("VkCmdBuffer", "cmdBuffer"),
685 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600686 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600687 Param("uint32_t", "count"),
688 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800689
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600690 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600691 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600692 Param("uint32_t", "x"),
693 Param("uint32_t", "y"),
694 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800695
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600696 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600697 [Param("VkCmdBuffer", "cmdBuffer"),
698 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600699 Param("VkDeviceSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800700
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600701 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600702 [Param("VkCmdBuffer", "cmdBuffer"),
703 Param("VkBuffer", "srcBuffer"),
704 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600705 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600706 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800707
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600708 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600709 [Param("VkCmdBuffer", "cmdBuffer"),
710 Param("VkImage", "srcImage"),
711 Param("VkImageLayout", "srcImageLayout"),
712 Param("VkImage", "destImage"),
713 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600714 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600715 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800716
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600717 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600718 [Param("VkCmdBuffer", "cmdBuffer"),
719 Param("VkImage", "srcImage"),
720 Param("VkImageLayout", "srcImageLayout"),
721 Param("VkImage", "destImage"),
722 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600723 Param("uint32_t", "regionCount"),
Mark Lobodzinskiee5eef12015-05-22 14:43:25 -0500724 Param("const VkImageBlit*", "pRegions"),
725 Param("VkTexFilter", "filter")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600726
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600727 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600728 [Param("VkCmdBuffer", "cmdBuffer"),
729 Param("VkBuffer", "srcBuffer"),
730 Param("VkImage", "destImage"),
731 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600732 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600733 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800734
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600735 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600736 [Param("VkCmdBuffer", "cmdBuffer"),
737 Param("VkImage", "srcImage"),
738 Param("VkImageLayout", "srcImageLayout"),
739 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600740 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600741 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800742
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600743 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600744 [Param("VkCmdBuffer", "cmdBuffer"),
745 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600746 Param("VkDeviceSize", "destOffset"),
747 Param("VkDeviceSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600748 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800749
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600750 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600751 [Param("VkCmdBuffer", "cmdBuffer"),
752 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600753 Param("VkDeviceSize", "destOffset"),
754 Param("VkDeviceSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600755 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800756
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600757 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600758 [Param("VkCmdBuffer", "cmdBuffer"),
759 Param("VkImage", "image"),
760 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200761 Param("const VkClearColorValue*", "pColor"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600762 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600763 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800764
Chris Forbesd9be82b2015-06-22 17:21:59 +1200765 Proto("void", "CmdClearDepthStencilImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600766 [Param("VkCmdBuffer", "cmdBuffer"),
767 Param("VkImage", "image"),
768 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600769 Param("float", "depth"),
770 Param("uint32_t", "stencil"),
771 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600772 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800773
Chris Forbesd9be82b2015-06-22 17:21:59 +1200774 Proto("void", "CmdClearColorAttachment",
775 [Param("VkCmdBuffer", "cmdBuffer"),
776 Param("uint32_t", "colorAttachment"),
777 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200778 Param("const VkClearColorValue*", "pColor"),
Chris Forbesd9be82b2015-06-22 17:21:59 +1200779 Param("uint32_t", "rectCount"),
780 Param("const VkRect3D*", "pRects")]),
781
782 Proto("void", "CmdClearDepthStencilAttachment",
783 [Param("VkCmdBuffer", "cmdBuffer"),
784 Param("VkImageAspectFlags", "imageAspectMask"),
785 Param("VkImageLayout", "imageLayout"),
786 Param("float", "depth"),
787 Param("uint32_t", "stencil"),
788 Param("uint32_t", "rectCount"),
789 Param("const VkRect3D*", "pRects")]),
790
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"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600803 Param("VkPipelineStageFlags", "stageMask")]),
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"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600808 Param("VkPipelineStageFlags", "stageMask")]),
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("uint32_t", "eventCount"),
813 Param("const VkEvent*", "pEvents"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600814 Param("VkPipelineStageFlags", "sourceStageMask"),
815 Param("VkPipelineStageFlags", "destStageMask"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600816 Param("uint32_t", "memBarrierCount"),
817 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000818
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600819 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600820 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600821 Param("VkPipelineStageFlags", "sourceStageMask"),
822 Param("VkPipelineStageFlags", "destStageMask"),
823 Param("bool32_t", "byRegion"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600824 Param("uint32_t", "memBarrierCount"),
825 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000826
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600827 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600828 [Param("VkCmdBuffer", "cmdBuffer"),
829 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600830 Param("uint32_t", "slot"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600831 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800832
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600833 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600834 [Param("VkCmdBuffer", "cmdBuffer"),
835 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600836 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800837
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600838 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600839 [Param("VkCmdBuffer", "cmdBuffer"),
840 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600841 Param("uint32_t", "startQuery"),
842 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800843
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600844 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600845 [Param("VkCmdBuffer", "cmdBuffer"),
846 Param("VkTimestampType", "timestampType"),
847 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600848 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800849
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600850 Proto("void", "CmdCopyQueryPoolResults",
851 [Param("VkCmdBuffer", "cmdBuffer"),
852 Param("VkQueryPool", "queryPool"),
853 Param("uint32_t", "startQuery"),
854 Param("uint32_t", "queryCount"),
855 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600856 Param("VkDeviceSize", "destOffset"),
857 Param("VkDeviceSize", "destStride"),
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600858 Param("VkFlags", "flags")]),
859
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600860 Proto("VkResult", "CreateFramebuffer",
861 [Param("VkDevice", "device"),
862 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
863 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700864
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600865 Proto("VkResult", "CreateRenderPass",
866 [Param("VkDevice", "device"),
867 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
868 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700869
Jon Ashburne13f1982015-02-02 09:58:11 -0700870 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600871 [Param("VkCmdBuffer", "cmdBuffer"),
872 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700873
874 Proto("void", "CmdEndRenderPass",
Chia-I Wu0b50a1c2015-06-26 15:34:39 +0800875 [Param("VkCmdBuffer", "cmdBuffer")]),
876
877 Proto("void", "CmdExecuteCommands",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600878 [Param("VkCmdBuffer", "cmdBuffer"),
Chia-I Wu0b50a1c2015-06-26 15:34:39 +0800879 Param("uint32_t", "cmdBuffersCount"),
880 Param("const VkCmdBuffer*", "pCmdBuffers")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800881 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800882)
883
Chia-I Wuf8693382015-04-16 22:02:10 +0800884wsi_lunarg = Extension(
885 name="VK_WSI_LunarG",
886 headers=["vk_wsi_lunarg.h"],
887 objects=[
888 "VkDisplayWSI",
889 "VkSwapChainWSI",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600890 "VkDbgMsgCallback",
Chia-I Wuf8693382015-04-16 22:02:10 +0800891 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800892 protos=[
Chia-I Wuf8693382015-04-16 22:02:10 +0800893 Proto("VkResult", "CreateSwapChainWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600894 [Param("VkDevice", "device"),
Chia-I Wuf8693382015-04-16 22:02:10 +0800895 Param("const VkSwapChainCreateInfoWSI*", "pCreateInfo"),
896 Param("VkSwapChainWSI*", "pSwapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800897
Chia-I Wuf8693382015-04-16 22:02:10 +0800898 Proto("VkResult", "DestroySwapChainWSI",
899 [Param("VkSwapChainWSI", "swapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800900
Chia-I Wuf8693382015-04-16 22:02:10 +0800901 Proto("VkResult", "GetSwapChainInfoWSI",
902 [Param("VkSwapChainWSI", "swapChain"),
903 Param("VkSwapChainInfoTypeWSI", "infoType"),
904 Param("size_t*", "pDataSize"),
905 Param("void*", "pData")]),
906
907 Proto("VkResult", "QueuePresentWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600908 [Param("VkQueue", "queue"),
Chia-I Wuf8693382015-04-16 22:02:10 +0800909 Param("const VkPresentInfoWSI*", "pPresentInfo")]),
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600910
911# Proto("VkResult", "DbgCreateMsgCallback",
912# [Param("VkInstance", "instance"),
913# Param("VkFlags", "msgFlags"),
914# Param("PFN_vkDbgMsgCallback", "pfnMsgCallback"),
915# Param("void*", "pUserData"),
916# Param("VkDbgMsgCallback*", "pMsgCallback")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800917 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800918)
919
Chia-I Wuf8693382015-04-16 22:02:10 +0800920extensions = [core, wsi_lunarg]
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800921
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700922object_root_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600923 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -0600924 "VkPhysicalDevice",
Chia-I Wuf8693382015-04-16 22:02:10 +0800925 "VkDisplayWSI",
926 "VkSwapChainWSI",
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700927]
928
929object_base_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600930 "VkDevice",
931 "VkQueue",
Tony Barbourd1c35722015-04-16 15:59:00 -0600932 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600933 "VkObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700934]
935
936object_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600937 "VkBuffer",
938 "VkBufferView",
939 "VkImage",
940 "VkImageView",
941 "VkColorAttachmentView",
942 "VkDepthStencilView",
943 "VkShader",
944 "VkPipeline",
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500945 "VkPipelineLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600946 "VkSampler",
947 "VkDescriptorSet",
948 "VkDescriptorSetLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600949 "VkDescriptorPool",
950 "VkDynamicStateObject",
951 "VkCmdBuffer",
952 "VkFence",
953 "VkSemaphore",
954 "VkEvent",
955 "VkQueryPool",
956 "VkFramebuffer",
957 "VkRenderPass"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700958]
959
960object_dynamic_state_list = [
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600961 "VkDynamicVpState",
962 "VkDynamicRsState",
963 "VkDynamicCbState",
964 "VkDynamicDsState"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700965]
966
967object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
968
Mike Stroyanb050c682015-04-17 12:36:38 -0600969object_parent_list = ["VkObject", "VkDynamicStateObject"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700970
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800971headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800972objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800973protos = []
974for ext in extensions:
975 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800976 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800977 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800978
Chia-I Wu9a4ceb12015-01-01 14:45:58 +0800979proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +0800980
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600981def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +0800982 # read object and protoype typedefs
983 object_lines = []
984 proto_lines = []
985 with open(filename, "r") as fp:
986 for line in fp:
987 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600988 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +0800989 begin = line.find("(") + 1
990 end = line.find(",")
991 # extract the object type
992 object_lines.append(line[begin:end])
993 if line.startswith("typedef") and line.endswith(");"):
994 # drop leading "typedef " and trailing ");"
995 proto_lines.append(line[8:-2])
996
997 # parse proto_lines to protos
998 protos = []
999 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001000 first, rest = line.split(" (VKAPI *PFN_vk")
1001 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001002
1003 # get the return type, no space before "*"
1004 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1005
1006 # get the name
1007 proto_name = second.strip()
1008
1009 # get the list of params
1010 param_strs = third.split(", ")
1011 params = []
1012 for s in param_strs:
1013 ty, name = s.rsplit(" ", 1)
1014
1015 # no space before "*"
1016 ty = "*".join([t.rstrip() for t in ty.split("*")])
1017 # attach [] to ty
1018 idx = name.rfind("[")
1019 if idx >= 0:
1020 ty += name[idx:]
1021 name = name[:idx]
1022
1023 params.append(Param(ty, name))
1024
1025 protos.append(Proto(proto_ret, proto_name, params))
1026
1027 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001028 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001029 headers=["vulkan.h", "vk_debug_report_lunarg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001030 objects=object_lines,
1031 protos=protos)
1032 print("core =", str(ext))
1033
1034 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001035 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001036 print("{")
1037 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001038 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001039 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001040
1041if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001042 parse_vk_h("include/vulkan.h")