blob: 8db4334be326b102771ed66dfc4ea01a3c970125 [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",
Cody Northrope62183e2015-07-09 18:08:05 -0600191 "VkCmdPool",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600192 "VkFence",
Tony Barbourd1c35722015-04-16 15:59:00 -0600193 "VkDeviceMemory",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600194 "VkBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600195 "VkImage",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600196 "VkSemaphore",
197 "VkEvent",
198 "VkQueryPool",
199 "VkBufferView",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600200 "VkImageView",
Chia-I Wu08accc62015-07-07 11:50:03 +0800201 "VkAttachmentView",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600202 "VkShaderModule",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600203 "VkShader",
Tony Barboura05dbaa2015-07-09 17:31:46 -0600204 "VkPipelineCache",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600205 "VkPipelineLayout",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600206 "VkPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600207 "VkDescriptorSetLayout",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600208 "VkSampler",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600209 "VkDescriptorPool",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600210 "VkDescriptorSet",
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600211 "VkDynamicViewportState",
212 "VkDynamicRasterState",
213 "VkDynamicColorBlendState",
214 "VkDynamicDepthStencilState",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600215 "VkRenderPass",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600216 "VkFramebuffer",
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800217 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800218 protos=[
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600219 Proto("VkResult", "CreateInstance",
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600220 [Param("const VkInstanceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600221 Param("VkInstance*", "pInstance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700222
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600223 Proto("VkResult", "DestroyInstance",
224 [Param("VkInstance", "instance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700225
Jon Ashburn83a64252015-04-15 11:31:12 -0600226 Proto("VkResult", "EnumeratePhysicalDevices",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600227 [Param("VkInstance", "instance"),
Jon Ashburn83a64252015-04-15 11:31:12 -0600228 Param("uint32_t*", "pPhysicalDeviceCount"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600229 Param("VkPhysicalDevice*", "pPhysicalDevices")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700230
Chris Forbesbc0bb772015-06-21 22:55:02 +1200231 Proto("VkResult", "GetPhysicalDeviceFeatures",
232 [Param("VkPhysicalDevice", "physicalDevice"),
233 Param("VkPhysicalDeviceFeatures*", "pFeatures")]),
234
235 Proto("VkResult", "GetPhysicalDeviceFormatInfo",
236 [Param("VkPhysicalDevice", "physicalDevice"),
237 Param("VkFormat", "format"),
238 Param("VkFormatProperties*", "pFormatInfo")]),
239
240 Proto("VkResult", "GetPhysicalDeviceLimits",
241 [Param("VkPhysicalDevice", "physicalDevice"),
242 Param("VkPhysicalDeviceLimits*", "pLimits")]),
243
Jon Ashburnb0fbe912015-05-06 10:15:07 -0600244 Proto("void*", "GetInstanceProcAddr",
245 [Param("VkInstance", "instance"),
246 Param("const char*", "pName")]),
247
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600248 Proto("void*", "GetDeviceProcAddr",
249 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600250 Param("const char*", "pName")]),
Chia-I Wuf2ffc522015-01-04 14:51:06 +0800251
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600252 Proto("VkResult", "CreateDevice",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600253 [Param("VkPhysicalDevice", "physicalDevice"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600254 Param("const VkDeviceCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600255 Param("VkDevice*", "pDevice")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800256
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600257 Proto("VkResult", "DestroyDevice",
258 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800259
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600260 Proto("VkResult", "GetPhysicalDeviceProperties",
261 [Param("VkPhysicalDevice", "physicalDevice"),
262 Param("VkPhysicalDeviceProperties*", "pProperties")]),
Tony Barbour59a47322015-06-24 16:06:58 -0600263
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600264 Proto("VkResult", "GetPhysicalDevicePerformance",
265 [Param("VkPhysicalDevice", "physicalDevice"),
266 Param("VkPhysicalDevicePerformance*", "pPerformance")]),
267
268 Proto("VkResult", "GetPhysicalDeviceQueueCount",
269 [Param("VkPhysicalDevice", "physicalDevice"),
270 Param("uint32_t*", "pCount")]),
271
272 Proto("VkResult", "GetPhysicalDeviceQueueProperties",
273 [Param("VkPhysicalDevice", "physicalDevice"),
274 Param("uint32_t", "count"),
275 Param("VkPhysicalDeviceQueueProperties*", "pQueueProperties")]),
276
277 Proto("VkResult", "GetPhysicalDeviceMemoryProperties",
278 [Param("VkPhysicalDevice", "physicalDevice"),
279 Param("VkPhysicalDeviceMemoryProperties*", "pMemoryProperties")]),
Tony Barbour59a47322015-06-24 16:06:58 -0600280
281 Proto("VkResult", "GetGlobalExtensionProperties",
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600282 [Param("const char*", "pLayerName"),
283 Param("uint32_t*", "pCount"),
Tony Barbour59a47322015-06-24 16:06:58 -0600284 Param("VkExtensionProperties*", "pProperties")]),
285
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600286 Proto("VkResult", "GetPhysicalDeviceExtensionProperties",
287 [Param("VkPhysicalDevice", "physicalDevice"),
288 Param("const char*", "pLayerName"),
289 Param("uint32_t", "*pCount"),
290 Param("VkExtensionProperties*", "pProperties")]),
291
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600292 Proto("VkResult", "GetGlobalLayerProperties",
293 [Param("uint32_t*", "pCount"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600294 Param("VkLayerProperties*", "pProperties")]),
295
296 Proto("VkResult", "GetPhysicalDeviceLayerProperties",
297 [Param("VkPhysicalDevice", "physicalDevice"),
298 Param("uint32_t", "*pCount"),
299 Param("VkLayerProperties*", "pProperties")]),
Tobin Ehlis01939012015-04-16 12:51:37 -0600300
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600301 Proto("VkResult", "GetDeviceQueue",
302 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter18248e62015-03-05 18:09:39 -0700303 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600304 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600305 Param("VkQueue*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800306
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600307 Proto("VkResult", "QueueSubmit",
308 [Param("VkQueue", "queue"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600309 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600310 Param("const VkCmdBuffer*", "pCmdBuffers"),
311 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800312
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600313 Proto("VkResult", "QueueWaitIdle",
314 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800315
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600316 Proto("VkResult", "DeviceWaitIdle",
317 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800318
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600319 Proto("VkResult", "AllocMemory",
320 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600321 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600322 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800323
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600324 Proto("VkResult", "FreeMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600325 [Param("VkDevice", "device"),
326 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800327
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600328 Proto("VkResult", "MapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600329 [Param("VkDevice", "device"),
330 Param("VkDeviceMemory", "mem"),
Tony Barbour71a85122015-04-16 19:09:28 -0600331 Param("VkDeviceSize", "offset"),
332 Param("VkDeviceSize", "size"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600333 Param("VkMemoryMapFlags", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600334 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800335
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600336 Proto("VkResult", "UnmapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600337 [Param("VkDevice", "device"),
338 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800339
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600340 Proto("VkResult", "FlushMappedMemoryRanges",
Mike Stroyanb050c682015-04-17 12:36:38 -0600341 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600342 Param("uint32_t", "memRangeCount"),
343 Param("const VkMappedMemoryRange*", "pMemRanges")]),
344
345 Proto("VkResult", "InvalidateMappedMemoryRanges",
346 [Param("VkDevice", "device"),
347 Param("uint32_t", "memRangeCount"),
348 Param("const VkMappedMemoryRange*", "pMemRanges")]),
Tony Barbourb1250542015-04-16 19:23:13 -0600349
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600350 Proto("VkResult", "GetDeviceMemoryCommitment",
351 [Param("VkDevice", "device"),
352 Param("VkDeviceMemory", "memory"),
353 Param("VkDeviceSize*", "pCommittedMemoryInBytes")]),
354
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600355 Proto("VkResult", "BindBufferMemory",
356 [Param("VkDevice", "device"),
357 Param("VkBuffer", "buffer"),
358 Param("VkDeviceMemory", "mem"),
359 Param("VkDeviceSize", "memOffset")]),
360
361 Proto("VkResult", "BindImageMemory",
362 [Param("VkDevice", "device"),
363 Param("VkImage", "image"),
364 Param("VkDeviceMemory", "mem"),
365 Param("VkDeviceSize", "memOffset")]),
366
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600367 Proto("VkResult", "GetBufferMemoryRequirements",
Mike Stroyanb050c682015-04-17 12:36:38 -0600368 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600369 Param("VkBuffer", "buffer"),
Tony Barbour59a47322015-06-24 16:06:58 -0600370 Param("VkMemoryRequirements*", "pMemoryRequirements")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800371
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600372 Proto("VkResult", "GetImageMemoryRequirements",
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500373 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600374 Param("VkImage", "image"),
375 Param("VkMemoryRequirements*", "pMemoryRequirements")]),
376
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600377 Proto("VkResult", "GetImageSparseMemoryRequirements",
378 [Param("VkDevice", "device"),
379 Param("VkImage", "image"),
380 Param("uint32_t*", "pNumRequirements"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600381 Param("VkSparseImageMemoryRequirements*", "pSparseMemoryRequirements")]),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600382
383 Proto("VkResult", "GetPhysicalDeviceSparseImageFormatProperties",
384 [Param("VkPhysicalDevice", "physicalDevice"),
385 Param("VkFormat", "format"),
386 Param("VkImageType", "type"),
387 Param("uint32_t", "samples"),
388 Param("VkImageUsageFlags", "usage"),
389 Param("VkImageTiling", "tiling"),
390 Param("uint32_t*", "pNumProperties"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600391 Param("VkSparseImageFormatProperties*", "pProperties")]),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600392
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500393 Proto("VkResult", "QueueBindSparseBufferMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500394 [Param("VkQueue", "queue"),
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500395 Param("VkBuffer", "buffer"),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600396 Param("uint32_t", "numBindings"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600397 Param("const VkSparseMemoryBindInfo*", "pBindInfo")]),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600398
399 Proto("VkResult", "QueueBindSparseImageOpaqueMemory",
400 [Param("VkQueue", "queue"),
401 Param("VkImage", "image"),
402 Param("uint32_t", "numBindings"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600403 Param("const VkSparseMemoryBindInfo*", "pBindInfo")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800404
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500405 Proto("VkResult", "QueueBindSparseImageMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500406 [Param("VkQueue", "queue"),
407 Param("VkImage", "image"),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600408 Param("uint32_t", "numBindings"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600409 Param("const VkSparseImageMemoryBindInfo*", "pBindInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800410
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600411 Proto("VkResult", "CreateFence",
412 [Param("VkDevice", "device"),
413 Param("const VkFenceCreateInfo*", "pCreateInfo"),
414 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800415
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600416 Proto("VkResult", "DestroyFence",
417 [Param("VkDevice", "device"),
418 Param("VkFence", "fence")]),
419
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600420 Proto("VkResult", "ResetFences",
421 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500422 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchter2bf8f902015-06-18 17:28:20 -0600423 Param("const VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500424
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600425 Proto("VkResult", "GetFenceStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600426 [Param("VkDevice", "device"),
427 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800428
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600429 Proto("VkResult", "WaitForFences",
430 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600431 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600432 Param("const VkFence*", "pFences"),
Courtney Goeltzenleuchtercd2a0992015-07-09 11:44:38 -0600433 Param("VkBool32", "waitAll"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600434 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800435
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600436 Proto("VkResult", "CreateSemaphore",
437 [Param("VkDevice", "device"),
438 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
439 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800440
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600441 Proto("VkResult", "DestroySemaphore",
442 [Param("VkDevice", "device"),
443 Param("VkSemaphore", "semaphore")]),
444
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600445 Proto("VkResult", "QueueSignalSemaphore",
446 [Param("VkQueue", "queue"),
447 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800448
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600449 Proto("VkResult", "QueueWaitSemaphore",
450 [Param("VkQueue", "queue"),
451 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800452
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600453 Proto("VkResult", "CreateEvent",
454 [Param("VkDevice", "device"),
455 Param("const VkEventCreateInfo*", "pCreateInfo"),
456 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800457
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600458 Proto("VkResult", "DestroyEvent",
459 [Param("VkDevice", "device"),
460 Param("VkEvent", "event")]),
461
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600462 Proto("VkResult", "GetEventStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600463 [Param("VkDevice", "device"),
464 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800465
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600466 Proto("VkResult", "SetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600467 [Param("VkDevice", "device"),
468 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800469
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600470 Proto("VkResult", "ResetEvent",
Mike Stroyanb050c682015-04-17 12:36:38 -0600471 [Param("VkDevice", "device"),
472 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800473
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600474 Proto("VkResult", "CreateQueryPool",
475 [Param("VkDevice", "device"),
476 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
477 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800478
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600479 Proto("VkResult", "DestroyQueryPool",
480 [Param("VkDevice", "device"),
481 Param("VkQueryPool", "queryPool")]),
482
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600483 Proto("VkResult", "GetQueryPoolResults",
Mike Stroyanb050c682015-04-17 12:36:38 -0600484 [Param("VkDevice", "device"),
485 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600486 Param("uint32_t", "startQuery"),
487 Param("uint32_t", "queryCount"),
488 Param("size_t*", "pDataSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600489 Param("void*", "pData"),
490 Param("VkQueryResultFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800491
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600492 Proto("VkResult", "CreateBuffer",
493 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600494 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600495 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800496
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600497 Proto("VkResult", "DestroyBuffer",
498 [Param("VkDevice", "device"),
499 Param("VkBuffer", "buffer")]),
500
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600501 Proto("VkResult", "CreateBufferView",
502 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600503 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600504 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800505
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600506 Proto("VkResult", "DestroyBufferView",
507 [Param("VkDevice", "device"),
508 Param("VkBufferView", "bufferView")]),
509
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600510 Proto("VkResult", "CreateImage",
511 [Param("VkDevice", "device"),
512 Param("const VkImageCreateInfo*", "pCreateInfo"),
513 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800514
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600515 Proto("VkResult", "DestroyImage",
516 [Param("VkDevice", "device"),
517 Param("VkImage", "image")]),
518
Tony Barbour59a47322015-06-24 16:06:58 -0600519 Proto("VkResult", "GetImageSubresourceLayout",
Mike Stroyanb050c682015-04-17 12:36:38 -0600520 [Param("VkDevice", "device"),
521 Param("VkImage", "image"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600522 Param("const VkImageSubresource*", "pSubresource"),
Tony Barbour59a47322015-06-24 16:06:58 -0600523 Param("VkSubresourceLayout*", "pLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800524
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600525 Proto("VkResult", "CreateImageView",
526 [Param("VkDevice", "device"),
527 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
528 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800529
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600530 Proto("VkResult", "DestroyImageView",
531 [Param("VkDevice", "device"),
532 Param("VkImageView", "imageView")]),
533
Chia-I Wu08accc62015-07-07 11:50:03 +0800534 Proto("VkResult", "CreateAttachmentView",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600535 [Param("VkDevice", "device"),
Chia-I Wu08accc62015-07-07 11:50:03 +0800536 Param("const VkAttachmentViewCreateInfo*", "pCreateInfo"),
537 Param("VkAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800538
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600539 Proto("VkResult", "DestroyAttachmentView",
540 [Param("VkDevice", "device"),
541 Param("VkAttachmentView", "attachmentView")]),
542
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600543 Proto("VkResult", "CreateShaderModule",
544 [Param("VkDevice", "device"),
545 Param("const VkShaderModuleCreateInfo*", "pCreateInfo"),
546 Param("VkShaderModule*", "pShaderModule")]),
547
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600548 Proto("VkResult", "DestroyShaderModule",
549 [Param("VkDevice", "device"),
550 Param("VkShaderModule", "shaderModule")]),
551
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600552 Proto("VkResult", "CreateShader",
553 [Param("VkDevice", "device"),
554 Param("const VkShaderCreateInfo*", "pCreateInfo"),
555 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800556
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600557 Proto("VkResult", "DestroyShader",
558 [Param("VkDevice", "device"),
559 Param("VkShader", "shader")]),
560
Jon Ashburnc669cc62015-07-09 15:02:25 -0600561 Proto("VkResult", "CreatePipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600562 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600563 Param("const VkPipelineCacheCreateInfo*", "pCreateInfo"),
564 Param("VkPipelineCache*", "pPipelineCache")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800565
Jon Ashburnc669cc62015-07-09 15:02:25 -0600566 Proto("VkResult", "DestroyPipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600567 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600568 Param("VkPipelineCache", "pipelineCache")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600569
Jon Ashburnc669cc62015-07-09 15:02:25 -0600570 Proto("size_t", "GetPipelineCacheSize",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600571 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600572 Param("VkPipelineCache", "pipelineCache")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800573
Jon Ashburnc669cc62015-07-09 15:02:25 -0600574 Proto("VkResult", "GetPipelineCacheData",
Mike Stroyanb050c682015-04-17 12:36:38 -0600575 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600576 Param("VkPipelineCache", "pipelineCache"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600577 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800578
Jon Ashburnc669cc62015-07-09 15:02:25 -0600579 Proto("VkResult", "MergePipelineCaches",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600580 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600581 Param("VkPipelineCache", "destCache"),
582 Param("uint32_t", "srcCacheCount"),
583 Param("const VkPipelineCache*", "pSrcCaches")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800584
Jon Ashburnc669cc62015-07-09 15:02:25 -0600585 Proto("VkResult", "CreateGraphicsPipelines",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600586 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600587 Param("VkPipelineCache", "pipelineCache"),
588 Param("uint32_t", "count"),
589 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfos"),
590 Param("VkPipeline*", "pPipelines")]),
591
592 Proto("VkResult", "CreateComputePipelines",
593 [Param("VkDevice", "device"),
594 Param("VkPipelineCache", "pipelineCache"),
595 Param("uint32_t", "count"),
596 Param("const VkComputePipelineCreateInfo*", "pCreateInfos"),
597 Param("VkPipeline*", "pPipelines")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800598
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600599 Proto("VkResult", "DestroyPipeline",
600 [Param("VkDevice", "device"),
601 Param("VkPipeline", "pipeline")]),
602
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500603 Proto("VkResult", "CreatePipelineLayout",
604 [Param("VkDevice", "device"),
605 Param("const VkPipelineLayoutCreateInfo*", "pCreateInfo"),
606 Param("VkPipelineLayout*", "pPipelineLayout")]),
607
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600608 Proto("VkResult", "DestroyPipelineLayout",
609 [Param("VkDevice", "device"),
610 Param("VkPipelineLayout", "pipelineLayout")]),
611
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600612 Proto("VkResult", "CreateSampler",
613 [Param("VkDevice", "device"),
614 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
615 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800616
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600617 Proto("VkResult", "DestroySampler",
618 [Param("VkDevice", "device"),
619 Param("VkSampler", "sampler")]),
620
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600621 Proto("VkResult", "CreateDescriptorSetLayout",
622 [Param("VkDevice", "device"),
623 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
624 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800625
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600626 Proto("VkResult", "DestroyDescriptorSetLayout",
627 [Param("VkDevice", "device"),
628 Param("VkDescriptorSetLayout", "descriptorSetLayout")]),
629
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600630 Proto("VkResult", "CreateDescriptorPool",
631 [Param("VkDevice", "device"),
632 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600633 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600634 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
635 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800636
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600637 Proto("VkResult", "DestroyDescriptorPool",
638 [Param("VkDevice", "device"),
639 Param("VkDescriptorPool", "descriptorPool")]),
640
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600641 Proto("VkResult", "ResetDescriptorPool",
Mike Stroyanb050c682015-04-17 12:36:38 -0600642 [Param("VkDevice", "device"),
643 Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800644
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600645 Proto("VkResult", "AllocDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600646 [Param("VkDevice", "device"),
647 Param("VkDescriptorPool", "descriptorPool"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600648 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600649 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600650 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
651 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600652 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800653
Tony Barbour34ec6922015-07-10 10:50:45 -0600654 Proto("VkResult", "FreeDescriptorSets",
655 [Param("VkDevice", "device"),
656 Param("VkDescriptorPool", "descriptorPool"),
657 Param("uint32_t", "count"),
658 Param("const VkDescriptorSet*", "pDescriptorSets")]),
659
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800660 Proto("VkResult", "UpdateDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600661 [Param("VkDevice", "device"),
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800662 Param("uint32_t", "writeCount"),
663 Param("const VkWriteDescriptorSet*", "pDescriptorWrites"),
664 Param("uint32_t", "copyCount"),
665 Param("const VkCopyDescriptorSet*", "pDescriptorCopies")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800666
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600667 Proto("VkResult", "CreateDynamicViewportState",
668 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600669 Param("const VkDynamicViewportStateCreateInfo*", "pCreateInfo"),
670 Param("VkDynamicViewportState*", "pState")]),
671
672 Proto("VkResult", "DestroyDynamicViewportState",
673 [Param("VkDevice", "device"),
674 Param("VkDynamicViewportState", "dynamicViewportState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800675
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600676 Proto("VkResult", "CreateDynamicRasterState",
677 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600678 Param("const VkDynamicRasterStateCreateInfo*", "pCreateInfo"),
679 Param("VkDynamicRasterState*", "pState")]),
680
681 Proto("VkResult", "DestroyDynamicRasterState",
682 [Param("VkDevice", "device"),
683 Param("VkDynamicRasterState", "dynamicRasterState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800684
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600685 Proto("VkResult", "CreateDynamicColorBlendState",
686 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600687 Param("const VkDynamicColorBlendStateCreateInfo*", "pCreateInfo"),
688 Param("VkDynamicColorBlendState*", "pState")]),
689
690 Proto("VkResult", "DestroyDynamicColorBlendState",
691 [Param("VkDevice", "device"),
692 Param("VkDynamicColorBlendState", "dynamicColorBlendState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800693
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600694 Proto("VkResult", "CreateDynamicDepthStencilState",
695 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600696 Param("const VkDynamicDepthStencilStateCreateInfo*", "pCreateInfo"),
697 Param("VkDynamicDepthStencilState*", "pState")]),
698
699 Proto("VkResult", "DestroyDynamicDepthStencilState",
700 [Param("VkDevice", "device"),
701 Param("VkDynamicDepthStencilState", "dynamicDepthStencilState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800702
Cody Northrope62183e2015-07-09 18:08:05 -0600703 Proto("VkResult", "CreateCommandPool",
704 [Param("VkDevice", "device"),
705 Param("const VkCmdPoolCreateInfo*", "pCreateInfo"),
706 Param("VkCmdPool*", "pCmdPool")]),
707
708 Proto("VkResult", "DestroyCommandPool",
709 [Param("VkDevice", "device"),
710 Param("VkCmdPool", "cmdPool")]),
711
712 Proto("VkResult", "ResetCommandPool",
713 [Param("VkDevice", "device"),
714 Param("VkCmdPool", "cmdPool"),
715 Param("VkCmdPoolResetFlags", "flags")]),
716
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600717 Proto("VkResult", "CreateCommandBuffer",
718 [Param("VkDevice", "device"),
719 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
720 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800721
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600722 Proto("VkResult", "DestroyCommandBuffer",
723 [Param("VkDevice", "device"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600724 Param("VkCmdBuffer", "commandBuffer")]),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600725
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600726 Proto("VkResult", "BeginCommandBuffer",
727 [Param("VkCmdBuffer", "cmdBuffer"),
728 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800729
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600730 Proto("VkResult", "EndCommandBuffer",
731 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800732
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600733 Proto("VkResult", "ResetCommandBuffer",
Cody Northrope62183e2015-07-09 18:08:05 -0600734 [Param("VkCmdBuffer", "cmdBuffer"),
735 Param("VkCmdBufferResetFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800736
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600737 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600738 [Param("VkCmdBuffer", "cmdBuffer"),
739 Param("VkPipelineBindPoint", "pipelineBindPoint"),
740 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800741
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600742 Proto("void", "CmdBindDynamicViewportState",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600743 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600744 Param("VkDynamicViewportState", "dynamicViewportState")]),
745
746 Proto("void", "CmdBindDynamicRasterState",
747 [Param("VkCmdBuffer", "cmdBuffer"),
748 Param("VkDynamicRasterState", "dynamicRasterState")]),
749
750 Proto("void", "CmdBindDynamicColorBlendState",
751 [Param("VkCmdBuffer", "cmdBuffer"),
752 Param("VkDynamicColorBlendState", "dynamicColorBlendState")]),
753
754 Proto("void", "CmdBindDynamicDepthStencilState",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600755 [Param("VkCmdBuffer", "cmdBuffer"),
756 Param("VkDynamicDepthStencilState", "dynamicDepthStencilState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800757
Chia-I Wu53f07d72015-03-28 15:23:55 +0800758 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600759 [Param("VkCmdBuffer", "cmdBuffer"),
760 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskif2093b62015-06-15 13:21:21 -0600761 Param("VkPipelineLayout", "layout"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600762 Param("uint32_t", "firstSet"),
763 Param("uint32_t", "setCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600764 Param("const VkDescriptorSet*", "pDescriptorSets"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600765 Param("uint32_t", "dynamicOffsetCount"),
766 Param("const uint32_t*", "pDynamicOffsets")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800767
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600768 Proto("void", "CmdBindIndexBuffer",
769 [Param("VkCmdBuffer", "cmdBuffer"),
770 Param("VkBuffer", "buffer"),
771 Param("VkDeviceSize", "offset"),
772 Param("VkIndexType", "indexType")]),
773
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600774 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600775 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600776 Param("uint32_t", "startBinding"),
777 Param("uint32_t", "bindingCount"),
778 Param("const VkBuffer*", "pBuffers"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600779 Param("const VkDeviceSize*", "pOffsets")]),
780
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600781 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600782 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600783 Param("uint32_t", "firstVertex"),
784 Param("uint32_t", "vertexCount"),
785 Param("uint32_t", "firstInstance"),
786 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800787
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600788 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600789 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600790 Param("uint32_t", "firstIndex"),
791 Param("uint32_t", "indexCount"),
792 Param("int32_t", "vertexOffset"),
793 Param("uint32_t", "firstInstance"),
794 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800795
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600796 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600797 [Param("VkCmdBuffer", "cmdBuffer"),
798 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600799 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600800 Param("uint32_t", "count"),
801 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800802
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600803 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600804 [Param("VkCmdBuffer", "cmdBuffer"),
805 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600806 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600807 Param("uint32_t", "count"),
808 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800809
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600810 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600811 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600812 Param("uint32_t", "x"),
813 Param("uint32_t", "y"),
814 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800815
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600816 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600817 [Param("VkCmdBuffer", "cmdBuffer"),
818 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600819 Param("VkDeviceSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800820
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600821 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600822 [Param("VkCmdBuffer", "cmdBuffer"),
823 Param("VkBuffer", "srcBuffer"),
824 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600825 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600826 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800827
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600828 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600829 [Param("VkCmdBuffer", "cmdBuffer"),
830 Param("VkImage", "srcImage"),
831 Param("VkImageLayout", "srcImageLayout"),
832 Param("VkImage", "destImage"),
833 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600834 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600835 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800836
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600837 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600838 [Param("VkCmdBuffer", "cmdBuffer"),
839 Param("VkImage", "srcImage"),
840 Param("VkImageLayout", "srcImageLayout"),
841 Param("VkImage", "destImage"),
842 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600843 Param("uint32_t", "regionCount"),
Mark Lobodzinskiee5eef12015-05-22 14:43:25 -0500844 Param("const VkImageBlit*", "pRegions"),
845 Param("VkTexFilter", "filter")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600846
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600847 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600848 [Param("VkCmdBuffer", "cmdBuffer"),
849 Param("VkBuffer", "srcBuffer"),
850 Param("VkImage", "destImage"),
851 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600852 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600853 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800854
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600855 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600856 [Param("VkCmdBuffer", "cmdBuffer"),
857 Param("VkImage", "srcImage"),
858 Param("VkImageLayout", "srcImageLayout"),
859 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600860 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600861 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800862
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600863 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600864 [Param("VkCmdBuffer", "cmdBuffer"),
865 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600866 Param("VkDeviceSize", "destOffset"),
867 Param("VkDeviceSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600868 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800869
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600870 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600871 [Param("VkCmdBuffer", "cmdBuffer"),
872 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600873 Param("VkDeviceSize", "destOffset"),
874 Param("VkDeviceSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600875 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800876
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600877 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600878 [Param("VkCmdBuffer", "cmdBuffer"),
879 Param("VkImage", "image"),
880 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200881 Param("const VkClearColorValue*", "pColor"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600882 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600883 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800884
Chris Forbesd9be82b2015-06-22 17:21:59 +1200885 Proto("void", "CmdClearDepthStencilImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600886 [Param("VkCmdBuffer", "cmdBuffer"),
887 Param("VkImage", "image"),
888 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600889 Param("float", "depth"),
890 Param("uint32_t", "stencil"),
891 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600892 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800893
Chris Forbesd9be82b2015-06-22 17:21:59 +1200894 Proto("void", "CmdClearColorAttachment",
895 [Param("VkCmdBuffer", "cmdBuffer"),
896 Param("uint32_t", "colorAttachment"),
897 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200898 Param("const VkClearColorValue*", "pColor"),
Chris Forbesd9be82b2015-06-22 17:21:59 +1200899 Param("uint32_t", "rectCount"),
900 Param("const VkRect3D*", "pRects")]),
901
902 Proto("void", "CmdClearDepthStencilAttachment",
903 [Param("VkCmdBuffer", "cmdBuffer"),
904 Param("VkImageAspectFlags", "imageAspectMask"),
905 Param("VkImageLayout", "imageLayout"),
906 Param("float", "depth"),
907 Param("uint32_t", "stencil"),
908 Param("uint32_t", "rectCount"),
909 Param("const VkRect3D*", "pRects")]),
910
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600911 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600912 [Param("VkCmdBuffer", "cmdBuffer"),
913 Param("VkImage", "srcImage"),
914 Param("VkImageLayout", "srcImageLayout"),
915 Param("VkImage", "destImage"),
916 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600917 Param("uint32_t", "regionCount"),
918 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800919
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600920 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600921 [Param("VkCmdBuffer", "cmdBuffer"),
922 Param("VkEvent", "event"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600923 Param("VkPipelineStageFlags", "stageMask")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800924
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600925 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600926 [Param("VkCmdBuffer", "cmdBuffer"),
927 Param("VkEvent", "event"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600928 Param("VkPipelineStageFlags", "stageMask")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800929
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600930 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600931 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600932 Param("uint32_t", "eventCount"),
933 Param("const VkEvent*", "pEvents"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600934 Param("VkPipelineStageFlags", "sourceStageMask"),
935 Param("VkPipelineStageFlags", "destStageMask"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600936 Param("uint32_t", "memBarrierCount"),
937 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000938
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600939 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600940 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600941 Param("VkPipelineStageFlags", "sourceStageMask"),
942 Param("VkPipelineStageFlags", "destStageMask"),
Courtney Goeltzenleuchtercd2a0992015-07-09 11:44:38 -0600943 Param("VkBool32", "byRegion"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600944 Param("uint32_t", "memBarrierCount"),
945 Param("const void**", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000946
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600947 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600948 [Param("VkCmdBuffer", "cmdBuffer"),
949 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600950 Param("uint32_t", "slot"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600951 Param("VkQueryControlFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800952
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600953 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600954 [Param("VkCmdBuffer", "cmdBuffer"),
955 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600956 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800957
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600958 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600959 [Param("VkCmdBuffer", "cmdBuffer"),
960 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600961 Param("uint32_t", "startQuery"),
962 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800963
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600964 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600965 [Param("VkCmdBuffer", "cmdBuffer"),
966 Param("VkTimestampType", "timestampType"),
967 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600968 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800969
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600970 Proto("void", "CmdCopyQueryPoolResults",
971 [Param("VkCmdBuffer", "cmdBuffer"),
972 Param("VkQueryPool", "queryPool"),
973 Param("uint32_t", "startQuery"),
974 Param("uint32_t", "queryCount"),
975 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600976 Param("VkDeviceSize", "destOffset"),
977 Param("VkDeviceSize", "destStride"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600978 Param("VkQueryResultFlags", "flags")]),
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600979
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600980 Proto("VkResult", "CreateFramebuffer",
981 [Param("VkDevice", "device"),
982 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
983 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700984
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600985 Proto("VkResult", "DestroyFramebuffer",
986 [Param("VkDevice", "device"),
987 Param("VkFramebuffer", "framebuffer")]),
988
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600989 Proto("VkResult", "CreateRenderPass",
990 [Param("VkDevice", "device"),
991 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
992 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700993
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600994 Proto("VkResult", "DestroyRenderPass",
995 [Param("VkDevice", "device"),
996 Param("VkRenderPass", "renderPass")]),
997
Jon Ashburne13f1982015-02-02 09:58:11 -0700998 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600999 [Param("VkCmdBuffer", "cmdBuffer"),
Chia-I Wu08accc62015-07-07 11:50:03 +08001000 Param("const VkRenderPassBeginInfo*", "pRenderPassBegin"),
1001 Param("VkRenderPassContents", "contents")]),
1002
1003 Proto("void", "CmdNextSubpass",
1004 [Param("VkCmdBuffer", "cmdBuffer"),
1005 Param("VkRenderPassContents", "contents")]),
Jon Ashburne13f1982015-02-02 09:58:11 -07001006
1007 Proto("void", "CmdEndRenderPass",
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001008 [Param("VkCmdBuffer", "cmdBuffer")]),
1009
1010 Proto("void", "CmdExecuteCommands",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001011 [Param("VkCmdBuffer", "cmdBuffer"),
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001012 Param("uint32_t", "cmdBuffersCount"),
1013 Param("const VkCmdBuffer*", "pCmdBuffers")]),
Chia-I Wue442dc32015-01-01 09:31:15 +08001014 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +08001015)
1016
Chia-I Wuf8693382015-04-16 22:02:10 +08001017wsi_lunarg = Extension(
1018 name="VK_WSI_LunarG",
1019 headers=["vk_wsi_lunarg.h"],
1020 objects=[
1021 "VkDisplayWSI",
1022 "VkSwapChainWSI",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001023 "VkDbgMsgCallback",
Chia-I Wuf8693382015-04-16 22:02:10 +08001024 ],
Chia-I Wue442dc32015-01-01 09:31:15 +08001025 protos=[
Chia-I Wuf8693382015-04-16 22:02:10 +08001026 Proto("VkResult", "CreateSwapChainWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001027 [Param("VkDevice", "device"),
Chia-I Wuf8693382015-04-16 22:02:10 +08001028 Param("const VkSwapChainCreateInfoWSI*", "pCreateInfo"),
1029 Param("VkSwapChainWSI*", "pSwapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001030
Chia-I Wuf8693382015-04-16 22:02:10 +08001031 Proto("VkResult", "DestroySwapChainWSI",
1032 [Param("VkSwapChainWSI", "swapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001033
Chia-I Wuf8693382015-04-16 22:02:10 +08001034 Proto("VkResult", "GetSwapChainInfoWSI",
1035 [Param("VkSwapChainWSI", "swapChain"),
1036 Param("VkSwapChainInfoTypeWSI", "infoType"),
1037 Param("size_t*", "pDataSize"),
1038 Param("void*", "pData")]),
1039
1040 Proto("VkResult", "QueuePresentWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001041 [Param("VkQueue", "queue"),
Chia-I Wuf8693382015-04-16 22:02:10 +08001042 Param("const VkPresentInfoWSI*", "pPresentInfo")]),
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001043
1044# Proto("VkResult", "DbgCreateMsgCallback",
1045# [Param("VkInstance", "instance"),
1046# Param("VkFlags", "msgFlags"),
1047# Param("PFN_vkDbgMsgCallback", "pfnMsgCallback"),
1048# Param("void*", "pUserData"),
1049# Param("VkDbgMsgCallback*", "pMsgCallback")]),
Chia-I Wue442dc32015-01-01 09:31:15 +08001050 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001051)
1052
Chia-I Wuf8693382015-04-16 22:02:10 +08001053extensions = [core, wsi_lunarg]
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001054
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001055object_dispatch_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001056 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -06001057 "VkPhysicalDevice",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001058 "VkDevice",
1059 "VkQueue",
1060 "VkCmdBuffer",
Chia-I Wuf8693382015-04-16 22:02:10 +08001061 "VkDisplayWSI",
1062 "VkSwapChainWSI",
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001063]
1064
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001065object_non_dispatch_list = [
Cody Northrope62183e2015-07-09 18:08:05 -06001066 "VkCmdPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001067 "VkFence",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001068 "VkDeviceMemory",
1069 "VkBuffer",
1070 "VkImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001071 "VkSemaphore",
1072 "VkEvent",
1073 "VkQueryPool",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001074 "VkBufferView",
1075 "VkImageView",
1076 "VkAttachmentView",
1077 "VkShaderModule",
1078 "VkShader",
1079 "VkPipelineCache",
1080 "VkPipelineLayout",
1081 "VkPipeline",
1082 "VkDescriptorSetLayout",
1083 "VkSampler",
1084 "VkDescriptorPool",
1085 "VkDescriptorSet",
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001086 "VkDynamicViewportState",
1087 "VkDynamicRasterState",
1088 "VkDynamicColorBlendState",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001089 "VkDynamicDepthStencilState",
1090 "VkRenderPass",
1091 "VkFramebuffer",
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001092]
1093
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001094object_type_list = object_dispatch_list + object_non_dispatch_list
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001095
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001096headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001097objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001098protos = []
1099for ext in extensions:
1100 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001101 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001102 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001103
Chia-I Wu9a4ceb12015-01-01 14:45:58 +08001104proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +08001105
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001106def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +08001107 # read object and protoype typedefs
1108 object_lines = []
1109 proto_lines = []
1110 with open(filename, "r") as fp:
1111 for line in fp:
1112 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001113 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +08001114 begin = line.find("(") + 1
1115 end = line.find(",")
1116 # extract the object type
1117 object_lines.append(line[begin:end])
1118 if line.startswith("typedef") and line.endswith(");"):
1119 # drop leading "typedef " and trailing ");"
1120 proto_lines.append(line[8:-2])
1121
1122 # parse proto_lines to protos
1123 protos = []
1124 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001125 first, rest = line.split(" (VKAPI *PFN_vk")
1126 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001127
1128 # get the return type, no space before "*"
1129 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1130
1131 # get the name
1132 proto_name = second.strip()
1133
1134 # get the list of params
1135 param_strs = third.split(", ")
1136 params = []
1137 for s in param_strs:
1138 ty, name = s.rsplit(" ", 1)
1139
1140 # no space before "*"
1141 ty = "*".join([t.rstrip() for t in ty.split("*")])
1142 # attach [] to ty
1143 idx = name.rfind("[")
1144 if idx >= 0:
1145 ty += name[idx:]
1146 name = name[:idx]
1147
1148 params.append(Param(ty, name))
1149
1150 protos.append(Proto(proto_ret, proto_name, params))
1151
1152 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001153 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001154 headers=["vulkan.h", "vk_debug_report_lunarg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001155 objects=object_lines,
1156 protos=protos)
1157 print("core =", str(ext))
1158
1159 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001160 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001161 print("{")
1162 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001163 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001164 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001165
1166if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001167 parse_vk_h("include/vulkan.h")