blob: f73942f1a7547a36b7f05994b532e8ad714ec8dd [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",
Jon Ashburnc669cc62015-07-09 15:02:25 -0600201 "VkPipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600202 "VkSampler",
203 "VkDescriptorSet",
204 "VkDescriptorSetLayout",
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500205 "VkPipelineLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600206 "VkDescriptorPool",
207 "VkDynamicStateObject",
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600208 "VkDynamicVpState",
209 "VkDynamicRsState",
210 "VkDynamicCbState",
211 "VkDynamicDsState",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600212 "VkCmdBuffer",
213 "VkFence",
214 "VkSemaphore",
215 "VkEvent",
216 "VkQueryPool",
217 "VkFramebuffer",
218 "VkRenderPass",
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800219 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800220 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600221 Proto("VkResult", "CreateInstance",
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600222 [Param("const VkInstanceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600223 Param("VkInstance*", "pInstance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700224
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600225 Proto("VkResult", "DestroyInstance",
226 [Param("VkInstance", "instance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700227
Jon Ashburn83a64252015-04-15 11:31:12 -0600228 Proto("VkResult", "EnumeratePhysicalDevices",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600229 [Param("VkInstance", "instance"),
Jon Ashburn83a64252015-04-15 11:31:12 -0600230 Param("uint32_t*", "pPhysicalDeviceCount"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600231 Param("VkPhysicalDevice*", "pPhysicalDevices")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700232
Tony Barbour59a47322015-06-24 16:06:58 -0600233 Proto("VkResult", "GetPhysicalDeviceProperties",
Tony Barbourd1c35722015-04-16 15:59:00 -0600234 [Param("VkPhysicalDevice", "gpu"),
Tony Barbour59a47322015-06-24 16:06:58 -0600235 Param("VkPhysicalDeviceProperties*", "pProperties")]),
236
237 Proto("VkResult", "GetPhysicalDevicePerformance",
238 [Param("VkPhysicalDevice", "gpu"),
239 Param("VkPhysicalDevicePerformance*", "pPerformance")]),
240
241 Proto("VkResult", "GetPhysicalDeviceQueueCount",
242 [Param("VkPhysicalDevice", "gpu"),
243 Param("uint32_t*", "pCount")]),
244
245 Proto("VkResult", "GetPhysicalDeviceQueueProperties",
246 [Param("VkPhysicalDevice", "gpu"),
247 Param("uint32_t", "count"),
248 Param("VkPhysicalDeviceQueueProperties*", "pProperties")]),
249
250 Proto("VkResult", "GetPhysicalDeviceMemoryProperties",
251 [Param("VkPhysicalDevice", "gpu"),
252 Param("VkPhysicalDeviceMemoryProperties*", "pProperties")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800253
Chris Forbesbc0bb772015-06-21 22:55:02 +1200254 Proto("VkResult", "GetPhysicalDeviceFeatures",
255 [Param("VkPhysicalDevice", "physicalDevice"),
256 Param("VkPhysicalDeviceFeatures*", "pFeatures")]),
257
258 Proto("VkResult", "GetPhysicalDeviceFormatInfo",
259 [Param("VkPhysicalDevice", "physicalDevice"),
260 Param("VkFormat", "format"),
261 Param("VkFormatProperties*", "pFormatInfo")]),
262
263 Proto("VkResult", "GetPhysicalDeviceLimits",
264 [Param("VkPhysicalDevice", "physicalDevice"),
265 Param("VkPhysicalDeviceLimits*", "pLimits")]),
266
Jon Ashburnb0fbe912015-05-06 10:15:07 -0600267 Proto("void*", "GetInstanceProcAddr",
268 [Param("VkInstance", "instance"),
269 Param("const char*", "pName")]),
270
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600271 Proto("void*", "GetDeviceProcAddr",
272 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600273 Param("const char*", "pName")]),
Chia-I Wuf2ffc522015-01-04 14:51:06 +0800274
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600275 Proto("VkResult", "CreateDevice",
Tony Barbourd1c35722015-04-16 15:59:00 -0600276 [Param("VkPhysicalDevice", "gpu"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600277 Param("const VkDeviceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600278 Param("VkDevice*", "pDevice")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800279
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600280 Proto("VkResult", "DestroyDevice",
281 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800282
Tony Barbour59a47322015-06-24 16:06:58 -0600283 Proto("VkResult", "GetPhysicalDeviceExtensionProperties",
Tony Barbourd1c35722015-04-16 15:59:00 -0600284 [Param("VkPhysicalDevice", "gpu"),
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600285 Param("const char*", "pLayerName"),
286 Param("uint32_t*", "pCount"),
Tony Barbour59a47322015-06-24 16:06:58 -0600287 Param("VkExtensionProperties*", "pProperties")]),
288
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600289 Proto("VkResult", "GetPhysicalDeviceLayerProperties",
Tony Barbour59a47322015-06-24 16:06:58 -0600290 [Param("VkPhysicalDevice", "gpu"),
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600291 Param("const char*", "pLayerName"),
292 Param("uint32_t*", "pCount"),
293 Param("VkLayerProperties*", "pProperties")]),
Tony Barbour59a47322015-06-24 16:06:58 -0600294
295 Proto("VkResult", "GetGlobalExtensionProperties",
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600296 [Param("const char*", "pLayerName"),
297 Param("uint32_t*", "pCount"),
Tony Barbour59a47322015-06-24 16:06:58 -0600298 Param("VkExtensionProperties*", "pProperties")]),
299
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600300 Proto("VkResult", "GetGlobalLayerProperties",
301 [Param("uint32_t*", "pCount"),
302 Param("VkExtensionProperties*", "pProperties")]),
Tobin Ehlis01939012015-04-16 12:51:37 -0600303
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600304 Proto("VkResult", "GetDeviceQueue",
305 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter18248e62015-03-05 18:09:39 -0700306 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600307 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600308 Param("VkQueue*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800309
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600310 Proto("VkResult", "QueueSubmit",
311 [Param("VkQueue", "queue"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600312 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600313 Param("const VkCmdBuffer*", "pCmdBuffers"),
314 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800315
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600316 Proto("VkResult", "QueueWaitIdle",
317 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800318
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600319 Proto("VkResult", "DeviceWaitIdle",
320 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800321
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600322 Proto("VkResult", "AllocMemory",
323 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600324 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600325 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800326
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600327 Proto("VkResult", "FreeMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600328 [Param("VkDevice", "device"),
329 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800330
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600331 Proto("VkResult", "MapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600332 [Param("VkDevice", "device"),
333 Param("VkDeviceMemory", "mem"),
Tony Barbour71a85122015-04-16 19:09:28 -0600334 Param("VkDeviceSize", "offset"),
335 Param("VkDeviceSize", "size"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600336 Param("VkFlags", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600337 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800338
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600339 Proto("VkResult", "UnmapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600340 [Param("VkDevice", "device"),
341 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800342
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600343 Proto("VkResult", "FlushMappedMemoryRanges",
Mike Stroyanb050c682015-04-17 12:36:38 -0600344 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600345 Param("uint32_t", "memRangeCount"),
346 Param("const VkMappedMemoryRange*", "pMemRanges")]),
347
348 Proto("VkResult", "InvalidateMappedMemoryRanges",
349 [Param("VkDevice", "device"),
350 Param("uint32_t", "memRangeCount"),
351 Param("const VkMappedMemoryRange*", "pMemRanges")]),
Tony Barbourb1250542015-04-16 19:23:13 -0600352
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600353 Proto("VkResult", "DestroyObject",
Mike Stroyanb050c682015-04-17 12:36:38 -0600354 [Param("VkDevice", "device"),
Mark Lobodzinski23065352015-05-29 09:32:35 -0500355 Param("VkObjectType", "objType"),
Mike Stroyanb050c682015-04-17 12:36:38 -0600356 Param("VkObject", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800357
Tony Barbour59a47322015-06-24 16:06:58 -0600358 Proto("VkResult", "GetObjectMemoryRequirements",
Mike Stroyanb050c682015-04-17 12:36:38 -0600359 [Param("VkDevice", "device"),
Mark Lobodzinski23065352015-05-29 09:32:35 -0500360 Param("VkObjectType", "objType"),
Mike Stroyanb050c682015-04-17 12:36:38 -0600361 Param("VkObject", "object"),
Tony Barbour59a47322015-06-24 16:06:58 -0600362 Param("VkMemoryRequirements*", "pMemoryRequirements")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800363
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500364 Proto("VkResult", "BindObjectMemory",
365 [Param("VkDevice", "device"),
Mark Lobodzinski23065352015-05-29 09:32:35 -0500366 Param("VkObjectType", "objType"),
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500367 Param("VkObject", "object"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600368 Param("VkDeviceMemory", "mem"),
369 Param("VkDeviceSize", "offset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800370
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600371 Proto("VkResult", "GetImageSparseMemoryRequirements",
372 [Param("VkDevice", "device"),
373 Param("VkImage", "image"),
374 Param("uint32_t*", "pNumRequirements"),
375 Param("VkSparseImageMemoryRequirements*", "pSparseMemoryRequirements"),]),
376
377 Proto("VkResult", "GetPhysicalDeviceSparseImageFormatProperties",
378 [Param("VkPhysicalDevice", "physicalDevice"),
379 Param("VkFormat", "format"),
380 Param("VkImageType", "type"),
381 Param("uint32_t", "samples"),
382 Param("VkImageUsageFlags", "usage"),
383 Param("VkImageTiling", "tiling"),
384 Param("uint32_t*", "pNumProperties"),
385 Param("VkSparseImageFormatProperties*", "pProperties"),]),
386
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500387 Proto("VkResult", "QueueBindSparseBufferMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500388 [Param("VkQueue", "queue"),
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500389 Param("VkBuffer", "buffer"),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600390 Param("uint32_t", "numBindings"),
391 Param("const VkSparseMemoryBindInfo*", "pBindInfo"),]),
392
393 Proto("VkResult", "QueueBindSparseImageOpaqueMemory",
394 [Param("VkQueue", "queue"),
395 Param("VkImage", "image"),
396 Param("uint32_t", "numBindings"),
397 Param("const VkSparseMemoryBindInfo*", "pBindInfo"),]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800398
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500399 Proto("VkResult", "QueueBindSparseImageMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500400 [Param("VkQueue", "queue"),
401 Param("VkImage", "image"),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600402 Param("uint32_t", "numBindings"),
403 Param("const VkSparseImageMemoryBindInfo*", "pBindInfo"),]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800404
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600405 Proto("VkResult", "CreateFence",
406 [Param("VkDevice", "device"),
407 Param("const VkFenceCreateInfo*", "pCreateInfo"),
408 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800409
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600410 Proto("VkResult", "ResetFences",
411 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500412 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchter2bf8f902015-06-18 17:28:20 -0600413 Param("const VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500414
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600415 Proto("VkResult", "GetFenceStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600416 [Param("VkDevice", "device"),
417 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800418
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600419 Proto("VkResult", "WaitForFences",
420 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600421 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600422 Param("const VkFence*", "pFences"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600423 Param("bool32_t", "waitAll"),
424 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800425
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600426 Proto("VkResult", "CreateSemaphore",
427 [Param("VkDevice", "device"),
428 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
429 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800430
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600431 Proto("VkResult", "QueueSignalSemaphore",
432 [Param("VkQueue", "queue"),
433 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800434
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600435 Proto("VkResult", "QueueWaitSemaphore",
436 [Param("VkQueue", "queue"),
437 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800438
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600439 Proto("VkResult", "CreateEvent",
440 [Param("VkDevice", "device"),
441 Param("const VkEventCreateInfo*", "pCreateInfo"),
442 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800443
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600444 Proto("VkResult", "GetEventStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600445 [Param("VkDevice", "device"),
446 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800447
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600448 Proto("VkResult", "SetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600449 [Param("VkDevice", "device"),
450 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800451
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600452 Proto("VkResult", "ResetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600453 [Param("VkDevice", "device"),
454 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800455
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600456 Proto("VkResult", "CreateQueryPool",
457 [Param("VkDevice", "device"),
458 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
459 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800460
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600461 Proto("VkResult", "GetQueryPoolResults",
Mike Stroyanb050c682015-04-17 12:36:38 -0600462 [Param("VkDevice", "device"),
463 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600464 Param("uint32_t", "startQuery"),
465 Param("uint32_t", "queryCount"),
466 Param("size_t*", "pDataSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600467 Param("void*", "pData"),
468 Param("VkQueryResultFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800469
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600470 Proto("VkResult", "CreateBuffer",
471 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600472 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600473 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800474
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600475 Proto("VkResult", "CreateBufferView",
476 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600477 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600478 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800479
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600480 Proto("VkResult", "CreateImage",
481 [Param("VkDevice", "device"),
482 Param("const VkImageCreateInfo*", "pCreateInfo"),
483 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800484
Tony Barbour59a47322015-06-24 16:06:58 -0600485 Proto("VkResult", "GetImageSubresourceLayout",
Mike Stroyanb050c682015-04-17 12:36:38 -0600486 [Param("VkDevice", "device"),
487 Param("VkImage", "image"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600488 Param("const VkImageSubresource*", "pSubresource"),
Tony Barbour59a47322015-06-24 16:06:58 -0600489 Param("VkSubresourceLayout*", "pLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800490
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600491 Proto("VkResult", "CreateImageView",
492 [Param("VkDevice", "device"),
493 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
494 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800495
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600496 Proto("VkResult", "CreateColorAttachmentView",
497 [Param("VkDevice", "device"),
498 Param("const VkColorAttachmentViewCreateInfo*", "pCreateInfo"),
499 Param("VkColorAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800500
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600501 Proto("VkResult", "CreateDepthStencilView",
502 [Param("VkDevice", "device"),
503 Param("const VkDepthStencilViewCreateInfo*", "pCreateInfo"),
504 Param("VkDepthStencilView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800505
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600506 Proto("VkResult", "CreateShaderModule",
507 [Param("VkDevice", "device"),
508 Param("const VkShaderModuleCreateInfo*", "pCreateInfo"),
509 Param("VkShaderModule*", "pShaderModule")]),
510
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600511 Proto("VkResult", "CreateShader",
512 [Param("VkDevice", "device"),
513 Param("const VkShaderCreateInfo*", "pCreateInfo"),
514 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800515
Jon Ashburnc669cc62015-07-09 15:02:25 -0600516 Proto("VkResult", "CreatePipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600517 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600518 Param("const VkPipelineCacheCreateInfo*", "pCreateInfo"),
519 Param("VkPipelineCache*", "pPipelineCache")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800520
Jon Ashburnc669cc62015-07-09 15:02:25 -0600521 Proto("VkResult", "DestroyPipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600522 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600523 Param("VkPipelineCache", "pipelineCache")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600524
Jon Ashburnc669cc62015-07-09 15:02:25 -0600525 Proto("size_t", "GetPipelineCacheSize",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600526 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600527 Param("VkPipelineCache", "pipelineCache")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800528
Jon Ashburnc669cc62015-07-09 15:02:25 -0600529 Proto("VkResult", "GetPipelineCacheData",
Mike Stroyanb050c682015-04-17 12:36:38 -0600530 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600531 Param("VkPipelineCache", "pipelineCache"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600532 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800533
Jon Ashburnc669cc62015-07-09 15:02:25 -0600534 Proto("VkResult", "MergePipelineCaches",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600535 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600536 Param("VkPipelineCache", "destCache"),
537 Param("uint32_t", "srcCacheCount"),
538 Param("const VkPipelineCache*", "pSrcCaches")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800539
Jon Ashburnc669cc62015-07-09 15:02:25 -0600540 Proto("VkResult", "CreateGraphicsPipelines",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600541 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600542 Param("VkPipelineCache", "pipelineCache"),
543 Param("uint32_t", "count"),
544 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfos"),
545 Param("VkPipeline*", "pPipelines")]),
546
547 Proto("VkResult", "CreateComputePipelines",
548 [Param("VkDevice", "device"),
549 Param("VkPipelineCache", "pipelineCache"),
550 Param("uint32_t", "count"),
551 Param("const VkComputePipelineCreateInfo*", "pCreateInfos"),
552 Param("VkPipeline*", "pPipelines")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800553
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500554 Proto("VkResult", "CreatePipelineLayout",
555 [Param("VkDevice", "device"),
556 Param("const VkPipelineLayoutCreateInfo*", "pCreateInfo"),
557 Param("VkPipelineLayout*", "pPipelineLayout")]),
558
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600559 Proto("VkResult", "CreateSampler",
560 [Param("VkDevice", "device"),
561 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
562 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800563
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600564 Proto("VkResult", "CreateDescriptorSetLayout",
565 [Param("VkDevice", "device"),
566 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
567 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800568
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600569 Proto("VkResult", "CreateDescriptorPool",
570 [Param("VkDevice", "device"),
571 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600572 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600573 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
574 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800575
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600576 Proto("VkResult", "ResetDescriptorPool",
Mike Stroyanb050c682015-04-17 12:36:38 -0600577 [Param("VkDevice", "device"),
578 Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800579
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600580 Proto("VkResult", "AllocDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600581 [Param("VkDevice", "device"),
582 Param("VkDescriptorPool", "descriptorPool"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600583 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600584 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600585 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
586 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600587 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800588
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800589 Proto("VkResult", "UpdateDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600590 [Param("VkDevice", "device"),
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800591 Param("uint32_t", "writeCount"),
592 Param("const VkWriteDescriptorSet*", "pDescriptorWrites"),
593 Param("uint32_t", "copyCount"),
594 Param("const VkCopyDescriptorSet*", "pDescriptorCopies")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800595
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600596 Proto("VkResult", "CreateDynamicViewportState",
597 [Param("VkDevice", "device"),
598 Param("const VkDynamicVpStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600599 Param("VkDynamicVpState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800600
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600601 Proto("VkResult", "CreateDynamicRasterState",
602 [Param("VkDevice", "device"),
603 Param("const VkDynamicRsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600604 Param("VkDynamicRsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800605
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600606 Proto("VkResult", "CreateDynamicColorBlendState",
607 [Param("VkDevice", "device"),
608 Param("const VkDynamicCbStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600609 Param("VkDynamicCbState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800610
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600611 Proto("VkResult", "CreateDynamicDepthStencilState",
612 [Param("VkDevice", "device"),
613 Param("const VkDynamicDsStateCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600614 Param("VkDynamicDsState*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800615
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600616 Proto("VkResult", "CreateCommandBuffer",
617 [Param("VkDevice", "device"),
618 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
619 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800620
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600621 Proto("VkResult", "BeginCommandBuffer",
622 [Param("VkCmdBuffer", "cmdBuffer"),
623 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800624
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600625 Proto("VkResult", "EndCommandBuffer",
626 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800627
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600628 Proto("VkResult", "ResetCommandBuffer",
629 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800630
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600631 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600632 [Param("VkCmdBuffer", "cmdBuffer"),
633 Param("VkPipelineBindPoint", "pipelineBindPoint"),
634 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800635
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600636 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600637 [Param("VkCmdBuffer", "cmdBuffer"),
638 Param("VkStateBindPoint", "stateBindPoint"),
639 Param("VkDynamicStateObject", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800640
Chia-I Wu53f07d72015-03-28 15:23:55 +0800641 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600642 [Param("VkCmdBuffer", "cmdBuffer"),
643 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskif2093b62015-06-15 13:21:21 -0600644 Param("VkPipelineLayout", "layout"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600645 Param("uint32_t", "firstSet"),
646 Param("uint32_t", "setCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600647 Param("const VkDescriptorSet*", "pDescriptorSets"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600648 Param("uint32_t", "dynamicOffsetCount"),
649 Param("const uint32_t*", "pDynamicOffsets")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800650
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600651 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600652 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600653 Param("uint32_t", "startBinding"),
654 Param("uint32_t", "bindingCount"),
655 Param("const VkBuffer*", "pBuffers"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600656 Param("const VkDeviceSize*", "pOffsets")]),
657
Chia-I Wu7a42e122014-11-08 10:48:20 +0800658
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600659 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600660 [Param("VkCmdBuffer", "cmdBuffer"),
661 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600662 Param("VkDeviceSize", "offset"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600663 Param("VkIndexType", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800664
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600665 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600666 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600667 Param("uint32_t", "firstVertex"),
668 Param("uint32_t", "vertexCount"),
669 Param("uint32_t", "firstInstance"),
670 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800671
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600672 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600673 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600674 Param("uint32_t", "firstIndex"),
675 Param("uint32_t", "indexCount"),
676 Param("int32_t", "vertexOffset"),
677 Param("uint32_t", "firstInstance"),
678 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800679
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600680 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600681 [Param("VkCmdBuffer", "cmdBuffer"),
682 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600683 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600684 Param("uint32_t", "count"),
685 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800686
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600687 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600688 [Param("VkCmdBuffer", "cmdBuffer"),
689 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600690 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600691 Param("uint32_t", "count"),
692 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800693
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600694 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600695 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600696 Param("uint32_t", "x"),
697 Param("uint32_t", "y"),
698 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800699
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600700 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600701 [Param("VkCmdBuffer", "cmdBuffer"),
702 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600703 Param("VkDeviceSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800704
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600705 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600706 [Param("VkCmdBuffer", "cmdBuffer"),
707 Param("VkBuffer", "srcBuffer"),
708 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600709 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600710 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800711
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600712 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600713 [Param("VkCmdBuffer", "cmdBuffer"),
714 Param("VkImage", "srcImage"),
715 Param("VkImageLayout", "srcImageLayout"),
716 Param("VkImage", "destImage"),
717 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600718 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600719 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800720
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600721 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600722 [Param("VkCmdBuffer", "cmdBuffer"),
723 Param("VkImage", "srcImage"),
724 Param("VkImageLayout", "srcImageLayout"),
725 Param("VkImage", "destImage"),
726 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600727 Param("uint32_t", "regionCount"),
Mark Lobodzinskiee5eef12015-05-22 14:43:25 -0500728 Param("const VkImageBlit*", "pRegions"),
729 Param("VkTexFilter", "filter")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600730
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600731 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600732 [Param("VkCmdBuffer", "cmdBuffer"),
733 Param("VkBuffer", "srcBuffer"),
734 Param("VkImage", "destImage"),
735 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600736 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600737 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800738
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600739 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600740 [Param("VkCmdBuffer", "cmdBuffer"),
741 Param("VkImage", "srcImage"),
742 Param("VkImageLayout", "srcImageLayout"),
743 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600744 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600745 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800746
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600747 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600748 [Param("VkCmdBuffer", "cmdBuffer"),
749 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600750 Param("VkDeviceSize", "destOffset"),
751 Param("VkDeviceSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600752 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800753
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600754 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600755 [Param("VkCmdBuffer", "cmdBuffer"),
756 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600757 Param("VkDeviceSize", "destOffset"),
758 Param("VkDeviceSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600759 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800760
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600761 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600762 [Param("VkCmdBuffer", "cmdBuffer"),
763 Param("VkImage", "image"),
764 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200765 Param("const VkClearColorValue*", "pColor"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600766 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600767 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800768
Chris Forbesd9be82b2015-06-22 17:21:59 +1200769 Proto("void", "CmdClearDepthStencilImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600770 [Param("VkCmdBuffer", "cmdBuffer"),
771 Param("VkImage", "image"),
772 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600773 Param("float", "depth"),
774 Param("uint32_t", "stencil"),
775 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600776 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800777
Chris Forbesd9be82b2015-06-22 17:21:59 +1200778 Proto("void", "CmdClearColorAttachment",
779 [Param("VkCmdBuffer", "cmdBuffer"),
780 Param("uint32_t", "colorAttachment"),
781 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200782 Param("const VkClearColorValue*", "pColor"),
Chris Forbesd9be82b2015-06-22 17:21:59 +1200783 Param("uint32_t", "rectCount"),
784 Param("const VkRect3D*", "pRects")]),
785
786 Proto("void", "CmdClearDepthStencilAttachment",
787 [Param("VkCmdBuffer", "cmdBuffer"),
788 Param("VkImageAspectFlags", "imageAspectMask"),
789 Param("VkImageLayout", "imageLayout"),
790 Param("float", "depth"),
791 Param("uint32_t", "stencil"),
792 Param("uint32_t", "rectCount"),
793 Param("const VkRect3D*", "pRects")]),
794
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600795 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600796 [Param("VkCmdBuffer", "cmdBuffer"),
797 Param("VkImage", "srcImage"),
798 Param("VkImageLayout", "srcImageLayout"),
799 Param("VkImage", "destImage"),
800 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600801 Param("uint32_t", "regionCount"),
802 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800803
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600804 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600805 [Param("VkCmdBuffer", "cmdBuffer"),
806 Param("VkEvent", "event"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600807 Param("VkPipelineStageFlags", "stageMask")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800808
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600809 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600810 [Param("VkCmdBuffer", "cmdBuffer"),
811 Param("VkEvent", "event"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600812 Param("VkPipelineStageFlags", "stageMask")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800813
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600814 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600815 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600816 Param("uint32_t", "eventCount"),
817 Param("const VkEvent*", "pEvents"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600818 Param("VkPipelineStageFlags", "sourceStageMask"),
819 Param("VkPipelineStageFlags", "destStageMask"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600820 Param("uint32_t", "memBarrierCount"),
821 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000822
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600823 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600824 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600825 Param("VkPipelineStageFlags", "sourceStageMask"),
826 Param("VkPipelineStageFlags", "destStageMask"),
827 Param("bool32_t", "byRegion"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600828 Param("uint32_t", "memBarrierCount"),
829 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000830
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600831 Proto("void", "CmdBeginQuery",
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"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600835 Param("VkFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800836
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600837 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600838 [Param("VkCmdBuffer", "cmdBuffer"),
839 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600840 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800841
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600842 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600843 [Param("VkCmdBuffer", "cmdBuffer"),
844 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600845 Param("uint32_t", "startQuery"),
846 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800847
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600848 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600849 [Param("VkCmdBuffer", "cmdBuffer"),
850 Param("VkTimestampType", "timestampType"),
851 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600852 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800853
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600854 Proto("void", "CmdCopyQueryPoolResults",
855 [Param("VkCmdBuffer", "cmdBuffer"),
856 Param("VkQueryPool", "queryPool"),
857 Param("uint32_t", "startQuery"),
858 Param("uint32_t", "queryCount"),
859 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600860 Param("VkDeviceSize", "destOffset"),
861 Param("VkDeviceSize", "destStride"),
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600862 Param("VkFlags", "flags")]),
863
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600864 Proto("VkResult", "CreateFramebuffer",
865 [Param("VkDevice", "device"),
866 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
867 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700868
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600869 Proto("VkResult", "CreateRenderPass",
870 [Param("VkDevice", "device"),
871 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
872 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700873
Jon Ashburne13f1982015-02-02 09:58:11 -0700874 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600875 [Param("VkCmdBuffer", "cmdBuffer"),
876 Param("const VkRenderPassBegin*", "pRenderPassBegin")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700877
878 Proto("void", "CmdEndRenderPass",
Chia-I Wu0b50a1c2015-06-26 15:34:39 +0800879 [Param("VkCmdBuffer", "cmdBuffer")]),
880
881 Proto("void", "CmdExecuteCommands",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600882 [Param("VkCmdBuffer", "cmdBuffer"),
Chia-I Wu0b50a1c2015-06-26 15:34:39 +0800883 Param("uint32_t", "cmdBuffersCount"),
884 Param("const VkCmdBuffer*", "pCmdBuffers")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800885 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800886)
887
Chia-I Wuf8693382015-04-16 22:02:10 +0800888wsi_lunarg = Extension(
889 name="VK_WSI_LunarG",
890 headers=["vk_wsi_lunarg.h"],
891 objects=[
892 "VkDisplayWSI",
893 "VkSwapChainWSI",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600894 "VkDbgMsgCallback",
Chia-I Wuf8693382015-04-16 22:02:10 +0800895 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800896 protos=[
Chia-I Wuf8693382015-04-16 22:02:10 +0800897 Proto("VkResult", "CreateSwapChainWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600898 [Param("VkDevice", "device"),
Chia-I Wuf8693382015-04-16 22:02:10 +0800899 Param("const VkSwapChainCreateInfoWSI*", "pCreateInfo"),
900 Param("VkSwapChainWSI*", "pSwapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800901
Chia-I Wuf8693382015-04-16 22:02:10 +0800902 Proto("VkResult", "DestroySwapChainWSI",
903 [Param("VkSwapChainWSI", "swapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800904
Chia-I Wuf8693382015-04-16 22:02:10 +0800905 Proto("VkResult", "GetSwapChainInfoWSI",
906 [Param("VkSwapChainWSI", "swapChain"),
907 Param("VkSwapChainInfoTypeWSI", "infoType"),
908 Param("size_t*", "pDataSize"),
909 Param("void*", "pData")]),
910
911 Proto("VkResult", "QueuePresentWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600912 [Param("VkQueue", "queue"),
Chia-I Wuf8693382015-04-16 22:02:10 +0800913 Param("const VkPresentInfoWSI*", "pPresentInfo")]),
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600914
915# Proto("VkResult", "DbgCreateMsgCallback",
916# [Param("VkInstance", "instance"),
917# Param("VkFlags", "msgFlags"),
918# Param("PFN_vkDbgMsgCallback", "pfnMsgCallback"),
919# Param("void*", "pUserData"),
920# Param("VkDbgMsgCallback*", "pMsgCallback")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800921 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800922)
923
Chia-I Wuf8693382015-04-16 22:02:10 +0800924extensions = [core, wsi_lunarg]
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800925
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700926object_root_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600927 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -0600928 "VkPhysicalDevice",
Chia-I Wuf8693382015-04-16 22:02:10 +0800929 "VkDisplayWSI",
930 "VkSwapChainWSI",
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700931]
932
933object_base_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600934 "VkDevice",
935 "VkQueue",
Tony Barbourd1c35722015-04-16 15:59:00 -0600936 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600937 "VkObject"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700938]
939
940object_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600941 "VkBuffer",
942 "VkBufferView",
943 "VkImage",
944 "VkImageView",
945 "VkColorAttachmentView",
946 "VkDepthStencilView",
947 "VkShader",
948 "VkPipeline",
Jon Ashburnc669cc62015-07-09 15:02:25 -0600949 "VkPipelineCache",
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500950 "VkPipelineLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600951 "VkSampler",
952 "VkDescriptorSet",
953 "VkDescriptorSetLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600954 "VkDescriptorPool",
955 "VkDynamicStateObject",
956 "VkCmdBuffer",
957 "VkFence",
958 "VkSemaphore",
959 "VkEvent",
960 "VkQueryPool",
961 "VkFramebuffer",
962 "VkRenderPass"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700963]
964
965object_dynamic_state_list = [
Courtney Goeltzenleuchter502744a2015-04-10 16:24:50 -0600966 "VkDynamicVpState",
967 "VkDynamicRsState",
968 "VkDynamicCbState",
969 "VkDynamicDsState"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700970]
971
972object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
973
Mike Stroyanb050c682015-04-17 12:36:38 -0600974object_parent_list = ["VkObject", "VkDynamicStateObject"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700975
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800976headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800977objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800978protos = []
979for ext in extensions:
980 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800981 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800982 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800983
Chia-I Wu9a4ceb12015-01-01 14:45:58 +0800984proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +0800985
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600986def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +0800987 # read object and protoype typedefs
988 object_lines = []
989 proto_lines = []
990 with open(filename, "r") as fp:
991 for line in fp:
992 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600993 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +0800994 begin = line.find("(") + 1
995 end = line.find(",")
996 # extract the object type
997 object_lines.append(line[begin:end])
998 if line.startswith("typedef") and line.endswith(");"):
999 # drop leading "typedef " and trailing ");"
1000 proto_lines.append(line[8:-2])
1001
1002 # parse proto_lines to protos
1003 protos = []
1004 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001005 first, rest = line.split(" (VKAPI *PFN_vk")
1006 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001007
1008 # get the return type, no space before "*"
1009 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1010
1011 # get the name
1012 proto_name = second.strip()
1013
1014 # get the list of params
1015 param_strs = third.split(", ")
1016 params = []
1017 for s in param_strs:
1018 ty, name = s.rsplit(" ", 1)
1019
1020 # no space before "*"
1021 ty = "*".join([t.rstrip() for t in ty.split("*")])
1022 # attach [] to ty
1023 idx = name.rfind("[")
1024 if idx >= 0:
1025 ty += name[idx:]
1026 name = name[:idx]
1027
1028 params.append(Param(ty, name))
1029
1030 protos.append(Proto(proto_ret, proto_name, params))
1031
1032 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001033 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001034 headers=["vulkan.h", "vk_debug_report_lunarg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001035 objects=object_lines,
1036 protos=protos)
1037 print("core =", str(ext))
1038
1039 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001040 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001041 print("{")
1042 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001043 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001044 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001045
1046if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001047 parse_vk_h("include/vulkan.h")