blob: fa7131499c7631980aed1719523c9e0de94ac2a8 [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"],
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800185 objects=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600186 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -0600187 "VkPhysicalDevice",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600188 "VkDevice",
189 "VkQueue",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600190 "VkCmdBuffer",
191 "VkFence",
Tony Barbourd1c35722015-04-16 15:59:00 -0600192 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600193 "VkBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600194 "VkImage",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600195 "VkSemaphore",
196 "VkEvent",
197 "VkQueryPool",
198 "VkBufferView",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600199 "VkImageView",
Chia-I Wu08accc62015-07-07 11:50:03 +0800200 "VkAttachmentView",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600201 "VkShaderModule",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600202 "VkShader",
Tony Barboura05dbaa2015-07-09 17:31:46 -0600203 "VkPipelineCache",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600204 "VkPipelineLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600205 "VkPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600206 "VkDescriptorSetLayout",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600207 "VkSampler",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600208 "VkDescriptorPool",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600209 "VkDescriptorSet",
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600210 "VkDynamicViewportState",
211 "VkDynamicRasterState",
212 "VkDynamicColorBlendState",
213 "VkDynamicDepthStencilState",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600214 "VkRenderPass",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600215 "VkFramebuffer",
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800216 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800217 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600218 Proto("VkResult", "CreateInstance",
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600219 [Param("const VkInstanceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600220 Param("VkInstance*", "pInstance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700221
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600222 Proto("VkResult", "DestroyInstance",
223 [Param("VkInstance", "instance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700224
Jon Ashburn83a64252015-04-15 11:31:12 -0600225 Proto("VkResult", "EnumeratePhysicalDevices",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600226 [Param("VkInstance", "instance"),
Jon Ashburn83a64252015-04-15 11:31:12 -0600227 Param("uint32_t*", "pPhysicalDeviceCount"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600228 Param("VkPhysicalDevice*", "pPhysicalDevices")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700229
Chris Forbesbc0bb772015-06-21 22:55:02 +1200230 Proto("VkResult", "GetPhysicalDeviceFeatures",
231 [Param("VkPhysicalDevice", "physicalDevice"),
232 Param("VkPhysicalDeviceFeatures*", "pFeatures")]),
233
234 Proto("VkResult", "GetPhysicalDeviceFormatInfo",
235 [Param("VkPhysicalDevice", "physicalDevice"),
236 Param("VkFormat", "format"),
237 Param("VkFormatProperties*", "pFormatInfo")]),
238
239 Proto("VkResult", "GetPhysicalDeviceLimits",
240 [Param("VkPhysicalDevice", "physicalDevice"),
241 Param("VkPhysicalDeviceLimits*", "pLimits")]),
242
Jon Ashburnb0fbe912015-05-06 10:15:07 -0600243 Proto("void*", "GetInstanceProcAddr",
244 [Param("VkInstance", "instance"),
245 Param("const char*", "pName")]),
246
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600247 Proto("void*", "GetDeviceProcAddr",
248 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600249 Param("const char*", "pName")]),
Chia-I Wuf2ffc522015-01-04 14:51:06 +0800250
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600251 Proto("VkResult", "CreateDevice",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600252 [Param("VkPhysicalDevice", "physicalDevice"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600253 Param("const VkDeviceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600254 Param("VkDevice*", "pDevice")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800255
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600256 Proto("VkResult", "DestroyDevice",
257 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800258
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600259 Proto("VkResult", "GetPhysicalDeviceProperties",
260 [Param("VkPhysicalDevice", "physicalDevice"),
261 Param("VkPhysicalDeviceProperties*", "pProperties")]),
Tony Barbour59a47322015-06-24 16:06:58 -0600262
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600263 Proto("VkResult", "GetPhysicalDevicePerformance",
264 [Param("VkPhysicalDevice", "physicalDevice"),
265 Param("VkPhysicalDevicePerformance*", "pPerformance")]),
266
267 Proto("VkResult", "GetPhysicalDeviceQueueCount",
268 [Param("VkPhysicalDevice", "physicalDevice"),
269 Param("uint32_t*", "pCount")]),
270
271 Proto("VkResult", "GetPhysicalDeviceQueueProperties",
272 [Param("VkPhysicalDevice", "physicalDevice"),
273 Param("uint32_t", "count"),
274 Param("VkPhysicalDeviceQueueProperties*", "pQueueProperties")]),
275
276 Proto("VkResult", "GetPhysicalDeviceMemoryProperties",
277 [Param("VkPhysicalDevice", "physicalDevice"),
278 Param("VkPhysicalDeviceMemoryProperties*", "pMemoryProperties")]),
Tony Barbour59a47322015-06-24 16:06:58 -0600279
280 Proto("VkResult", "GetGlobalExtensionProperties",
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600281 [Param("const char*", "pLayerName"),
282 Param("uint32_t*", "pCount"),
Tony Barbour59a47322015-06-24 16:06:58 -0600283 Param("VkExtensionProperties*", "pProperties")]),
284
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600285 Proto("VkResult", "GetPhysicalDeviceExtensionProperties",
286 [Param("VkPhysicalDevice", "physicalDevice"),
287 Param("const char*", "pLayerName"),
288 Param("uint32_t", "*pCount"),
289 Param("VkExtensionProperties*", "pProperties")]),
290
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600291 Proto("VkResult", "GetGlobalLayerProperties",
292 [Param("uint32_t*", "pCount"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600293 Param("VkLayerProperties*", "pProperties")]),
294
295 Proto("VkResult", "GetPhysicalDeviceLayerProperties",
296 [Param("VkPhysicalDevice", "physicalDevice"),
297 Param("uint32_t", "*pCount"),
298 Param("VkLayerProperties*", "pProperties")]),
Tobin Ehlis01939012015-04-16 12:51:37 -0600299
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600300 Proto("VkResult", "GetDeviceQueue",
301 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter18248e62015-03-05 18:09:39 -0700302 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600303 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600304 Param("VkQueue*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800305
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600306 Proto("VkResult", "QueueSubmit",
307 [Param("VkQueue", "queue"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600308 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600309 Param("const VkCmdBuffer*", "pCmdBuffers"),
310 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800311
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600312 Proto("VkResult", "QueueWaitIdle",
313 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800314
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600315 Proto("VkResult", "DeviceWaitIdle",
316 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800317
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600318 Proto("VkResult", "AllocMemory",
319 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600320 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600321 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800322
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600323 Proto("VkResult", "FreeMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600324 [Param("VkDevice", "device"),
325 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800326
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600327 Proto("VkResult", "MapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600328 [Param("VkDevice", "device"),
329 Param("VkDeviceMemory", "mem"),
Tony Barbour71a85122015-04-16 19:09:28 -0600330 Param("VkDeviceSize", "offset"),
331 Param("VkDeviceSize", "size"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600332 Param("VkMemoryMapFlags", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600333 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800334
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600335 Proto("VkResult", "UnmapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600336 [Param("VkDevice", "device"),
337 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800338
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600339 Proto("VkResult", "FlushMappedMemoryRanges",
Mike Stroyanb050c682015-04-17 12:36:38 -0600340 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600341 Param("uint32_t", "memRangeCount"),
342 Param("const VkMappedMemoryRange*", "pMemRanges")]),
343
344 Proto("VkResult", "InvalidateMappedMemoryRanges",
345 [Param("VkDevice", "device"),
346 Param("uint32_t", "memRangeCount"),
347 Param("const VkMappedMemoryRange*", "pMemRanges")]),
Tony Barbourb1250542015-04-16 19:23:13 -0600348
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600349 Proto("VkResult", "GetDeviceMemoryCommitment",
350 [Param("VkDevice", "device"),
351 Param("VkDeviceMemory", "memory"),
352 Param("VkDeviceSize*", "pCommittedMemoryInBytes")]),
353
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600354 Proto("VkResult", "BindBufferMemory",
355 [Param("VkDevice", "device"),
356 Param("VkBuffer", "buffer"),
357 Param("VkDeviceMemory", "mem"),
358 Param("VkDeviceSize", "memOffset")]),
359
360 Proto("VkResult", "BindImageMemory",
361 [Param("VkDevice", "device"),
362 Param("VkImage", "image"),
363 Param("VkDeviceMemory", "mem"),
364 Param("VkDeviceSize", "memOffset")]),
365
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600366 Proto("VkResult", "GetBufferMemoryRequirements",
Mike Stroyanb050c682015-04-17 12:36:38 -0600367 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600368 Param("VkBuffer", "buffer"),
Tony Barbour59a47322015-06-24 16:06:58 -0600369 Param("VkMemoryRequirements*", "pMemoryRequirements")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800370
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600371 Proto("VkResult", "GetImageMemoryRequirements",
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500372 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600373 Param("VkImage", "image"),
374 Param("VkMemoryRequirements*", "pMemoryRequirements")]),
375
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600376 Proto("VkResult", "GetImageSparseMemoryRequirements",
377 [Param("VkDevice", "device"),
378 Param("VkImage", "image"),
379 Param("uint32_t*", "pNumRequirements"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600380 Param("VkSparseImageMemoryRequirements*", "pSparseMemoryRequirements")]),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600381
382 Proto("VkResult", "GetPhysicalDeviceSparseImageFormatProperties",
383 [Param("VkPhysicalDevice", "physicalDevice"),
384 Param("VkFormat", "format"),
385 Param("VkImageType", "type"),
386 Param("uint32_t", "samples"),
387 Param("VkImageUsageFlags", "usage"),
388 Param("VkImageTiling", "tiling"),
389 Param("uint32_t*", "pNumProperties"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600390 Param("VkSparseImageFormatProperties*", "pProperties")]),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600391
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500392 Proto("VkResult", "QueueBindSparseBufferMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500393 [Param("VkQueue", "queue"),
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500394 Param("VkBuffer", "buffer"),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600395 Param("uint32_t", "numBindings"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600396 Param("const VkSparseMemoryBindInfo*", "pBindInfo")]),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600397
398 Proto("VkResult", "QueueBindSparseImageOpaqueMemory",
399 [Param("VkQueue", "queue"),
400 Param("VkImage", "image"),
401 Param("uint32_t", "numBindings"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600402 Param("const VkSparseMemoryBindInfo*", "pBindInfo")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800403
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500404 Proto("VkResult", "QueueBindSparseImageMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500405 [Param("VkQueue", "queue"),
406 Param("VkImage", "image"),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600407 Param("uint32_t", "numBindings"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600408 Param("const VkSparseImageMemoryBindInfo*", "pBindInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800409
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600410 Proto("VkResult", "CreateFence",
411 [Param("VkDevice", "device"),
412 Param("const VkFenceCreateInfo*", "pCreateInfo"),
413 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800414
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600415 Proto("VkResult", "DestroyFence",
416 [Param("VkDevice", "device"),
417 Param("VkFence", "fence")]),
418
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600419 Proto("VkResult", "ResetFences",
420 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500421 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchter2bf8f902015-06-18 17:28:20 -0600422 Param("const VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500423
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600424 Proto("VkResult", "GetFenceStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600425 [Param("VkDevice", "device"),
426 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800427
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600428 Proto("VkResult", "WaitForFences",
429 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600430 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600431 Param("const VkFence*", "pFences"),
Courtney Goeltzenleuchtercd2a0992015-07-09 11:44:38 -0600432 Param("VkBool32", "waitAll"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600433 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800434
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600435 Proto("VkResult", "CreateSemaphore",
436 [Param("VkDevice", "device"),
437 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
438 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800439
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600440 Proto("VkResult", "DestroySemaphore",
441 [Param("VkDevice", "device"),
442 Param("VkSemaphore", "semaphore")]),
443
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600444 Proto("VkResult", "QueueSignalSemaphore",
445 [Param("VkQueue", "queue"),
446 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800447
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600448 Proto("VkResult", "QueueWaitSemaphore",
449 [Param("VkQueue", "queue"),
450 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800451
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600452 Proto("VkResult", "CreateEvent",
453 [Param("VkDevice", "device"),
454 Param("const VkEventCreateInfo*", "pCreateInfo"),
455 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800456
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600457 Proto("VkResult", "DestroyEvent",
458 [Param("VkDevice", "device"),
459 Param("VkEvent", "event")]),
460
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600461 Proto("VkResult", "GetEventStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600462 [Param("VkDevice", "device"),
463 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800464
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600465 Proto("VkResult", "SetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600466 [Param("VkDevice", "device"),
467 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800468
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600469 Proto("VkResult", "ResetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600470 [Param("VkDevice", "device"),
471 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800472
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600473 Proto("VkResult", "CreateQueryPool",
474 [Param("VkDevice", "device"),
475 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
476 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800477
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600478 Proto("VkResult", "DestroyQueryPool",
479 [Param("VkDevice", "device"),
480 Param("VkQueryPool", "queryPool")]),
481
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600482 Proto("VkResult", "GetQueryPoolResults",
Mike Stroyanb050c682015-04-17 12:36:38 -0600483 [Param("VkDevice", "device"),
484 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600485 Param("uint32_t", "startQuery"),
486 Param("uint32_t", "queryCount"),
487 Param("size_t*", "pDataSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600488 Param("void*", "pData"),
489 Param("VkQueryResultFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800490
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600491 Proto("VkResult", "CreateBuffer",
492 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600493 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600494 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800495
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600496 Proto("VkResult", "DestroyBuffer",
497 [Param("VkDevice", "device"),
498 Param("VkBuffer", "buffer")]),
499
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600500 Proto("VkResult", "CreateBufferView",
501 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600502 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600503 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800504
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600505 Proto("VkResult", "DestroyBufferView",
506 [Param("VkDevice", "device"),
507 Param("VkBufferView", "bufferView")]),
508
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600509 Proto("VkResult", "CreateImage",
510 [Param("VkDevice", "device"),
511 Param("const VkImageCreateInfo*", "pCreateInfo"),
512 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800513
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600514 Proto("VkResult", "DestroyImage",
515 [Param("VkDevice", "device"),
516 Param("VkImage", "image")]),
517
Tony Barbour59a47322015-06-24 16:06:58 -0600518 Proto("VkResult", "GetImageSubresourceLayout",
Mike Stroyanb050c682015-04-17 12:36:38 -0600519 [Param("VkDevice", "device"),
520 Param("VkImage", "image"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600521 Param("const VkImageSubresource*", "pSubresource"),
Tony Barbour59a47322015-06-24 16:06:58 -0600522 Param("VkSubresourceLayout*", "pLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800523
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600524 Proto("VkResult", "CreateImageView",
525 [Param("VkDevice", "device"),
526 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
527 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800528
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600529 Proto("VkResult", "DestroyImageView",
530 [Param("VkDevice", "device"),
531 Param("VkImageView", "imageView")]),
532
Chia-I Wu08accc62015-07-07 11:50:03 +0800533 Proto("VkResult", "CreateAttachmentView",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600534 [Param("VkDevice", "device"),
Chia-I Wu08accc62015-07-07 11:50:03 +0800535 Param("const VkAttachmentViewCreateInfo*", "pCreateInfo"),
536 Param("VkAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800537
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600538 Proto("VkResult", "DestroyAttachmentView",
539 [Param("VkDevice", "device"),
540 Param("VkAttachmentView", "attachmentView")]),
541
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600542 Proto("VkResult", "CreateShaderModule",
543 [Param("VkDevice", "device"),
544 Param("const VkShaderModuleCreateInfo*", "pCreateInfo"),
545 Param("VkShaderModule*", "pShaderModule")]),
546
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600547 Proto("VkResult", "DestroyShaderModule",
548 [Param("VkDevice", "device"),
549 Param("VkShaderModule", "shaderModule")]),
550
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600551 Proto("VkResult", "CreateShader",
552 [Param("VkDevice", "device"),
553 Param("const VkShaderCreateInfo*", "pCreateInfo"),
554 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800555
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600556 Proto("VkResult", "DestroyShader",
557 [Param("VkDevice", "device"),
558 Param("VkShader", "shader")]),
559
Jon Ashburnc669cc62015-07-09 15:02:25 -0600560 Proto("VkResult", "CreatePipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600561 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600562 Param("const VkPipelineCacheCreateInfo*", "pCreateInfo"),
563 Param("VkPipelineCache*", "pPipelineCache")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800564
Jon Ashburnc669cc62015-07-09 15:02:25 -0600565 Proto("VkResult", "DestroyPipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600566 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600567 Param("VkPipelineCache", "pipelineCache")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600568
Jon Ashburnc669cc62015-07-09 15:02:25 -0600569 Proto("size_t", "GetPipelineCacheSize",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600570 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600571 Param("VkPipelineCache", "pipelineCache")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800572
Jon Ashburnc669cc62015-07-09 15:02:25 -0600573 Proto("VkResult", "GetPipelineCacheData",
Mike Stroyanb050c682015-04-17 12:36:38 -0600574 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600575 Param("VkPipelineCache", "pipelineCache"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600576 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800577
Jon Ashburnc669cc62015-07-09 15:02:25 -0600578 Proto("VkResult", "MergePipelineCaches",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600579 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600580 Param("VkPipelineCache", "destCache"),
581 Param("uint32_t", "srcCacheCount"),
582 Param("const VkPipelineCache*", "pSrcCaches")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800583
Jon Ashburnc669cc62015-07-09 15:02:25 -0600584 Proto("VkResult", "CreateGraphicsPipelines",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600585 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600586 Param("VkPipelineCache", "pipelineCache"),
587 Param("uint32_t", "count"),
588 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfos"),
589 Param("VkPipeline*", "pPipelines")]),
590
591 Proto("VkResult", "CreateComputePipelines",
592 [Param("VkDevice", "device"),
593 Param("VkPipelineCache", "pipelineCache"),
594 Param("uint32_t", "count"),
595 Param("const VkComputePipelineCreateInfo*", "pCreateInfos"),
596 Param("VkPipeline*", "pPipelines")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800597
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600598 Proto("VkResult", "DestroyPipeline",
599 [Param("VkDevice", "device"),
600 Param("VkPipeline", "pipeline")]),
601
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500602 Proto("VkResult", "CreatePipelineLayout",
603 [Param("VkDevice", "device"),
604 Param("const VkPipelineLayoutCreateInfo*", "pCreateInfo"),
605 Param("VkPipelineLayout*", "pPipelineLayout")]),
606
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600607 Proto("VkResult", "DestroyPipelineLayout",
608 [Param("VkDevice", "device"),
609 Param("VkPipelineLayout", "pipelineLayout")]),
610
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600611 Proto("VkResult", "CreateSampler",
612 [Param("VkDevice", "device"),
613 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
614 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800615
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600616 Proto("VkResult", "DestroySampler",
617 [Param("VkDevice", "device"),
618 Param("VkSampler", "sampler")]),
619
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600620 Proto("VkResult", "CreateDescriptorSetLayout",
621 [Param("VkDevice", "device"),
622 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
623 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800624
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600625 Proto("VkResult", "DestroyDescriptorSetLayout",
626 [Param("VkDevice", "device"),
627 Param("VkDescriptorSetLayout", "descriptorSetLayout")]),
628
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600629 Proto("VkResult", "CreateDescriptorPool",
630 [Param("VkDevice", "device"),
631 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600632 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600633 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
634 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800635
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600636 Proto("VkResult", "DestroyDescriptorPool",
637 [Param("VkDevice", "device"),
638 Param("VkDescriptorPool", "descriptorPool")]),
639
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600640 Proto("VkResult", "ResetDescriptorPool",
Mike Stroyanb050c682015-04-17 12:36:38 -0600641 [Param("VkDevice", "device"),
642 Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800643
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600644 Proto("VkResult", "AllocDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600645 [Param("VkDevice", "device"),
646 Param("VkDescriptorPool", "descriptorPool"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600647 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600648 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600649 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
650 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600651 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800652
Tony Barbour34ec6922015-07-10 10:50:45 -0600653 Proto("VkResult", "FreeDescriptorSets",
654 [Param("VkDevice", "device"),
655 Param("VkDescriptorPool", "descriptorPool"),
656 Param("uint32_t", "count"),
657 Param("const VkDescriptorSet*", "pDescriptorSets")]),
658
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800659 Proto("VkResult", "UpdateDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600660 [Param("VkDevice", "device"),
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800661 Param("uint32_t", "writeCount"),
662 Param("const VkWriteDescriptorSet*", "pDescriptorWrites"),
663 Param("uint32_t", "copyCount"),
664 Param("const VkCopyDescriptorSet*", "pDescriptorCopies")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800665
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600666 Proto("VkResult", "CreateDynamicViewportState",
667 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600668 Param("const VkDynamicViewportStateCreateInfo*", "pCreateInfo"),
669 Param("VkDynamicViewportState*", "pState")]),
670
671 Proto("VkResult", "DestroyDynamicViewportState",
672 [Param("VkDevice", "device"),
673 Param("VkDynamicViewportState", "dynamicViewportState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800674
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600675 Proto("VkResult", "CreateDynamicRasterState",
676 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600677 Param("const VkDynamicRasterStateCreateInfo*", "pCreateInfo"),
678 Param("VkDynamicRasterState*", "pState")]),
679
680 Proto("VkResult", "DestroyDynamicRasterState",
681 [Param("VkDevice", "device"),
682 Param("VkDynamicRasterState", "dynamicRasterState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800683
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600684 Proto("VkResult", "CreateDynamicColorBlendState",
685 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600686 Param("const VkDynamicColorBlendStateCreateInfo*", "pCreateInfo"),
687 Param("VkDynamicColorBlendState*", "pState")]),
688
689 Proto("VkResult", "DestroyDynamicColorBlendState",
690 [Param("VkDevice", "device"),
691 Param("VkDynamicColorBlendState", "dynamicColorBlendState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800692
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600693 Proto("VkResult", "CreateDynamicDepthStencilState",
694 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600695 Param("const VkDynamicDepthStencilStateCreateInfo*", "pCreateInfo"),
696 Param("VkDynamicDepthStencilState*", "pState")]),
697
698 Proto("VkResult", "DestroyDynamicDepthStencilState",
699 [Param("VkDevice", "device"),
700 Param("VkDynamicDepthStencilState", "dynamicDepthStencilState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800701
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600702 Proto("VkResult", "CreateCommandBuffer",
703 [Param("VkDevice", "device"),
704 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
705 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800706
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600707 Proto("VkResult", "DestroyCommandBuffer",
708 [Param("VkDevice", "device"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600709 Param("VkCmdBuffer", "commandBuffer")]),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600710
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600711 Proto("VkResult", "BeginCommandBuffer",
712 [Param("VkCmdBuffer", "cmdBuffer"),
713 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800714
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600715 Proto("VkResult", "EndCommandBuffer",
716 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800717
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600718 Proto("VkResult", "ResetCommandBuffer",
719 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800720
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600721 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600722 [Param("VkCmdBuffer", "cmdBuffer"),
723 Param("VkPipelineBindPoint", "pipelineBindPoint"),
724 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800725
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600726 Proto("void", "CmdBindDynamicViewportState",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600727 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600728 Param("VkDynamicViewportState", "dynamicViewportState")]),
729
730 Proto("void", "CmdBindDynamicRasterState",
731 [Param("VkCmdBuffer", "cmdBuffer"),
732 Param("VkDynamicRasterState", "dynamicRasterState")]),
733
734 Proto("void", "CmdBindDynamicColorBlendState",
735 [Param("VkCmdBuffer", "cmdBuffer"),
736 Param("VkDynamicColorBlendState", "dynamicColorBlendState")]),
737
738 Proto("void", "CmdBindDynamicDepthStencilState",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600739 [Param("VkCmdBuffer", "cmdBuffer"),
740 Param("VkDynamicDepthStencilState", "dynamicDepthStencilState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800741
Chia-I Wu53f07d72015-03-28 15:23:55 +0800742 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600743 [Param("VkCmdBuffer", "cmdBuffer"),
744 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskif2093b62015-06-15 13:21:21 -0600745 Param("VkPipelineLayout", "layout"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600746 Param("uint32_t", "firstSet"),
747 Param("uint32_t", "setCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600748 Param("const VkDescriptorSet*", "pDescriptorSets"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600749 Param("uint32_t", "dynamicOffsetCount"),
750 Param("const uint32_t*", "pDynamicOffsets")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800751
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600752 Proto("void", "CmdBindIndexBuffer",
753 [Param("VkCmdBuffer", "cmdBuffer"),
754 Param("VkBuffer", "buffer"),
755 Param("VkDeviceSize", "offset"),
756 Param("VkIndexType", "indexType")]),
757
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600758 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600759 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600760 Param("uint32_t", "startBinding"),
761 Param("uint32_t", "bindingCount"),
762 Param("const VkBuffer*", "pBuffers"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600763 Param("const VkDeviceSize*", "pOffsets")]),
764
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600765 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600766 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600767 Param("uint32_t", "firstVertex"),
768 Param("uint32_t", "vertexCount"),
769 Param("uint32_t", "firstInstance"),
770 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800771
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600772 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600773 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600774 Param("uint32_t", "firstIndex"),
775 Param("uint32_t", "indexCount"),
776 Param("int32_t", "vertexOffset"),
777 Param("uint32_t", "firstInstance"),
778 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800779
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600780 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600781 [Param("VkCmdBuffer", "cmdBuffer"),
782 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600783 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600784 Param("uint32_t", "count"),
785 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800786
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600787 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600788 [Param("VkCmdBuffer", "cmdBuffer"),
789 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600790 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600791 Param("uint32_t", "count"),
792 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800793
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600794 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600795 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600796 Param("uint32_t", "x"),
797 Param("uint32_t", "y"),
798 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800799
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600800 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600801 [Param("VkCmdBuffer", "cmdBuffer"),
802 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600803 Param("VkDeviceSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800804
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600805 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600806 [Param("VkCmdBuffer", "cmdBuffer"),
807 Param("VkBuffer", "srcBuffer"),
808 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600809 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600810 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800811
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600812 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600813 [Param("VkCmdBuffer", "cmdBuffer"),
814 Param("VkImage", "srcImage"),
815 Param("VkImageLayout", "srcImageLayout"),
816 Param("VkImage", "destImage"),
817 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600818 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600819 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800820
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600821 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600822 [Param("VkCmdBuffer", "cmdBuffer"),
823 Param("VkImage", "srcImage"),
824 Param("VkImageLayout", "srcImageLayout"),
825 Param("VkImage", "destImage"),
826 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600827 Param("uint32_t", "regionCount"),
Mark Lobodzinskiee5eef12015-05-22 14:43:25 -0500828 Param("const VkImageBlit*", "pRegions"),
829 Param("VkTexFilter", "filter")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600830
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600831 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600832 [Param("VkCmdBuffer", "cmdBuffer"),
833 Param("VkBuffer", "srcBuffer"),
834 Param("VkImage", "destImage"),
835 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600836 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600837 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800838
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600839 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600840 [Param("VkCmdBuffer", "cmdBuffer"),
841 Param("VkImage", "srcImage"),
842 Param("VkImageLayout", "srcImageLayout"),
843 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600844 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600845 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800846
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600847 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600848 [Param("VkCmdBuffer", "cmdBuffer"),
849 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600850 Param("VkDeviceSize", "destOffset"),
851 Param("VkDeviceSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600852 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800853
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600854 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600855 [Param("VkCmdBuffer", "cmdBuffer"),
856 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600857 Param("VkDeviceSize", "destOffset"),
858 Param("VkDeviceSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600859 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800860
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600861 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600862 [Param("VkCmdBuffer", "cmdBuffer"),
863 Param("VkImage", "image"),
864 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200865 Param("const VkClearColorValue*", "pColor"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600866 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600867 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800868
Chris Forbesd9be82b2015-06-22 17:21:59 +1200869 Proto("void", "CmdClearDepthStencilImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600870 [Param("VkCmdBuffer", "cmdBuffer"),
871 Param("VkImage", "image"),
872 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600873 Param("float", "depth"),
874 Param("uint32_t", "stencil"),
875 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600876 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800877
Chris Forbesd9be82b2015-06-22 17:21:59 +1200878 Proto("void", "CmdClearColorAttachment",
879 [Param("VkCmdBuffer", "cmdBuffer"),
880 Param("uint32_t", "colorAttachment"),
881 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200882 Param("const VkClearColorValue*", "pColor"),
Chris Forbesd9be82b2015-06-22 17:21:59 +1200883 Param("uint32_t", "rectCount"),
884 Param("const VkRect3D*", "pRects")]),
885
886 Proto("void", "CmdClearDepthStencilAttachment",
887 [Param("VkCmdBuffer", "cmdBuffer"),
888 Param("VkImageAspectFlags", "imageAspectMask"),
889 Param("VkImageLayout", "imageLayout"),
890 Param("float", "depth"),
891 Param("uint32_t", "stencil"),
892 Param("uint32_t", "rectCount"),
893 Param("const VkRect3D*", "pRects")]),
894
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600895 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600896 [Param("VkCmdBuffer", "cmdBuffer"),
897 Param("VkImage", "srcImage"),
898 Param("VkImageLayout", "srcImageLayout"),
899 Param("VkImage", "destImage"),
900 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600901 Param("uint32_t", "regionCount"),
902 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800903
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600904 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600905 [Param("VkCmdBuffer", "cmdBuffer"),
906 Param("VkEvent", "event"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600907 Param("VkPipelineStageFlags", "stageMask")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800908
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600909 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600910 [Param("VkCmdBuffer", "cmdBuffer"),
911 Param("VkEvent", "event"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600912 Param("VkPipelineStageFlags", "stageMask")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800913
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600914 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600915 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600916 Param("uint32_t", "eventCount"),
917 Param("const VkEvent*", "pEvents"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600918 Param("VkPipelineStageFlags", "sourceStageMask"),
919 Param("VkPipelineStageFlags", "destStageMask"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600920 Param("uint32_t", "memBarrierCount"),
921 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000922
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600923 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600924 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600925 Param("VkPipelineStageFlags", "sourceStageMask"),
926 Param("VkPipelineStageFlags", "destStageMask"),
Courtney Goeltzenleuchtercd2a0992015-07-09 11:44:38 -0600927 Param("VkBool32", "byRegion"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600928 Param("uint32_t", "memBarrierCount"),
929 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000930
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600931 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600932 [Param("VkCmdBuffer", "cmdBuffer"),
933 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600934 Param("uint32_t", "slot"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600935 Param("VkQueryControlFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800936
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600937 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600938 [Param("VkCmdBuffer", "cmdBuffer"),
939 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600940 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800941
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600942 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600943 [Param("VkCmdBuffer", "cmdBuffer"),
944 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600945 Param("uint32_t", "startQuery"),
946 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800947
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600948 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600949 [Param("VkCmdBuffer", "cmdBuffer"),
950 Param("VkTimestampType", "timestampType"),
951 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600952 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800953
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600954 Proto("void", "CmdCopyQueryPoolResults",
955 [Param("VkCmdBuffer", "cmdBuffer"),
956 Param("VkQueryPool", "queryPool"),
957 Param("uint32_t", "startQuery"),
958 Param("uint32_t", "queryCount"),
959 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600960 Param("VkDeviceSize", "destOffset"),
961 Param("VkDeviceSize", "destStride"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600962 Param("VkQueryResultFlags", "flags")]),
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600963
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600964 Proto("VkResult", "CreateFramebuffer",
965 [Param("VkDevice", "device"),
966 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
967 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700968
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600969 Proto("VkResult", "DestroyFramebuffer",
970 [Param("VkDevice", "device"),
971 Param("VkFramebuffer", "framebuffer")]),
972
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600973 Proto("VkResult", "CreateRenderPass",
974 [Param("VkDevice", "device"),
975 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
976 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700977
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600978 Proto("VkResult", "DestroyRenderPass",
979 [Param("VkDevice", "device"),
980 Param("VkRenderPass", "renderPass")]),
981
Jon Ashburne13f1982015-02-02 09:58:11 -0700982 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600983 [Param("VkCmdBuffer", "cmdBuffer"),
Chia-I Wu08accc62015-07-07 11:50:03 +0800984 Param("const VkRenderPassBeginInfo*", "pRenderPassBegin"),
985 Param("VkRenderPassContents", "contents")]),
986
987 Proto("void", "CmdNextSubpass",
988 [Param("VkCmdBuffer", "cmdBuffer"),
989 Param("VkRenderPassContents", "contents")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700990
991 Proto("void", "CmdEndRenderPass",
Chia-I Wu0b50a1c2015-06-26 15:34:39 +0800992 [Param("VkCmdBuffer", "cmdBuffer")]),
993
994 Proto("void", "CmdExecuteCommands",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600995 [Param("VkCmdBuffer", "cmdBuffer"),
Chia-I Wu0b50a1c2015-06-26 15:34:39 +0800996 Param("uint32_t", "cmdBuffersCount"),
997 Param("const VkCmdBuffer*", "pCmdBuffers")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800998 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800999)
1000
Chia-I Wuf8693382015-04-16 22:02:10 +08001001wsi_lunarg = Extension(
1002 name="VK_WSI_LunarG",
1003 headers=["vk_wsi_lunarg.h"],
1004 objects=[
1005 "VkDisplayWSI",
1006 "VkSwapChainWSI",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001007 "VkDbgMsgCallback",
Chia-I Wuf8693382015-04-16 22:02:10 +08001008 ],
Chia-I Wue442dc32015-01-01 09:31:15 +08001009 protos=[
Chia-I Wuf8693382015-04-16 22:02:10 +08001010 Proto("VkResult", "CreateSwapChainWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001011 [Param("VkDevice", "device"),
Chia-I Wuf8693382015-04-16 22:02:10 +08001012 Param("const VkSwapChainCreateInfoWSI*", "pCreateInfo"),
1013 Param("VkSwapChainWSI*", "pSwapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001014
Chia-I Wuf8693382015-04-16 22:02:10 +08001015 Proto("VkResult", "DestroySwapChainWSI",
1016 [Param("VkSwapChainWSI", "swapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001017
Chia-I Wuf8693382015-04-16 22:02:10 +08001018 Proto("VkResult", "GetSwapChainInfoWSI",
1019 [Param("VkSwapChainWSI", "swapChain"),
1020 Param("VkSwapChainInfoTypeWSI", "infoType"),
1021 Param("size_t*", "pDataSize"),
1022 Param("void*", "pData")]),
1023
1024 Proto("VkResult", "QueuePresentWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001025 [Param("VkQueue", "queue"),
Chia-I Wuf8693382015-04-16 22:02:10 +08001026 Param("const VkPresentInfoWSI*", "pPresentInfo")]),
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001027
1028# Proto("VkResult", "DbgCreateMsgCallback",
1029# [Param("VkInstance", "instance"),
1030# Param("VkFlags", "msgFlags"),
1031# Param("PFN_vkDbgMsgCallback", "pfnMsgCallback"),
1032# Param("void*", "pUserData"),
1033# Param("VkDbgMsgCallback*", "pMsgCallback")]),
Chia-I Wue442dc32015-01-01 09:31:15 +08001034 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001035)
1036
Chia-I Wuf8693382015-04-16 22:02:10 +08001037extensions = [core, wsi_lunarg]
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001038
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001039object_dispatch_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001040 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -06001041 "VkPhysicalDevice",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001042 "VkDevice",
1043 "VkQueue",
1044 "VkCmdBuffer",
Chia-I Wuf8693382015-04-16 22:02:10 +08001045 "VkDisplayWSI",
1046 "VkSwapChainWSI",
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001047]
1048
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001049object_non_dispatch_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001050 "VkFence",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001051 "VkDeviceMemory",
1052 "VkBuffer",
1053 "VkImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001054 "VkSemaphore",
1055 "VkEvent",
1056 "VkQueryPool",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001057 "VkBufferView",
1058 "VkImageView",
1059 "VkAttachmentView",
1060 "VkShaderModule",
1061 "VkShader",
1062 "VkPipelineCache",
1063 "VkPipelineLayout",
1064 "VkPipeline",
1065 "VkDescriptorSetLayout",
1066 "VkSampler",
1067 "VkDescriptorPool",
1068 "VkDescriptorSet",
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001069 "VkDynamicViewportState",
1070 "VkDynamicRasterState",
1071 "VkDynamicColorBlendState",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001072 "VkDynamicDepthStencilState",
1073 "VkRenderPass",
1074 "VkFramebuffer",
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001075]
1076
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001077object_type_list = object_dispatch_list + object_non_dispatch_list
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001078
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001079headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001080objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001081protos = []
1082for ext in extensions:
1083 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001084 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001085 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001086
Chia-I Wu9a4ceb12015-01-01 14:45:58 +08001087proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +08001088
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001089def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +08001090 # read object and protoype typedefs
1091 object_lines = []
1092 proto_lines = []
1093 with open(filename, "r") as fp:
1094 for line in fp:
1095 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001096 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +08001097 begin = line.find("(") + 1
1098 end = line.find(",")
1099 # extract the object type
1100 object_lines.append(line[begin:end])
1101 if line.startswith("typedef") and line.endswith(");"):
1102 # drop leading "typedef " and trailing ");"
1103 proto_lines.append(line[8:-2])
1104
1105 # parse proto_lines to protos
1106 protos = []
1107 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001108 first, rest = line.split(" (VKAPI *PFN_vk")
1109 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001110
1111 # get the return type, no space before "*"
1112 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1113
1114 # get the name
1115 proto_name = second.strip()
1116
1117 # get the list of params
1118 param_strs = third.split(", ")
1119 params = []
1120 for s in param_strs:
1121 ty, name = s.rsplit(" ", 1)
1122
1123 # no space before "*"
1124 ty = "*".join([t.rstrip() for t in ty.split("*")])
1125 # attach [] to ty
1126 idx = name.rfind("[")
1127 if idx >= 0:
1128 ty += name[idx:]
1129 name = name[:idx]
1130
1131 params.append(Param(ty, name))
1132
1133 protos.append(Proto(proto_ret, proto_name, params))
1134
1135 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001136 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001137 headers=["vulkan.h", "vk_debug_report_lunarg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001138 objects=object_lines,
1139 protos=protos)
1140 print("core =", str(ext))
1141
1142 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001143 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001144 print("{")
1145 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001146 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001147 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001148
1149if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001150 parse_vk_h("include/vulkan.h")