blob: 123fccf4b45cb9559650905c6480bce4bcde0cf8 [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",
Chia-I Wu08accc62015-07-07 11:50:03 +0800197 "VkAttachmentView",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600198 "VkShader",
199 "VkPipeline",
Jon Ashburnc669cc62015-07-09 15:02:25 -0600200 "VkPipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600201 "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"),
Courtney Goeltzenleuchtercd2a0992015-07-09 11:44:38 -0600422 Param("VkBool32", "waitAll"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600423 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
Chia-I Wu08accc62015-07-07 11:50:03 +0800495 Proto("VkResult", "CreateAttachmentView",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600496 [Param("VkDevice", "device"),
Chia-I Wu08accc62015-07-07 11:50:03 +0800497 Param("const VkAttachmentViewCreateInfo*", "pCreateInfo"),
498 Param("VkAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800499
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600500 Proto("VkResult", "CreateShaderModule",
501 [Param("VkDevice", "device"),
502 Param("const VkShaderModuleCreateInfo*", "pCreateInfo"),
503 Param("VkShaderModule*", "pShaderModule")]),
504
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600505 Proto("VkResult", "CreateShader",
506 [Param("VkDevice", "device"),
507 Param("const VkShaderCreateInfo*", "pCreateInfo"),
508 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800509
Jon Ashburnc669cc62015-07-09 15:02:25 -0600510 Proto("VkResult", "CreatePipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600511 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600512 Param("const VkPipelineCacheCreateInfo*", "pCreateInfo"),
513 Param("VkPipelineCache*", "pPipelineCache")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800514
Jon Ashburnc669cc62015-07-09 15:02:25 -0600515 Proto("VkResult", "DestroyPipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600516 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600517 Param("VkPipelineCache", "pipelineCache")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600518
Jon Ashburnc669cc62015-07-09 15:02:25 -0600519 Proto("size_t", "GetPipelineCacheSize",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600520 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600521 Param("VkPipelineCache", "pipelineCache")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800522
Jon Ashburnc669cc62015-07-09 15:02:25 -0600523 Proto("VkResult", "GetPipelineCacheData",
Mike Stroyanb050c682015-04-17 12:36:38 -0600524 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600525 Param("VkPipelineCache", "pipelineCache"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600526 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800527
Jon Ashburnc669cc62015-07-09 15:02:25 -0600528 Proto("VkResult", "MergePipelineCaches",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600529 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600530 Param("VkPipelineCache", "destCache"),
531 Param("uint32_t", "srcCacheCount"),
532 Param("const VkPipelineCache*", "pSrcCaches")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800533
Jon Ashburnc669cc62015-07-09 15:02:25 -0600534 Proto("VkResult", "CreateGraphicsPipelines",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600535 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600536 Param("VkPipelineCache", "pipelineCache"),
537 Param("uint32_t", "count"),
538 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfos"),
539 Param("VkPipeline*", "pPipelines")]),
540
541 Proto("VkResult", "CreateComputePipelines",
542 [Param("VkDevice", "device"),
543 Param("VkPipelineCache", "pipelineCache"),
544 Param("uint32_t", "count"),
545 Param("const VkComputePipelineCreateInfo*", "pCreateInfos"),
546 Param("VkPipeline*", "pPipelines")]),
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", "CreateDescriptorPool",
564 [Param("VkDevice", "device"),
565 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600566 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600567 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
568 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800569
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600570 Proto("VkResult", "ResetDescriptorPool",
Mike Stroyanb050c682015-04-17 12:36:38 -0600571 [Param("VkDevice", "device"),
572 Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800573
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600574 Proto("VkResult", "AllocDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600575 [Param("VkDevice", "device"),
576 Param("VkDescriptorPool", "descriptorPool"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600577 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600578 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600579 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
580 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600581 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800582
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800583 Proto("VkResult", "UpdateDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600584 [Param("VkDevice", "device"),
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800585 Param("uint32_t", "writeCount"),
586 Param("const VkWriteDescriptorSet*", "pDescriptorWrites"),
587 Param("uint32_t", "copyCount"),
588 Param("const VkCopyDescriptorSet*", "pDescriptorCopies")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800589
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600590 Proto("VkResult", "CreateDynamicViewportState",
591 [Param("VkDevice", "device"),
592 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600593 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800594
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600595 Proto("VkResult", "CreateDynamicRasterState",
596 [Param("VkDevice", "device"),
597 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600598 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800599
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600600 Proto("VkResult", "CreateDynamicColorBlendState",
601 [Param("VkDevice", "device"),
602 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600603 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800604
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600605 Proto("VkResult", "CreateDynamicDepthStencilState",
606 [Param("VkDevice", "device"),
607 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600608 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800609
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600610 Proto("VkResult", "CreateCommandBuffer",
611 [Param("VkDevice", "device"),
612 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
613 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800614
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600615 Proto("VkResult", "BeginCommandBuffer",
616 [Param("VkCmdBuffer", "cmdBuffer"),
617 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800618
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600619 Proto("VkResult", "EndCommandBuffer",
620 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800621
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600622 Proto("VkResult", "ResetCommandBuffer",
623 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800624
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600625 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600626 [Param("VkCmdBuffer", "cmdBuffer"),
627 Param("VkPipelineBindPoint", "pipelineBindPoint"),
628 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800629
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600630 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600631 [Param("VkCmdBuffer", "cmdBuffer"),
632 Param("VkStateBindPoint", "stateBindPoint"),
633 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800634
Chia-I Wu53f07d72015-03-28 15:23:55 +0800635 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600636 [Param("VkCmdBuffer", "cmdBuffer"),
637 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskif2093b62015-06-15 13:21:21 -0600638 Param("VkPipelineLayout", "layout"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600639 Param("uint32_t", "firstSet"),
640 Param("uint32_t", "setCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600641 Param("const VkDescriptorSet*", "pDescriptorSets"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600642 Param("uint32_t", "dynamicOffsetCount"),
643 Param("const uint32_t*", "pDynamicOffsets")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800644
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600645 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600646 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600647 Param("uint32_t", "startBinding"),
648 Param("uint32_t", "bindingCount"),
649 Param("const VkBuffer*", "pBuffers"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600650 Param("const VkDeviceSize*", "pOffsets")]),
651
Chia-I Wu7a42e122014-11-08 10:48:20 +0800652
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600653 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600654 [Param("VkCmdBuffer", "cmdBuffer"),
655 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600656 Param("VkDeviceSize", "offset"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600657 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800658
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600659 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600660 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600661 Param("uint32_t", "firstVertex"),
662 Param("uint32_t", "vertexCount"),
663 Param("uint32_t", "firstInstance"),
664 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800665
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600666 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600667 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600668 Param("uint32_t", "firstIndex"),
669 Param("uint32_t", "indexCount"),
670 Param("int32_t", "vertexOffset"),
671 Param("uint32_t", "firstInstance"),
672 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800673
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600674 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600675 [Param("VkCmdBuffer", "cmdBuffer"),
676 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600677 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600678 Param("uint32_t", "count"),
679 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800680
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600681 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600682 [Param("VkCmdBuffer", "cmdBuffer"),
683 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600684 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600685 Param("uint32_t", "count"),
686 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800687
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600688 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600689 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600690 Param("uint32_t", "x"),
691 Param("uint32_t", "y"),
692 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800693
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600694 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600695 [Param("VkCmdBuffer", "cmdBuffer"),
696 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600697 Param("VkDeviceSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800698
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600699 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600700 [Param("VkCmdBuffer", "cmdBuffer"),
701 Param("VkBuffer", "srcBuffer"),
702 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600703 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600704 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800705
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600706 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600707 [Param("VkCmdBuffer", "cmdBuffer"),
708 Param("VkImage", "srcImage"),
709 Param("VkImageLayout", "srcImageLayout"),
710 Param("VkImage", "destImage"),
711 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600712 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600713 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800714
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600715 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600716 [Param("VkCmdBuffer", "cmdBuffer"),
717 Param("VkImage", "srcImage"),
718 Param("VkImageLayout", "srcImageLayout"),
719 Param("VkImage", "destImage"),
720 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600721 Param("uint32_t", "regionCount"),
Mark Lobodzinskiee5eef12015-05-22 14:43:25 -0500722 Param("const VkImageBlit*", "pRegions"),
723 Param("VkTexFilter", "filter")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600724
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600725 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600726 [Param("VkCmdBuffer", "cmdBuffer"),
727 Param("VkBuffer", "srcBuffer"),
728 Param("VkImage", "destImage"),
729 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600730 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600731 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800732
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600733 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600734 [Param("VkCmdBuffer", "cmdBuffer"),
735 Param("VkImage", "srcImage"),
736 Param("VkImageLayout", "srcImageLayout"),
737 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600738 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600739 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800740
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600741 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600742 [Param("VkCmdBuffer", "cmdBuffer"),
743 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600744 Param("VkDeviceSize", "destOffset"),
745 Param("VkDeviceSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600746 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800747
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600748 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600749 [Param("VkCmdBuffer", "cmdBuffer"),
750 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600751 Param("VkDeviceSize", "destOffset"),
752 Param("VkDeviceSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600753 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800754
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600755 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600756 [Param("VkCmdBuffer", "cmdBuffer"),
757 Param("VkImage", "image"),
758 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200759 Param("const VkClearColorValue*", "pColor"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600760 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600761 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800762
Chris Forbesd9be82b2015-06-22 17:21:59 +1200763 Proto("void", "CmdClearDepthStencilImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600764 [Param("VkCmdBuffer", "cmdBuffer"),
765 Param("VkImage", "image"),
766 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600767 Param("float", "depth"),
768 Param("uint32_t", "stencil"),
769 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600770 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800771
Chris Forbesd9be82b2015-06-22 17:21:59 +1200772 Proto("void", "CmdClearColorAttachment",
773 [Param("VkCmdBuffer", "cmdBuffer"),
774 Param("uint32_t", "colorAttachment"),
775 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200776 Param("const VkClearColorValue*", "pColor"),
Chris Forbesd9be82b2015-06-22 17:21:59 +1200777 Param("uint32_t", "rectCount"),
778 Param("const VkRect3D*", "pRects")]),
779
780 Proto("void", "CmdClearDepthStencilAttachment",
781 [Param("VkCmdBuffer", "cmdBuffer"),
782 Param("VkImageAspectFlags", "imageAspectMask"),
783 Param("VkImageLayout", "imageLayout"),
784 Param("float", "depth"),
785 Param("uint32_t", "stencil"),
786 Param("uint32_t", "rectCount"),
787 Param("const VkRect3D*", "pRects")]),
788
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600789 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600790 [Param("VkCmdBuffer", "cmdBuffer"),
791 Param("VkImage", "srcImage"),
792 Param("VkImageLayout", "srcImageLayout"),
793 Param("VkImage", "destImage"),
794 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600795 Param("uint32_t", "regionCount"),
796 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800797
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600798 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600799 [Param("VkCmdBuffer", "cmdBuffer"),
800 Param("VkEvent", "event"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600801 Param("VkPipelineStageFlags", "stageMask")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800802
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600803 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600804 [Param("VkCmdBuffer", "cmdBuffer"),
805 Param("VkEvent", "event"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600806 Param("VkPipelineStageFlags", "stageMask")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800807
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600808 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600809 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600810 Param("uint32_t", "eventCount"),
811 Param("const VkEvent*", "pEvents"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600812 Param("VkPipelineStageFlags", "sourceStageMask"),
813 Param("VkPipelineStageFlags", "destStageMask"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600814 Param("uint32_t", "memBarrierCount"),
815 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000816
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600817 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600818 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600819 Param("VkPipelineStageFlags", "sourceStageMask"),
820 Param("VkPipelineStageFlags", "destStageMask"),
Courtney Goeltzenleuchtercd2a0992015-07-09 11:44:38 -0600821 Param("VkBool32", "byRegion"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600822 Param("uint32_t", "memBarrierCount"),
823 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000824
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600825 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600826 [Param("VkCmdBuffer", "cmdBuffer"),
827 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600828 Param("uint32_t", "slot"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600829 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800830
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600831 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600832 [Param("VkCmdBuffer", "cmdBuffer"),
833 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600834 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800835
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600836 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600837 [Param("VkCmdBuffer", "cmdBuffer"),
838 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600839 Param("uint32_t", "startQuery"),
840 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800841
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600842 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600843 [Param("VkCmdBuffer", "cmdBuffer"),
844 Param("VkTimestampType", "timestampType"),
845 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600846 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800847
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600848 Proto("void", "CmdCopyQueryPoolResults",
849 [Param("VkCmdBuffer", "cmdBuffer"),
850 Param("VkQueryPool", "queryPool"),
851 Param("uint32_t", "startQuery"),
852 Param("uint32_t", "queryCount"),
853 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600854 Param("VkDeviceSize", "destOffset"),
855 Param("VkDeviceSize", "destStride"),
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600856 Param("VkFlags", "flags")]),
857
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600858 Proto("VkResult", "CreateFramebuffer",
859 [Param("VkDevice", "device"),
860 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
861 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700862
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600863 Proto("VkResult", "CreateRenderPass",
864 [Param("VkDevice", "device"),
865 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
866 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700867
Jon Ashburne13f1982015-02-02 09:58:11 -0700868 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600869 [Param("VkCmdBuffer", "cmdBuffer"),
Chia-I Wu08accc62015-07-07 11:50:03 +0800870 Param("const VkRenderPassBeginInfo*", "pRenderPassBegin"),
871 Param("VkRenderPassContents", "contents")]),
872
873 Proto("void", "CmdNextSubpass",
874 [Param("VkCmdBuffer", "cmdBuffer"),
875 Param("VkRenderPassContents", "contents")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700876
877 Proto("void", "CmdEndRenderPass",
Chia-I Wu0b50a1c2015-06-26 15:34:39 +0800878 [Param("VkCmdBuffer", "cmdBuffer")]),
879
880 Proto("void", "CmdExecuteCommands",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600881 [Param("VkCmdBuffer", "cmdBuffer"),
Chia-I Wu0b50a1c2015-06-26 15:34:39 +0800882 Param("uint32_t", "cmdBuffersCount"),
883 Param("const VkCmdBuffer*", "pCmdBuffers")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800884 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800885)
886
Chia-I Wuf8693382015-04-16 22:02:10 +0800887wsi_lunarg = Extension(
888 name="VK_WSI_LunarG",
889 headers=["vk_wsi_lunarg.h"],
890 objects=[
891 "VkDisplayWSI",
892 "VkSwapChainWSI",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600893 "VkDbgMsgCallback",
Chia-I Wuf8693382015-04-16 22:02:10 +0800894 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800895 protos=[
Chia-I Wuf8693382015-04-16 22:02:10 +0800896 Proto("VkResult", "CreateSwapChainWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600897 [Param("VkDevice", "device"),
Chia-I Wuf8693382015-04-16 22:02:10 +0800898 Param("const VkSwapChainCreateInfoWSI*", "pCreateInfo"),
899 Param("VkSwapChainWSI*", "pSwapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800900
Chia-I Wuf8693382015-04-16 22:02:10 +0800901 Proto("VkResult", "DestroySwapChainWSI",
902 [Param("VkSwapChainWSI", "swapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800903
Chia-I Wuf8693382015-04-16 22:02:10 +0800904 Proto("VkResult", "GetSwapChainInfoWSI",
905 [Param("VkSwapChainWSI", "swapChain"),
906 Param("VkSwapChainInfoTypeWSI", "infoType"),
907 Param("size_t*", "pDataSize"),
908 Param("void*", "pData")]),
909
910 Proto("VkResult", "QueuePresentWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600911 [Param("VkQueue", "queue"),
Chia-I Wuf8693382015-04-16 22:02:10 +0800912 Param("const VkPresentInfoWSI*", "pPresentInfo")]),
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600913
914# Proto("VkResult", "DbgCreateMsgCallback",
915# [Param("VkInstance", "instance"),
916# Param("VkFlags", "msgFlags"),
917# Param("PFN_vkDbgMsgCallback", "pfnMsgCallback"),
918# Param("void*", "pUserData"),
919# Param("VkDbgMsgCallback*", "pMsgCallback")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800920 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800921)
922
Chia-I Wuf8693382015-04-16 22:02:10 +0800923extensions = [core, wsi_lunarg]
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800924
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700925object_root_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600926 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -0600927 "VkPhysicalDevice",
Chia-I Wuf8693382015-04-16 22:02:10 +0800928 "VkDisplayWSI",
929 "VkSwapChainWSI",
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700930]
931
932object_base_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600933 "VkDevice",
934 "VkQueue",
Tony Barbourd1c35722015-04-16 15:59:00 -0600935 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600936 "VkObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700937]
938
939object_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600940 "VkBuffer",
941 "VkBufferView",
942 "VkImage",
943 "VkImageView",
Chia-I Wu08accc62015-07-07 11:50:03 +0800944 "VkAttachmentView",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600945 "VkShader",
946 "VkPipeline",
Jon Ashburnc669cc62015-07-09 15:02:25 -0600947 "VkPipelineCache",
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500948 "VkPipelineLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600949 "VkSampler",
950 "VkDescriptorSet",
951 "VkDescriptorSetLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600952 "VkDescriptorPool",
953 "VkDynamicStateObject",
954 "VkCmdBuffer",
955 "VkFence",
956 "VkSemaphore",
957 "VkEvent",
958 "VkQueryPool",
959 "VkFramebuffer",
960 "VkRenderPass"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700961]
962
963object_dynamic_state_list = [
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600964 "VkDynamicVpState",
965 "VkDynamicRsState",
966 "VkDynamicCbState",
967 "VkDynamicDsState"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700968]
969
970object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
971
Mike Stroyanb050c682015-04-17 12:36:38 -0600972object_parent_list = ["VkObject", "VkDynamicStateObject"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700973
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800974headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800975objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800976protos = []
977for ext in extensions:
978 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800979 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800980 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800981
Chia-I Wu9a4ceb12015-01-01 14:45:58 +0800982proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +0800983
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600984def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +0800985 # read object and protoype typedefs
986 object_lines = []
987 proto_lines = []
988 with open(filename, "r") as fp:
989 for line in fp:
990 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600991 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +0800992 begin = line.find("(") + 1
993 end = line.find(",")
994 # extract the object type
995 object_lines.append(line[begin:end])
996 if line.startswith("typedef") and line.endswith(");"):
997 # drop leading "typedef " and trailing ");"
998 proto_lines.append(line[8:-2])
999
1000 # parse proto_lines to protos
1001 protos = []
1002 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001003 first, rest = line.split(" (VKAPI *PFN_vk")
1004 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001005
1006 # get the return type, no space before "*"
1007 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1008
1009 # get the name
1010 proto_name = second.strip()
1011
1012 # get the list of params
1013 param_strs = third.split(", ")
1014 params = []
1015 for s in param_strs:
1016 ty, name = s.rsplit(" ", 1)
1017
1018 # no space before "*"
1019 ty = "*".join([t.rstrip() for t in ty.split("*")])
1020 # attach [] to ty
1021 idx = name.rfind("[")
1022 if idx >= 0:
1023 ty += name[idx:]
1024 name = name[:idx]
1025
1026 params.append(Param(ty, name))
1027
1028 protos.append(Proto(proto_ret, proto_name, params))
1029
1030 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001031 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001032 headers=["vulkan.h", "vk_debug_report_lunarg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001033 objects=object_lines,
1034 protos=protos)
1035 print("core =", str(ext))
1036
1037 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001038 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001039 print("{")
1040 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001041 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001042 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001043
1044if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001045 parse_vk_h("include/vulkan.h")