blob: 6007555d54f5df039aa4bde7971def9c820efaa9 [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
Courtney Goeltzenleuchter2caec862015-07-12 12:52:09 -0600235 Proto("VkResult", "GetPhysicalDeviceFormatProperties",
Chris Forbesbc0bb772015-06-21 22:55:02 +1200236 [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
Courtney Goeltzenleuchter2d3ba632015-07-12 14:35:22 -0600244 Proto("PFN_vkVoidFunction", "GetInstanceProcAddr",
Jon Ashburnb0fbe912015-05-06 10:15:07 -0600245 [Param("VkInstance", "instance"),
246 Param("const char*", "pName")]),
247
Courtney Goeltzenleuchter2d3ba632015-07-12 14:35:22 -0600248 Proto("PFN_vkVoidFunction", "GetDeviceProcAddr",
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600249 [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", "GetPhysicalDeviceQueueCount",
265 [Param("VkPhysicalDevice", "physicalDevice"),
266 Param("uint32_t*", "pCount")]),
267
268 Proto("VkResult", "GetPhysicalDeviceQueueProperties",
269 [Param("VkPhysicalDevice", "physicalDevice"),
270 Param("uint32_t", "count"),
271 Param("VkPhysicalDeviceQueueProperties*", "pQueueProperties")]),
272
273 Proto("VkResult", "GetPhysicalDeviceMemoryProperties",
274 [Param("VkPhysicalDevice", "physicalDevice"),
275 Param("VkPhysicalDeviceMemoryProperties*", "pMemoryProperties")]),
Tony Barbour59a47322015-06-24 16:06:58 -0600276
277 Proto("VkResult", "GetGlobalExtensionProperties",
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600278 [Param("const char*", "pLayerName"),
279 Param("uint32_t*", "pCount"),
Tony Barbour59a47322015-06-24 16:06:58 -0600280 Param("VkExtensionProperties*", "pProperties")]),
281
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600282 Proto("VkResult", "GetPhysicalDeviceExtensionProperties",
283 [Param("VkPhysicalDevice", "physicalDevice"),
284 Param("const char*", "pLayerName"),
285 Param("uint32_t", "*pCount"),
286 Param("VkExtensionProperties*", "pProperties")]),
287
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -0600288 Proto("VkResult", "GetGlobalLayerProperties",
289 [Param("uint32_t*", "pCount"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600290 Param("VkLayerProperties*", "pProperties")]),
291
292 Proto("VkResult", "GetPhysicalDeviceLayerProperties",
293 [Param("VkPhysicalDevice", "physicalDevice"),
294 Param("uint32_t", "*pCount"),
295 Param("VkLayerProperties*", "pProperties")]),
Tobin Ehlis01939012015-04-16 12:51:37 -0600296
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600297 Proto("VkResult", "GetDeviceQueue",
298 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter18248e62015-03-05 18:09:39 -0700299 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600300 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600301 Param("VkQueue*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800302
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600303 Proto("VkResult", "QueueSubmit",
304 [Param("VkQueue", "queue"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600305 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600306 Param("const VkCmdBuffer*", "pCmdBuffers"),
307 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800308
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600309 Proto("VkResult", "QueueWaitIdle",
310 [Param("VkQueue", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800311
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600312 Proto("VkResult", "DeviceWaitIdle",
313 [Param("VkDevice", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800314
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600315 Proto("VkResult", "AllocMemory",
316 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600317 Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600318 Param("VkDeviceMemory*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800319
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600320 Proto("VkResult", "FreeMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600321 [Param("VkDevice", "device"),
322 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800323
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600324 Proto("VkResult", "MapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600325 [Param("VkDevice", "device"),
326 Param("VkDeviceMemory", "mem"),
Tony Barbour71a85122015-04-16 19:09:28 -0600327 Param("VkDeviceSize", "offset"),
328 Param("VkDeviceSize", "size"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600329 Param("VkMemoryMapFlags", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600330 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800331
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600332 Proto("VkResult", "UnmapMemory",
Mike Stroyanb050c682015-04-17 12:36:38 -0600333 [Param("VkDevice", "device"),
334 Param("VkDeviceMemory", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800335
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600336 Proto("VkResult", "FlushMappedMemoryRanges",
Mike Stroyanb050c682015-04-17 12:36:38 -0600337 [Param("VkDevice", "device"),
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -0600338 Param("uint32_t", "memRangeCount"),
339 Param("const VkMappedMemoryRange*", "pMemRanges")]),
340
341 Proto("VkResult", "InvalidateMappedMemoryRanges",
342 [Param("VkDevice", "device"),
343 Param("uint32_t", "memRangeCount"),
344 Param("const VkMappedMemoryRange*", "pMemRanges")]),
Tony Barbourb1250542015-04-16 19:23:13 -0600345
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600346 Proto("VkResult", "GetDeviceMemoryCommitment",
347 [Param("VkDevice", "device"),
348 Param("VkDeviceMemory", "memory"),
349 Param("VkDeviceSize*", "pCommittedMemoryInBytes")]),
350
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600351 Proto("VkResult", "BindBufferMemory",
352 [Param("VkDevice", "device"),
353 Param("VkBuffer", "buffer"),
354 Param("VkDeviceMemory", "mem"),
355 Param("VkDeviceSize", "memOffset")]),
356
357 Proto("VkResult", "BindImageMemory",
358 [Param("VkDevice", "device"),
359 Param("VkImage", "image"),
360 Param("VkDeviceMemory", "mem"),
361 Param("VkDeviceSize", "memOffset")]),
362
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600363 Proto("VkResult", "GetBufferMemoryRequirements",
Mike Stroyanb050c682015-04-17 12:36:38 -0600364 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600365 Param("VkBuffer", "buffer"),
Tony Barbour59a47322015-06-24 16:06:58 -0600366 Param("VkMemoryRequirements*", "pMemoryRequirements")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800367
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600368 Proto("VkResult", "GetImageMemoryRequirements",
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500369 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600370 Param("VkImage", "image"),
371 Param("VkMemoryRequirements*", "pMemoryRequirements")]),
372
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600373 Proto("VkResult", "GetImageSparseMemoryRequirements",
374 [Param("VkDevice", "device"),
375 Param("VkImage", "image"),
376 Param("uint32_t*", "pNumRequirements"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600377 Param("VkSparseImageMemoryRequirements*", "pSparseMemoryRequirements")]),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600378
379 Proto("VkResult", "GetPhysicalDeviceSparseImageFormatProperties",
380 [Param("VkPhysicalDevice", "physicalDevice"),
381 Param("VkFormat", "format"),
382 Param("VkImageType", "type"),
383 Param("uint32_t", "samples"),
384 Param("VkImageUsageFlags", "usage"),
385 Param("VkImageTiling", "tiling"),
386 Param("uint32_t*", "pNumProperties"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600387 Param("VkSparseImageFormatProperties*", "pProperties")]),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600388
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500389 Proto("VkResult", "QueueBindSparseBufferMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500390 [Param("VkQueue", "queue"),
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500391 Param("VkBuffer", "buffer"),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600392 Param("uint32_t", "numBindings"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600393 Param("const VkSparseMemoryBindInfo*", "pBindInfo")]),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600394
395 Proto("VkResult", "QueueBindSparseImageOpaqueMemory",
396 [Param("VkQueue", "queue"),
397 Param("VkImage", "image"),
398 Param("uint32_t", "numBindings"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600399 Param("const VkSparseMemoryBindInfo*", "pBindInfo")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800400
Mark Lobodzinski942b1722015-05-11 17:21:15 -0500401 Proto("VkResult", "QueueBindSparseImageMemory",
Mark Lobodzinski40f7f402015-04-16 11:44:05 -0500402 [Param("VkQueue", "queue"),
403 Param("VkImage", "image"),
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600404 Param("uint32_t", "numBindings"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600405 Param("const VkSparseImageMemoryBindInfo*", "pBindInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800406
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600407 Proto("VkResult", "CreateFence",
408 [Param("VkDevice", "device"),
409 Param("const VkFenceCreateInfo*", "pCreateInfo"),
410 Param("VkFence*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800411
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600412 Proto("VkResult", "DestroyFence",
413 [Param("VkDevice", "device"),
414 Param("VkFence", "fence")]),
415
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600416 Proto("VkResult", "ResetFences",
417 [Param("VkDevice", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500418 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchter2bf8f902015-06-18 17:28:20 -0600419 Param("const VkFence*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500420
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600421 Proto("VkResult", "GetFenceStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600422 [Param("VkDevice", "device"),
423 Param("VkFence", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800424
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600425 Proto("VkResult", "WaitForFences",
426 [Param("VkDevice", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600427 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600428 Param("const VkFence*", "pFences"),
Courtney Goeltzenleuchtercd2a0992015-07-09 11:44:38 -0600429 Param("VkBool32", "waitAll"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600430 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800431
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600432 Proto("VkResult", "CreateSemaphore",
433 [Param("VkDevice", "device"),
434 Param("const VkSemaphoreCreateInfo*", "pCreateInfo"),
435 Param("VkSemaphore*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800436
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600437 Proto("VkResult", "DestroySemaphore",
438 [Param("VkDevice", "device"),
439 Param("VkSemaphore", "semaphore")]),
440
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600441 Proto("VkResult", "QueueSignalSemaphore",
442 [Param("VkQueue", "queue"),
443 Param("VkSemaphore", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800444
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600445 Proto("VkResult", "QueueWaitSemaphore",
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", "CreateEvent",
450 [Param("VkDevice", "device"),
451 Param("const VkEventCreateInfo*", "pCreateInfo"),
452 Param("VkEvent*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800453
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600454 Proto("VkResult", "DestroyEvent",
455 [Param("VkDevice", "device"),
456 Param("VkEvent", "event")]),
457
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600458 Proto("VkResult", "GetEventStatus",
Mike Stroyanb050c682015-04-17 12:36:38 -0600459 [Param("VkDevice", "device"),
460 Param("VkEvent", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800461
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600462 Proto("VkResult", "SetEvent",
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", "ResetEvent",
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", "CreateQueryPool",
471 [Param("VkDevice", "device"),
472 Param("const VkQueryPoolCreateInfo*", "pCreateInfo"),
473 Param("VkQueryPool*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800474
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600475 Proto("VkResult", "DestroyQueryPool",
476 [Param("VkDevice", "device"),
477 Param("VkQueryPool", "queryPool")]),
478
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600479 Proto("VkResult", "GetQueryPoolResults",
Mike Stroyanb050c682015-04-17 12:36:38 -0600480 [Param("VkDevice", "device"),
481 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600482 Param("uint32_t", "startQuery"),
483 Param("uint32_t", "queryCount"),
484 Param("size_t*", "pDataSize"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600485 Param("void*", "pData"),
486 Param("VkQueryResultFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800487
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600488 Proto("VkResult", "CreateBuffer",
489 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600490 Param("const VkBufferCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600491 Param("VkBuffer*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800492
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600493 Proto("VkResult", "DestroyBuffer",
494 [Param("VkDevice", "device"),
495 Param("VkBuffer", "buffer")]),
496
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600497 Proto("VkResult", "CreateBufferView",
498 [Param("VkDevice", "device"),
Courtney Goeltzenleuchter95487bc2015-04-14 18:48:46 -0600499 Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600500 Param("VkBufferView*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800501
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600502 Proto("VkResult", "DestroyBufferView",
503 [Param("VkDevice", "device"),
504 Param("VkBufferView", "bufferView")]),
505
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600506 Proto("VkResult", "CreateImage",
507 [Param("VkDevice", "device"),
508 Param("const VkImageCreateInfo*", "pCreateInfo"),
509 Param("VkImage*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800510
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600511 Proto("VkResult", "DestroyImage",
512 [Param("VkDevice", "device"),
513 Param("VkImage", "image")]),
514
Tony Barbour59a47322015-06-24 16:06:58 -0600515 Proto("VkResult", "GetImageSubresourceLayout",
Mike Stroyanb050c682015-04-17 12:36:38 -0600516 [Param("VkDevice", "device"),
517 Param("VkImage", "image"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600518 Param("const VkImageSubresource*", "pSubresource"),
Tony Barbour59a47322015-06-24 16:06:58 -0600519 Param("VkSubresourceLayout*", "pLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800520
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600521 Proto("VkResult", "CreateImageView",
522 [Param("VkDevice", "device"),
523 Param("const VkImageViewCreateInfo*", "pCreateInfo"),
524 Param("VkImageView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800525
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600526 Proto("VkResult", "DestroyImageView",
527 [Param("VkDevice", "device"),
528 Param("VkImageView", "imageView")]),
529
Chia-I Wu08accc62015-07-07 11:50:03 +0800530 Proto("VkResult", "CreateAttachmentView",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600531 [Param("VkDevice", "device"),
Chia-I Wu08accc62015-07-07 11:50:03 +0800532 Param("const VkAttachmentViewCreateInfo*", "pCreateInfo"),
533 Param("VkAttachmentView*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800534
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600535 Proto("VkResult", "DestroyAttachmentView",
536 [Param("VkDevice", "device"),
537 Param("VkAttachmentView", "attachmentView")]),
538
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600539 Proto("VkResult", "CreateShaderModule",
540 [Param("VkDevice", "device"),
541 Param("const VkShaderModuleCreateInfo*", "pCreateInfo"),
542 Param("VkShaderModule*", "pShaderModule")]),
543
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600544 Proto("VkResult", "DestroyShaderModule",
545 [Param("VkDevice", "device"),
546 Param("VkShaderModule", "shaderModule")]),
547
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600548 Proto("VkResult", "CreateShader",
549 [Param("VkDevice", "device"),
550 Param("const VkShaderCreateInfo*", "pCreateInfo"),
551 Param("VkShader*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800552
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600553 Proto("VkResult", "DestroyShader",
554 [Param("VkDevice", "device"),
555 Param("VkShader", "shader")]),
556
Jon Ashburnc669cc62015-07-09 15:02:25 -0600557 Proto("VkResult", "CreatePipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600558 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600559 Param("const VkPipelineCacheCreateInfo*", "pCreateInfo"),
560 Param("VkPipelineCache*", "pPipelineCache")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800561
Jon Ashburnc669cc62015-07-09 15:02:25 -0600562 Proto("VkResult", "DestroyPipelineCache",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600563 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600564 Param("VkPipelineCache", "pipelineCache")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600565
Jon Ashburnc669cc62015-07-09 15:02:25 -0600566 Proto("size_t", "GetPipelineCacheSize",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600567 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600568 Param("VkPipelineCache", "pipelineCache")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800569
Jon Ashburnc669cc62015-07-09 15:02:25 -0600570 Proto("VkResult", "GetPipelineCacheData",
Mike Stroyanb050c682015-04-17 12:36:38 -0600571 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600572 Param("VkPipelineCache", "pipelineCache"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600573 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800574
Jon Ashburnc669cc62015-07-09 15:02:25 -0600575 Proto("VkResult", "MergePipelineCaches",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600576 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600577 Param("VkPipelineCache", "destCache"),
578 Param("uint32_t", "srcCacheCount"),
579 Param("const VkPipelineCache*", "pSrcCaches")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800580
Jon Ashburnc669cc62015-07-09 15:02:25 -0600581 Proto("VkResult", "CreateGraphicsPipelines",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600582 [Param("VkDevice", "device"),
Jon Ashburnc669cc62015-07-09 15:02:25 -0600583 Param("VkPipelineCache", "pipelineCache"),
584 Param("uint32_t", "count"),
585 Param("const VkGraphicsPipelineCreateInfo*", "pCreateInfos"),
586 Param("VkPipeline*", "pPipelines")]),
587
588 Proto("VkResult", "CreateComputePipelines",
589 [Param("VkDevice", "device"),
590 Param("VkPipelineCache", "pipelineCache"),
591 Param("uint32_t", "count"),
592 Param("const VkComputePipelineCreateInfo*", "pCreateInfos"),
593 Param("VkPipeline*", "pPipelines")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800594
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600595 Proto("VkResult", "DestroyPipeline",
596 [Param("VkDevice", "device"),
597 Param("VkPipeline", "pipeline")]),
598
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -0500599 Proto("VkResult", "CreatePipelineLayout",
600 [Param("VkDevice", "device"),
601 Param("const VkPipelineLayoutCreateInfo*", "pCreateInfo"),
602 Param("VkPipelineLayout*", "pPipelineLayout")]),
603
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600604 Proto("VkResult", "DestroyPipelineLayout",
605 [Param("VkDevice", "device"),
606 Param("VkPipelineLayout", "pipelineLayout")]),
607
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600608 Proto("VkResult", "CreateSampler",
609 [Param("VkDevice", "device"),
610 Param("const VkSamplerCreateInfo*", "pCreateInfo"),
611 Param("VkSampler*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800612
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600613 Proto("VkResult", "DestroySampler",
614 [Param("VkDevice", "device"),
615 Param("VkSampler", "sampler")]),
616
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600617 Proto("VkResult", "CreateDescriptorSetLayout",
618 [Param("VkDevice", "device"),
619 Param("const VkDescriptorSetLayoutCreateInfo*", "pCreateInfo"),
620 Param("VkDescriptorSetLayout*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800621
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600622 Proto("VkResult", "DestroyDescriptorSetLayout",
623 [Param("VkDevice", "device"),
624 Param("VkDescriptorSetLayout", "descriptorSetLayout")]),
625
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600626 Proto("VkResult", "CreateDescriptorPool",
627 [Param("VkDevice", "device"),
628 Param("VkDescriptorPoolUsage", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600629 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600630 Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
631 Param("VkDescriptorPool*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800632
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600633 Proto("VkResult", "DestroyDescriptorPool",
634 [Param("VkDevice", "device"),
635 Param("VkDescriptorPool", "descriptorPool")]),
636
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600637 Proto("VkResult", "ResetDescriptorPool",
Mike Stroyanb050c682015-04-17 12:36:38 -0600638 [Param("VkDevice", "device"),
639 Param("VkDescriptorPool", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800640
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600641 Proto("VkResult", "AllocDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600642 [Param("VkDevice", "device"),
643 Param("VkDescriptorPool", "descriptorPool"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600644 Param("VkDescriptorSetUsage", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600645 Param("uint32_t", "count"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600646 Param("const VkDescriptorSetLayout*", "pSetLayouts"),
647 Param("VkDescriptorSet*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600648 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800649
Tony Barbour34ec6922015-07-10 10:50:45 -0600650 Proto("VkResult", "FreeDescriptorSets",
651 [Param("VkDevice", "device"),
652 Param("VkDescriptorPool", "descriptorPool"),
653 Param("uint32_t", "count"),
654 Param("const VkDescriptorSet*", "pDescriptorSets")]),
655
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800656 Proto("VkResult", "UpdateDescriptorSets",
Mike Stroyanb050c682015-04-17 12:36:38 -0600657 [Param("VkDevice", "device"),
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800658 Param("uint32_t", "writeCount"),
659 Param("const VkWriteDescriptorSet*", "pDescriptorWrites"),
660 Param("uint32_t", "copyCount"),
661 Param("const VkCopyDescriptorSet*", "pDescriptorCopies")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800662
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600663 Proto("VkResult", "CreateDynamicViewportState",
664 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600665 Param("const VkDynamicViewportStateCreateInfo*", "pCreateInfo"),
666 Param("VkDynamicViewportState*", "pState")]),
667
668 Proto("VkResult", "DestroyDynamicViewportState",
669 [Param("VkDevice", "device"),
670 Param("VkDynamicViewportState", "dynamicViewportState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800671
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600672 Proto("VkResult", "CreateDynamicRasterState",
673 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600674 Param("const VkDynamicRasterStateCreateInfo*", "pCreateInfo"),
675 Param("VkDynamicRasterState*", "pState")]),
676
677 Proto("VkResult", "DestroyDynamicRasterState",
678 [Param("VkDevice", "device"),
679 Param("VkDynamicRasterState", "dynamicRasterState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800680
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600681 Proto("VkResult", "CreateDynamicColorBlendState",
682 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600683 Param("const VkDynamicColorBlendStateCreateInfo*", "pCreateInfo"),
684 Param("VkDynamicColorBlendState*", "pState")]),
685
686 Proto("VkResult", "DestroyDynamicColorBlendState",
687 [Param("VkDevice", "device"),
688 Param("VkDynamicColorBlendState", "dynamicColorBlendState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800689
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600690 Proto("VkResult", "CreateDynamicDepthStencilState",
691 [Param("VkDevice", "device"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600692 Param("const VkDynamicDepthStencilStateCreateInfo*", "pCreateInfo"),
693 Param("VkDynamicDepthStencilState*", "pState")]),
694
695 Proto("VkResult", "DestroyDynamicDepthStencilState",
696 [Param("VkDevice", "device"),
697 Param("VkDynamicDepthStencilState", "dynamicDepthStencilState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800698
Cody Northrope62183e2015-07-09 18:08:05 -0600699 Proto("VkResult", "CreateCommandPool",
700 [Param("VkDevice", "device"),
701 Param("const VkCmdPoolCreateInfo*", "pCreateInfo"),
702 Param("VkCmdPool*", "pCmdPool")]),
703
704 Proto("VkResult", "DestroyCommandPool",
705 [Param("VkDevice", "device"),
706 Param("VkCmdPool", "cmdPool")]),
707
708 Proto("VkResult", "ResetCommandPool",
709 [Param("VkDevice", "device"),
710 Param("VkCmdPool", "cmdPool"),
711 Param("VkCmdPoolResetFlags", "flags")]),
712
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600713 Proto("VkResult", "CreateCommandBuffer",
714 [Param("VkDevice", "device"),
715 Param("const VkCmdBufferCreateInfo*", "pCreateInfo"),
716 Param("VkCmdBuffer*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800717
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600718 Proto("VkResult", "DestroyCommandBuffer",
719 [Param("VkDevice", "device"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600720 Param("VkCmdBuffer", "commandBuffer")]),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600721
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600722 Proto("VkResult", "BeginCommandBuffer",
723 [Param("VkCmdBuffer", "cmdBuffer"),
724 Param("const VkCmdBufferBeginInfo*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800725
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600726 Proto("VkResult", "EndCommandBuffer",
727 [Param("VkCmdBuffer", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800728
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600729 Proto("VkResult", "ResetCommandBuffer",
Cody Northrope62183e2015-07-09 18:08:05 -0600730 [Param("VkCmdBuffer", "cmdBuffer"),
731 Param("VkCmdBufferResetFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800732
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600733 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600734 [Param("VkCmdBuffer", "cmdBuffer"),
735 Param("VkPipelineBindPoint", "pipelineBindPoint"),
736 Param("VkPipeline", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800737
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600738 Proto("void", "CmdBindDynamicViewportState",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600739 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600740 Param("VkDynamicViewportState", "dynamicViewportState")]),
741
742 Proto("void", "CmdBindDynamicRasterState",
743 [Param("VkCmdBuffer", "cmdBuffer"),
744 Param("VkDynamicRasterState", "dynamicRasterState")]),
745
746 Proto("void", "CmdBindDynamicColorBlendState",
747 [Param("VkCmdBuffer", "cmdBuffer"),
748 Param("VkDynamicColorBlendState", "dynamicColorBlendState")]),
749
750 Proto("void", "CmdBindDynamicDepthStencilState",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600751 [Param("VkCmdBuffer", "cmdBuffer"),
752 Param("VkDynamicDepthStencilState", "dynamicDepthStencilState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800753
Chia-I Wu53f07d72015-03-28 15:23:55 +0800754 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600755 [Param("VkCmdBuffer", "cmdBuffer"),
756 Param("VkPipelineBindPoint", "pipelineBindPoint"),
Mark Lobodzinskif2093b62015-06-15 13:21:21 -0600757 Param("VkPipelineLayout", "layout"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600758 Param("uint32_t", "firstSet"),
759 Param("uint32_t", "setCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600760 Param("const VkDescriptorSet*", "pDescriptorSets"),
Cody Northropd4c1a502015-04-16 13:41:56 -0600761 Param("uint32_t", "dynamicOffsetCount"),
762 Param("const uint32_t*", "pDynamicOffsets")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800763
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600764 Proto("void", "CmdBindIndexBuffer",
765 [Param("VkCmdBuffer", "cmdBuffer"),
766 Param("VkBuffer", "buffer"),
767 Param("VkDeviceSize", "offset"),
768 Param("VkIndexType", "indexType")]),
769
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600770 Proto("void", "CmdBindVertexBuffers",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600771 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600772 Param("uint32_t", "startBinding"),
773 Param("uint32_t", "bindingCount"),
774 Param("const VkBuffer*", "pBuffers"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600775 Param("const VkDeviceSize*", "pOffsets")]),
776
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600777 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600778 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600779 Param("uint32_t", "firstVertex"),
780 Param("uint32_t", "vertexCount"),
781 Param("uint32_t", "firstInstance"),
782 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800783
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600784 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600785 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600786 Param("uint32_t", "firstIndex"),
787 Param("uint32_t", "indexCount"),
788 Param("int32_t", "vertexOffset"),
789 Param("uint32_t", "firstInstance"),
790 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800791
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600792 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600793 [Param("VkCmdBuffer", "cmdBuffer"),
794 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600795 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600796 Param("uint32_t", "count"),
797 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800798
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600799 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600800 [Param("VkCmdBuffer", "cmdBuffer"),
801 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600802 Param("VkDeviceSize", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600803 Param("uint32_t", "count"),
804 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800805
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600806 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600807 [Param("VkCmdBuffer", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600808 Param("uint32_t", "x"),
809 Param("uint32_t", "y"),
810 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800811
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600812 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600813 [Param("VkCmdBuffer", "cmdBuffer"),
814 Param("VkBuffer", "buffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600815 Param("VkDeviceSize", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800816
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600817 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600818 [Param("VkCmdBuffer", "cmdBuffer"),
819 Param("VkBuffer", "srcBuffer"),
820 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600821 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600822 Param("const VkBufferCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800823
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600824 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600825 [Param("VkCmdBuffer", "cmdBuffer"),
826 Param("VkImage", "srcImage"),
827 Param("VkImageLayout", "srcImageLayout"),
828 Param("VkImage", "destImage"),
829 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600830 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600831 Param("const VkImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800832
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600833 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600834 [Param("VkCmdBuffer", "cmdBuffer"),
835 Param("VkImage", "srcImage"),
836 Param("VkImageLayout", "srcImageLayout"),
837 Param("VkImage", "destImage"),
838 Param("VkImageLayout", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600839 Param("uint32_t", "regionCount"),
Mark Lobodzinskiee5eef12015-05-22 14:43:25 -0500840 Param("const VkImageBlit*", "pRegions"),
841 Param("VkTexFilter", "filter")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600842
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600843 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600844 [Param("VkCmdBuffer", "cmdBuffer"),
845 Param("VkBuffer", "srcBuffer"),
846 Param("VkImage", "destImage"),
847 Param("VkImageLayout", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600848 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600849 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800850
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600851 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600852 [Param("VkCmdBuffer", "cmdBuffer"),
853 Param("VkImage", "srcImage"),
854 Param("VkImageLayout", "srcImageLayout"),
855 Param("VkBuffer", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600856 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600857 Param("const VkBufferImageCopy*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800858
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600859 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600860 [Param("VkCmdBuffer", "cmdBuffer"),
861 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600862 Param("VkDeviceSize", "destOffset"),
863 Param("VkDeviceSize", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600864 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800865
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600866 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600867 [Param("VkCmdBuffer", "cmdBuffer"),
868 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600869 Param("VkDeviceSize", "destOffset"),
870 Param("VkDeviceSize", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600871 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800872
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600873 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600874 [Param("VkCmdBuffer", "cmdBuffer"),
875 Param("VkImage", "image"),
876 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200877 Param("const VkClearColorValue*", "pColor"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600878 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600879 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800880
Chris Forbesd9be82b2015-06-22 17:21:59 +1200881 Proto("void", "CmdClearDepthStencilImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600882 [Param("VkCmdBuffer", "cmdBuffer"),
883 Param("VkImage", "image"),
884 Param("VkImageLayout", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600885 Param("float", "depth"),
886 Param("uint32_t", "stencil"),
887 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600888 Param("const VkImageSubresourceRange*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800889
Chris Forbesd9be82b2015-06-22 17:21:59 +1200890 Proto("void", "CmdClearColorAttachment",
891 [Param("VkCmdBuffer", "cmdBuffer"),
892 Param("uint32_t", "colorAttachment"),
893 Param("VkImageLayout", "imageLayout"),
Chris Forbesf0796e12015-06-24 14:34:53 +1200894 Param("const VkClearColorValue*", "pColor"),
Chris Forbesd9be82b2015-06-22 17:21:59 +1200895 Param("uint32_t", "rectCount"),
896 Param("const VkRect3D*", "pRects")]),
897
898 Proto("void", "CmdClearDepthStencilAttachment",
899 [Param("VkCmdBuffer", "cmdBuffer"),
900 Param("VkImageAspectFlags", "imageAspectMask"),
901 Param("VkImageLayout", "imageLayout"),
902 Param("float", "depth"),
903 Param("uint32_t", "stencil"),
904 Param("uint32_t", "rectCount"),
905 Param("const VkRect3D*", "pRects")]),
906
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600907 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600908 [Param("VkCmdBuffer", "cmdBuffer"),
909 Param("VkImage", "srcImage"),
910 Param("VkImageLayout", "srcImageLayout"),
911 Param("VkImage", "destImage"),
912 Param("VkImageLayout", "destImageLayout"),
Tony Barbour6865d4a2015-04-13 15:02:52 -0600913 Param("uint32_t", "regionCount"),
914 Param("const VkImageResolve*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800915
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600916 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600917 [Param("VkCmdBuffer", "cmdBuffer"),
918 Param("VkEvent", "event"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600919 Param("VkPipelineStageFlags", "stageMask")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800920
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600921 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600922 [Param("VkCmdBuffer", "cmdBuffer"),
923 Param("VkEvent", "event"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600924 Param("VkPipelineStageFlags", "stageMask")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800925
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600926 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600927 [Param("VkCmdBuffer", "cmdBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600928 Param("uint32_t", "eventCount"),
929 Param("const VkEvent*", "pEvents"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600930 Param("VkPipelineStageFlags", "sourceStageMask"),
931 Param("VkPipelineStageFlags", "destStageMask"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600932 Param("uint32_t", "memBarrierCount"),
Courtney Goeltzenleuchterdbd20322015-07-12 12:58:58 -0600933 Param("const void* const*", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000934
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600935 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600936 [Param("VkCmdBuffer", "cmdBuffer"),
Courtney Goeltzenleuchterceebbb12015-07-12 13:07:46 -0600937 Param("VkPipelineStageFlags", "srcStageMask"),
Tony Barbour0b2cfb22015-06-29 16:20:35 -0600938 Param("VkPipelineStageFlags", "destStageMask"),
Courtney Goeltzenleuchtercd2a0992015-07-09 11:44:38 -0600939 Param("VkBool32", "byRegion"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600940 Param("uint32_t", "memBarrierCount"),
Courtney Goeltzenleuchterceebbb12015-07-12 13:07:46 -0600941 Param("const void* const*", "ppMemBarriers")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000942
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600943 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600944 [Param("VkCmdBuffer", "cmdBuffer"),
945 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600946 Param("uint32_t", "slot"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600947 Param("VkQueryControlFlags", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800948
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600949 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600950 [Param("VkCmdBuffer", "cmdBuffer"),
951 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600952 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800953
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600954 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600955 [Param("VkCmdBuffer", "cmdBuffer"),
956 Param("VkQueryPool", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600957 Param("uint32_t", "startQuery"),
958 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800959
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600960 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600961 [Param("VkCmdBuffer", "cmdBuffer"),
962 Param("VkTimestampType", "timestampType"),
963 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600964 Param("VkDeviceSize", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800965
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600966 Proto("void", "CmdCopyQueryPoolResults",
967 [Param("VkCmdBuffer", "cmdBuffer"),
968 Param("VkQueryPool", "queryPool"),
969 Param("uint32_t", "startQuery"),
970 Param("uint32_t", "queryCount"),
971 Param("VkBuffer", "destBuffer"),
Tony Barbourd1c35722015-04-16 15:59:00 -0600972 Param("VkDeviceSize", "destOffset"),
973 Param("VkDeviceSize", "destStride"),
Tobin Ehlisa30e7e52015-07-06 14:02:36 -0600974 Param("VkQueryResultFlags", "flags")]),
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600975
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600976 Proto("VkResult", "CreateFramebuffer",
977 [Param("VkDevice", "device"),
978 Param("const VkFramebufferCreateInfo*", "pCreateInfo"),
979 Param("VkFramebuffer*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700980
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600981 Proto("VkResult", "DestroyFramebuffer",
982 [Param("VkDevice", "device"),
983 Param("VkFramebuffer", "framebuffer")]),
984
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600985 Proto("VkResult", "CreateRenderPass",
986 [Param("VkDevice", "device"),
987 Param("const VkRenderPassCreateInfo*", "pCreateInfo"),
988 Param("VkRenderPass*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700989
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600990 Proto("VkResult", "DestroyRenderPass",
991 [Param("VkDevice", "device"),
992 Param("VkRenderPass", "renderPass")]),
993
Jon Ashburne13f1982015-02-02 09:58:11 -0700994 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600995 [Param("VkCmdBuffer", "cmdBuffer"),
Chia-I Wu08accc62015-07-07 11:50:03 +0800996 Param("const VkRenderPassBeginInfo*", "pRenderPassBegin"),
997 Param("VkRenderPassContents", "contents")]),
998
999 Proto("void", "CmdNextSubpass",
1000 [Param("VkCmdBuffer", "cmdBuffer"),
1001 Param("VkRenderPassContents", "contents")]),
Jon Ashburne13f1982015-02-02 09:58:11 -07001002
1003 Proto("void", "CmdEndRenderPass",
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001004 [Param("VkCmdBuffer", "cmdBuffer")]),
1005
1006 Proto("void", "CmdExecuteCommands",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001007 [Param("VkCmdBuffer", "cmdBuffer"),
Chia-I Wu0b50a1c2015-06-26 15:34:39 +08001008 Param("uint32_t", "cmdBuffersCount"),
1009 Param("const VkCmdBuffer*", "pCmdBuffers")]),
Chia-I Wue442dc32015-01-01 09:31:15 +08001010 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +08001011)
1012
Chia-I Wuf8693382015-04-16 22:02:10 +08001013wsi_lunarg = Extension(
1014 name="VK_WSI_LunarG",
1015 headers=["vk_wsi_lunarg.h"],
1016 objects=[
1017 "VkDisplayWSI",
1018 "VkSwapChainWSI",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001019 "VkDbgMsgCallback",
Chia-I Wuf8693382015-04-16 22:02:10 +08001020 ],
Chia-I Wue442dc32015-01-01 09:31:15 +08001021 protos=[
Chia-I Wuf8693382015-04-16 22:02:10 +08001022 Proto("VkResult", "CreateSwapChainWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001023 [Param("VkDevice", "device"),
Chia-I Wuf8693382015-04-16 22:02:10 +08001024 Param("const VkSwapChainCreateInfoWSI*", "pCreateInfo"),
1025 Param("VkSwapChainWSI*", "pSwapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001026
Chia-I Wuf8693382015-04-16 22:02:10 +08001027 Proto("VkResult", "DestroySwapChainWSI",
1028 [Param("VkSwapChainWSI", "swapChain")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001029
Chia-I Wuf8693382015-04-16 22:02:10 +08001030 Proto("VkResult", "GetSwapChainInfoWSI",
1031 [Param("VkSwapChainWSI", "swapChain"),
1032 Param("VkSwapChainInfoTypeWSI", "infoType"),
1033 Param("size_t*", "pDataSize"),
1034 Param("void*", "pData")]),
1035
1036 Proto("VkResult", "QueuePresentWSI",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001037 [Param("VkQueue", "queue"),
Chia-I Wuf8693382015-04-16 22:02:10 +08001038 Param("const VkPresentInfoWSI*", "pPresentInfo")]),
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001039
1040# Proto("VkResult", "DbgCreateMsgCallback",
1041# [Param("VkInstance", "instance"),
1042# Param("VkFlags", "msgFlags"),
1043# Param("PFN_vkDbgMsgCallback", "pfnMsgCallback"),
1044# Param("void*", "pUserData"),
1045# Param("VkDbgMsgCallback*", "pMsgCallback")]),
Chia-I Wue442dc32015-01-01 09:31:15 +08001046 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001047)
1048
Chia-I Wuf8693382015-04-16 22:02:10 +08001049extensions = [core, wsi_lunarg]
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001050
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001051object_dispatch_list = [
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001052 "VkInstance",
Tony Barbourd1c35722015-04-16 15:59:00 -06001053 "VkPhysicalDevice",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001054 "VkDevice",
1055 "VkQueue",
1056 "VkCmdBuffer",
Chia-I Wuf8693382015-04-16 22:02:10 +08001057 "VkDisplayWSI",
1058 "VkSwapChainWSI",
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001059]
1060
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001061object_non_dispatch_list = [
Cody Northrope62183e2015-07-09 18:08:05 -06001062 "VkCmdPool",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001063 "VkFence",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001064 "VkDeviceMemory",
1065 "VkBuffer",
1066 "VkImage",
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001067 "VkSemaphore",
1068 "VkEvent",
1069 "VkQueryPool",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001070 "VkBufferView",
1071 "VkImageView",
1072 "VkAttachmentView",
1073 "VkShaderModule",
1074 "VkShader",
1075 "VkPipelineCache",
1076 "VkPipelineLayout",
1077 "VkPipeline",
1078 "VkDescriptorSetLayout",
1079 "VkSampler",
1080 "VkDescriptorPool",
1081 "VkDescriptorSet",
Tony Barbour1d2cd3f2015-07-03 10:33:54 -06001082 "VkDynamicViewportState",
1083 "VkDynamicRasterState",
1084 "VkDynamicColorBlendState",
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001085 "VkDynamicDepthStencilState",
1086 "VkRenderPass",
1087 "VkFramebuffer",
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001088]
1089
Tobin Ehlisa30e7e52015-07-06 14:02:36 -06001090object_type_list = object_dispatch_list + object_non_dispatch_list
Tobin Ehlis7e65d752015-01-15 17:51:52 -07001091
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001092headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001093objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001094protos = []
1095for ext in extensions:
1096 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +08001097 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +08001098 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +08001099
Chia-I Wu9a4ceb12015-01-01 14:45:58 +08001100proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +08001101
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001102def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +08001103 # read object and protoype typedefs
1104 object_lines = []
1105 proto_lines = []
1106 with open(filename, "r") as fp:
1107 for line in fp:
1108 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001109 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +08001110 begin = line.find("(") + 1
1111 end = line.find(",")
1112 # extract the object type
1113 object_lines.append(line[begin:end])
1114 if line.startswith("typedef") and line.endswith(");"):
1115 # drop leading "typedef " and trailing ");"
1116 proto_lines.append(line[8:-2])
1117
1118 # parse proto_lines to protos
1119 protos = []
1120 for line in proto_lines:
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -06001121 first, rest = line.split(" (VKAPI *PFN_vk")
1122 second, third = rest.split(")(")
Chia-I Wu509a4122015-01-04 14:08:46 +08001123
1124 # get the return type, no space before "*"
1125 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
1126
1127 # get the name
1128 proto_name = second.strip()
1129
1130 # get the list of params
1131 param_strs = third.split(", ")
1132 params = []
1133 for s in param_strs:
1134 ty, name = s.rsplit(" ", 1)
1135
1136 # no space before "*"
1137 ty = "*".join([t.rstrip() for t in ty.split("*")])
1138 # attach [] to ty
1139 idx = name.rfind("[")
1140 if idx >= 0:
1141 ty += name[idx:]
1142 name = name[:idx]
1143
1144 params.append(Param(ty, name))
1145
1146 protos.append(Proto(proto_ret, proto_name, params))
1147
1148 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001149 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -06001150 headers=["vulkan.h", "vk_debug_report_lunarg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001151 objects=object_lines,
1152 protos=protos)
1153 print("core =", str(ext))
1154
1155 print("")
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001156 print("typedef struct VkLayerDispatchTable_")
Chia-I Wu509a4122015-01-04 14:08:46 +08001157 print("{")
1158 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001159 print(" vk%sType %s;" % (proto.name, proto.name))
Jon Ashburnbacb0f52015-04-06 10:58:22 -06001160 print("} VkLayerDispatchTable;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001161
1162if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001163 parse_vk_h("include/vulkan.h")