blob: 6e30e45b89f1ed30abbef2a3585c07083fdd30e3 [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 Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600184 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800185 objects=[
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600186 "VK_INSTANCE",
187 "VK_PHYSICAL_GPU",
188 "VK_BASE_OBJECT",
189 "VK_DEVICE",
190 "VK_QUEUE",
191 "VK_GPU_MEMORY",
192 "VK_OBJECT",
193 "VK_BUFFER",
194 "VK_BUFFER_VIEW",
195 "VK_IMAGE",
196 "VK_IMAGE_VIEW",
197 "VK_COLOR_ATTACHMENT_VIEW",
198 "VK_DEPTH_STENCIL_VIEW",
199 "VK_SHADER",
200 "VK_PIPELINE",
201 "VK_SAMPLER",
202 "VK_DESCRIPTOR_SET",
203 "VK_DESCRIPTOR_SET_LAYOUT",
204 "VK_DESCRIPTOR_SET_LAYOUT_CHAIN",
205 "VK_DESCRIPTOR_POOL",
206 "VK_DYNAMIC_STATE_OBJECT",
207 "VK_DYNAMIC_VP_STATE_OBJECT",
208 "VK_DYNAMIC_RS_STATE_OBJECT",
209 "VK_DYNAMIC_CB_STATE_OBJECT",
210 "VK_DYNAMIC_DS_STATE_OBJECT",
211 "VK_CMD_BUFFER",
212 "VK_FENCE",
213 "VK_SEMAPHORE",
214 "VK_EVENT",
215 "VK_QUERY_POOL",
216 "VK_FRAMEBUFFER",
217 "VK_RENDER_PASS",
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800218 ],
Chia-I Wue442dc32015-01-01 09:31:15 +0800219 protos=[
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600220 Proto("VK_RESULT", "CreateInstance",
221 [Param("const VK_INSTANCE_CREATE_INFO*", "pCreateInfo"),
222 Param("VK_INSTANCE*", "pInstance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700223
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600224 Proto("VK_RESULT", "DestroyInstance",
225 [Param("VK_INSTANCE", "instance")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700226
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600227 Proto("VK_RESULT", "EnumerateGpus",
228 [Param("VK_INSTANCE", "instance"),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700229 Param("uint32_t", "maxGpus"),
230 Param("uint32_t*", "pGpuCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600231 Param("VK_PHYSICAL_GPU*", "pGpus")]),
Jon Ashburn1beab2d2015-01-26 14:51:40 -0700232
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600233 Proto("VK_RESULT", "GetGpuInfo",
234 [Param("VK_PHYSICAL_GPU", "gpu"),
235 Param("VK_PHYSICAL_GPU_INFO_TYPE", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600236 Param("size_t*", "pDataSize"),
237 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800238
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600239 Proto("void*", "GetProcAddr",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600240 [Param("VK_PHYSICAL_GPU", "gpu"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600241 Param("const char*", "pName")]),
Chia-I Wuf2ffc522015-01-04 14:51:06 +0800242
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600243 Proto("VK_RESULT", "CreateDevice",
244 [Param("VK_PHYSICAL_GPU", "gpu"),
245 Param("const VK_DEVICE_CREATE_INFO*", "pCreateInfo"),
246 Param("VK_DEVICE*", "pDevice")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800247
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600248 Proto("VK_RESULT", "DestroyDevice",
249 [Param("VK_DEVICE", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800250
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600251 Proto("VK_RESULT", "GetExtensionSupport",
252 [Param("VK_PHYSICAL_GPU", "gpu"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600253 Param("const char*", "pExtName")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800254
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600255 Proto("VK_RESULT", "EnumerateLayers",
256 [Param("VK_PHYSICAL_GPU", "gpu"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600257 Param("size_t", "maxLayerCount"),
258 Param("size_t", "maxStringSize"),
259 Param("size_t*", "pOutLayerCount"),
260 Param("char* const*", "pOutLayers"),
261 Param("void*", "pReserved")]),
Jon Ashburnf7bcf9b2014-10-15 15:30:23 -0600262
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600263 Proto("VK_RESULT", "GetDeviceQueue",
264 [Param("VK_DEVICE", "device"),
Courtney Goeltzenleuchter18248e62015-03-05 18:09:39 -0700265 Param("uint32_t", "queueNodeIndex"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600266 Param("uint32_t", "queueIndex"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600267 Param("VK_QUEUE*", "pQueue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800268
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600269 Proto("VK_RESULT", "QueueSubmit",
270 [Param("VK_QUEUE", "queue"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600271 Param("uint32_t", "cmdBufferCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600272 Param("const VK_CMD_BUFFER*", "pCmdBuffers"),
273 Param("VK_FENCE", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800274
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600275 Proto("VK_RESULT", "QueueAddMemReference",
276 [Param("VK_QUEUE", "queue"),
277 Param("VK_GPU_MEMORY", "mem")]),
Courtney Goeltzenleuchterd3fb9552015-04-02 13:39:07 -0600278
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600279 Proto("VK_RESULT", "QueueRemoveMemReference",
280 [Param("VK_QUEUE", "queue"),
281 Param("VK_GPU_MEMORY", "mem")]),
Courtney Goeltzenleuchterd3fb9552015-04-02 13:39:07 -0600282
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600283 Proto("VK_RESULT", "QueueWaitIdle",
284 [Param("VK_QUEUE", "queue")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800285
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600286 Proto("VK_RESULT", "DeviceWaitIdle",
287 [Param("VK_DEVICE", "device")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800288
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600289 Proto("VK_RESULT", "AllocMemory",
290 [Param("VK_DEVICE", "device"),
291 Param("const VK_MEMORY_ALLOC_INFO*", "pAllocInfo"),
292 Param("VK_GPU_MEMORY*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800293
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600294 Proto("VK_RESULT", "FreeMemory",
295 [Param("VK_GPU_MEMORY", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800296
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600297 Proto("VK_RESULT", "SetMemoryPriority",
298 [Param("VK_GPU_MEMORY", "mem"),
299 Param("VK_MEMORY_PRIORITY", "priority")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800300
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600301 Proto("VK_RESULT", "MapMemory",
302 [Param("VK_GPU_MEMORY", "mem"),
303 Param("VK_FLAGS", "flags"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600304 Param("void**", "ppData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800305
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600306 Proto("VK_RESULT", "UnmapMemory",
307 [Param("VK_GPU_MEMORY", "mem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800308
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600309 Proto("VK_RESULT", "PinSystemMemory",
310 [Param("VK_DEVICE", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600311 Param("const void*", "pSysMem"),
312 Param("size_t", "memSize"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600313 Param("VK_GPU_MEMORY*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800314
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600315 Proto("VK_RESULT", "GetMultiGpuCompatibility",
316 [Param("VK_PHYSICAL_GPU", "gpu0"),
317 Param("VK_PHYSICAL_GPU", "gpu1"),
318 Param("VK_GPU_COMPATIBILITY_INFO*", "pInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800319
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600320 Proto("VK_RESULT", "OpenSharedMemory",
321 [Param("VK_DEVICE", "device"),
322 Param("const VK_MEMORY_OPEN_INFO*", "pOpenInfo"),
323 Param("VK_GPU_MEMORY*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800324
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600325 Proto("VK_RESULT", "OpenSharedSemaphore",
326 [Param("VK_DEVICE", "device"),
327 Param("const VK_SEMAPHORE_OPEN_INFO*", "pOpenInfo"),
328 Param("VK_SEMAPHORE*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800329
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600330 Proto("VK_RESULT", "OpenPeerMemory",
331 [Param("VK_DEVICE", "device"),
332 Param("const VK_PEER_MEMORY_OPEN_INFO*", "pOpenInfo"),
333 Param("VK_GPU_MEMORY*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800334
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600335 Proto("VK_RESULT", "OpenPeerImage",
336 [Param("VK_DEVICE", "device"),
337 Param("const VK_PEER_IMAGE_OPEN_INFO*", "pOpenInfo"),
338 Param("VK_IMAGE*", "pImage"),
339 Param("VK_GPU_MEMORY*", "pMem")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800340
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600341 Proto("VK_RESULT", "DestroyObject",
342 [Param("VK_OBJECT", "object")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800343
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600344 Proto("VK_RESULT", "GetObjectInfo",
345 [Param("VK_BASE_OBJECT", "object"),
346 Param("VK_OBJECT_INFO_TYPE", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600347 Param("size_t*", "pDataSize"),
348 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800349
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600350 Proto("VK_RESULT", "BindObjectMemory",
351 [Param("VK_OBJECT", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600352 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600353 Param("VK_GPU_MEMORY", "mem"),
354 Param("VK_GPU_SIZE", "offset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800355
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600356 Proto("VK_RESULT", "BindObjectMemoryRange",
357 [Param("VK_OBJECT", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600358 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600359 Param("VK_GPU_SIZE", "rangeOffset"),
360 Param("VK_GPU_SIZE", "rangeSize"),
361 Param("VK_GPU_MEMORY", "mem"),
362 Param("VK_GPU_SIZE", "memOffset")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800363
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600364 Proto("VK_RESULT", "BindImageMemoryRange",
365 [Param("VK_IMAGE", "image"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600366 Param("uint32_t", "allocationIdx"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600367 Param("const VK_IMAGE_MEMORY_BIND_INFO*", "bindInfo"),
368 Param("VK_GPU_MEMORY", "mem"),
369 Param("VK_GPU_SIZE", "memOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800370
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600371 Proto("VK_RESULT", "CreateFence",
372 [Param("VK_DEVICE", "device"),
373 Param("const VK_FENCE_CREATE_INFO*", "pCreateInfo"),
374 Param("VK_FENCE*", "pFence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800375
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600376 Proto("VK_RESULT", "ResetFences",
377 [Param("VK_DEVICE", "device"),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500378 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600379 Param("VK_FENCE*", "pFences")]),
Mark Lobodzinski148e1582015-04-07 16:07:57 -0500380
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600381 Proto("VK_RESULT", "GetFenceStatus",
382 [Param("VK_FENCE", "fence")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800383
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600384 Proto("VK_RESULT", "WaitForFences",
385 [Param("VK_DEVICE", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600386 Param("uint32_t", "fenceCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600387 Param("const VK_FENCE*", "pFences"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600388 Param("bool32_t", "waitAll"),
389 Param("uint64_t", "timeout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800390
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600391 Proto("VK_RESULT", "CreateSemaphore",
392 [Param("VK_DEVICE", "device"),
393 Param("const VK_SEMAPHORE_CREATE_INFO*", "pCreateInfo"),
394 Param("VK_SEMAPHORE*", "pSemaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800395
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600396 Proto("VK_RESULT", "QueueSignalSemaphore",
397 [Param("VK_QUEUE", "queue"),
398 Param("VK_SEMAPHORE", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800399
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600400 Proto("VK_RESULT", "QueueWaitSemaphore",
401 [Param("VK_QUEUE", "queue"),
402 Param("VK_SEMAPHORE", "semaphore")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800403
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600404 Proto("VK_RESULT", "CreateEvent",
405 [Param("VK_DEVICE", "device"),
406 Param("const VK_EVENT_CREATE_INFO*", "pCreateInfo"),
407 Param("VK_EVENT*", "pEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800408
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600409 Proto("VK_RESULT", "GetEventStatus",
410 [Param("VK_EVENT", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800411
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600412 Proto("VK_RESULT", "SetEvent",
413 [Param("VK_EVENT", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800414
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600415 Proto("VK_RESULT", "ResetEvent",
416 [Param("VK_EVENT", "event")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800417
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600418 Proto("VK_RESULT", "CreateQueryPool",
419 [Param("VK_DEVICE", "device"),
420 Param("const VK_QUERY_POOL_CREATE_INFO*", "pCreateInfo"),
421 Param("VK_QUERY_POOL*", "pQueryPool")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800422
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600423 Proto("VK_RESULT", "GetQueryPoolResults",
424 [Param("VK_QUERY_POOL", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600425 Param("uint32_t", "startQuery"),
426 Param("uint32_t", "queryCount"),
427 Param("size_t*", "pDataSize"),
428 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800429
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600430 Proto("VK_RESULT", "GetFormatInfo",
431 [Param("VK_DEVICE", "device"),
432 Param("VK_FORMAT", "format"),
433 Param("VK_FORMAT_INFO_TYPE", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600434 Param("size_t*", "pDataSize"),
435 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800436
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600437 Proto("VK_RESULT", "CreateBuffer",
438 [Param("VK_DEVICE", "device"),
439 Param("const VK_BUFFER_CREATE_INFO*", "pCreateInfo"),
440 Param("VK_BUFFER*", "pBuffer")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800441
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600442 Proto("VK_RESULT", "CreateBufferView",
443 [Param("VK_DEVICE", "device"),
444 Param("const VK_BUFFER_VIEW_CREATE_INFO*", "pCreateInfo"),
445 Param("VK_BUFFER_VIEW*", "pView")]),
Chia-I Wu1a28fe02015-01-01 07:55:04 +0800446
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600447 Proto("VK_RESULT", "CreateImage",
448 [Param("VK_DEVICE", "device"),
449 Param("const VK_IMAGE_CREATE_INFO*", "pCreateInfo"),
450 Param("VK_IMAGE*", "pImage")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800451
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600452 Proto("VK_RESULT", "GetImageSubresourceInfo",
453 [Param("VK_IMAGE", "image"),
454 Param("const VK_IMAGE_SUBRESOURCE*", "pSubresource"),
455 Param("VK_SUBRESOURCE_INFO_TYPE", "infoType"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600456 Param("size_t*", "pDataSize"),
457 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800458
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600459 Proto("VK_RESULT", "CreateImageView",
460 [Param("VK_DEVICE", "device"),
461 Param("const VK_IMAGE_VIEW_CREATE_INFO*", "pCreateInfo"),
462 Param("VK_IMAGE_VIEW*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800463
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600464 Proto("VK_RESULT", "CreateColorAttachmentView",
465 [Param("VK_DEVICE", "device"),
466 Param("const VK_COLOR_ATTACHMENT_VIEW_CREATE_INFO*", "pCreateInfo"),
467 Param("VK_COLOR_ATTACHMENT_VIEW*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800468
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600469 Proto("VK_RESULT", "CreateDepthStencilView",
470 [Param("VK_DEVICE", "device"),
471 Param("const VK_DEPTH_STENCIL_VIEW_CREATE_INFO*", "pCreateInfo"),
472 Param("VK_DEPTH_STENCIL_VIEW*", "pView")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800473
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600474 Proto("VK_RESULT", "CreateShader",
475 [Param("VK_DEVICE", "device"),
476 Param("const VK_SHADER_CREATE_INFO*", "pCreateInfo"),
477 Param("VK_SHADER*", "pShader")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800478
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600479 Proto("VK_RESULT", "CreateGraphicsPipeline",
480 [Param("VK_DEVICE", "device"),
481 Param("const VK_GRAPHICS_PIPELINE_CREATE_INFO*", "pCreateInfo"),
482 Param("VK_PIPELINE*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800483
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600484 Proto("VK_RESULT", "CreateGraphicsPipelineDerivative",
485 [Param("VK_DEVICE", "device"),
486 Param("const VK_GRAPHICS_PIPELINE_CREATE_INFO*", "pCreateInfo"),
487 Param("VK_PIPELINE", "basePipeline"),
488 Param("VK_PIPELINE*", "pPipeline")]),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600489
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600490 Proto("VK_RESULT", "CreateComputePipeline",
491 [Param("VK_DEVICE", "device"),
492 Param("const VK_COMPUTE_PIPELINE_CREATE_INFO*", "pCreateInfo"),
493 Param("VK_PIPELINE*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800494
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600495 Proto("VK_RESULT", "StorePipeline",
496 [Param("VK_PIPELINE", "pipeline"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600497 Param("size_t*", "pDataSize"),
498 Param("void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800499
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600500 Proto("VK_RESULT", "LoadPipeline",
501 [Param("VK_DEVICE", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600502 Param("size_t", "dataSize"),
503 Param("const void*", "pData"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600504 Param("VK_PIPELINE*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800505
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600506 Proto("VK_RESULT", "LoadPipelineDerivative",
507 [Param("VK_DEVICE", "device"),
Courtney Goeltzenleuchter0d40f152015-03-25 15:37:49 -0600508 Param("size_t", "dataSize"),
509 Param("const void*", "pData"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600510 Param("VK_PIPELINE", "basePipeline"),
511 Param("VK_PIPELINE*", "pPipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800512
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600513 Proto("VK_RESULT", "CreateSampler",
514 [Param("VK_DEVICE", "device"),
515 Param("const VK_SAMPLER_CREATE_INFO*", "pCreateInfo"),
516 Param("VK_SAMPLER*", "pSampler")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800517
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600518 Proto("VK_RESULT", "CreateDescriptorSetLayout",
519 [Param("VK_DEVICE", "device"),
520 Param("const VK_DESCRIPTOR_SET_LAYOUT_CREATE_INFO*", "pCreateInfo"),
521 Param("VK_DESCRIPTOR_SET_LAYOUT*", "pSetLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800522
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600523 Proto("VK_RESULT", "CreateDescriptorSetLayoutChain",
524 [Param("VK_DEVICE", "device"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800525 Param("uint32_t", "setLayoutArrayCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600526 Param("const VK_DESCRIPTOR_SET_LAYOUT*", "pSetLayoutArray"),
527 Param("VK_DESCRIPTOR_SET_LAYOUT_CHAIN*", "pLayoutChain")]),
Chia-I Wu41126e52015-03-26 15:27:55 +0800528
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600529 Proto("VK_RESULT", "BeginDescriptorPoolUpdate",
530 [Param("VK_DEVICE", "device"),
531 Param("VK_DESCRIPTOR_UPDATE_MODE", "updateMode")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800532
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600533 Proto("VK_RESULT", "EndDescriptorPoolUpdate",
534 [Param("VK_DEVICE", "device"),
535 Param("VK_CMD_BUFFER", "cmd")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800536
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600537 Proto("VK_RESULT", "CreateDescriptorPool",
538 [Param("VK_DEVICE", "device"),
539 Param("VK_DESCRIPTOR_POOL_USAGE", "poolUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600540 Param("uint32_t", "maxSets"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600541 Param("const VK_DESCRIPTOR_POOL_CREATE_INFO*", "pCreateInfo"),
542 Param("VK_DESCRIPTOR_POOL*", "pDescriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800543
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600544 Proto("VK_RESULT", "ResetDescriptorPool",
545 [Param("VK_DESCRIPTOR_POOL", "descriptorPool")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800546
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600547 Proto("VK_RESULT", "AllocDescriptorSets",
548 [Param("VK_DESCRIPTOR_POOL", "descriptorPool"),
549 Param("VK_DESCRIPTOR_SET_USAGE", "setUsage"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600550 Param("uint32_t", "count"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600551 Param("const VK_DESCRIPTOR_SET_LAYOUT*", "pSetLayouts"),
552 Param("VK_DESCRIPTOR_SET*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600553 Param("uint32_t*", "pCount")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800554
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600555 Proto("void", "ClearDescriptorSets",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600556 [Param("VK_DESCRIPTOR_POOL", "descriptorPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600557 Param("uint32_t", "count"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600558 Param("const VK_DESCRIPTOR_SET*", "pDescriptorSets")]),
Chia-I Wu11078b02015-01-04 16:27:24 +0800559
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600560 Proto("void", "UpdateDescriptors",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600561 [Param("VK_DESCRIPTOR_SET", "descriptorSet"),
Chia-I Wu41126e52015-03-26 15:27:55 +0800562 Param("uint32_t", "updateCount"),
563 Param("const void**", "ppUpdateArray")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800564
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600565 Proto("VK_RESULT", "CreateDynamicViewportState",
566 [Param("VK_DEVICE", "device"),
567 Param("const VK_DYNAMIC_VP_STATE_CREATE_INFO*", "pCreateInfo"),
568 Param("VK_DYNAMIC_VP_STATE_OBJECT*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800569
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600570 Proto("VK_RESULT", "CreateDynamicRasterState",
571 [Param("VK_DEVICE", "device"),
572 Param("const VK_DYNAMIC_RS_STATE_CREATE_INFO*", "pCreateInfo"),
573 Param("VK_DYNAMIC_RS_STATE_OBJECT*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800574
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600575 Proto("VK_RESULT", "CreateDynamicColorBlendState",
576 [Param("VK_DEVICE", "device"),
577 Param("const VK_DYNAMIC_CB_STATE_CREATE_INFO*", "pCreateInfo"),
578 Param("VK_DYNAMIC_CB_STATE_OBJECT*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800579
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600580 Proto("VK_RESULT", "CreateDynamicDepthStencilState",
581 [Param("VK_DEVICE", "device"),
582 Param("const VK_DYNAMIC_DS_STATE_CREATE_INFO*", "pCreateInfo"),
583 Param("VK_DYNAMIC_DS_STATE_OBJECT*", "pState")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800584
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600585 Proto("VK_RESULT", "CreateCommandBuffer",
586 [Param("VK_DEVICE", "device"),
587 Param("const VK_CMD_BUFFER_CREATE_INFO*", "pCreateInfo"),
588 Param("VK_CMD_BUFFER*", "pCmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800589
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600590 Proto("VK_RESULT", "BeginCommandBuffer",
591 [Param("VK_CMD_BUFFER", "cmdBuffer"),
592 Param("const VK_CMD_BUFFER_BEGIN_INFO*", "pBeginInfo")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800593
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600594 Proto("VK_RESULT", "EndCommandBuffer",
595 [Param("VK_CMD_BUFFER", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800596
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600597 Proto("VK_RESULT", "ResetCommandBuffer",
598 [Param("VK_CMD_BUFFER", "cmdBuffer")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800599
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600600 Proto("void", "CmdBindPipeline",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600601 [Param("VK_CMD_BUFFER", "cmdBuffer"),
602 Param("VK_PIPELINE_BIND_POINT", "pipelineBindPoint"),
603 Param("VK_PIPELINE", "pipeline")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800604
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600605 Proto("void", "CmdBindDynamicStateObject",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600606 [Param("VK_CMD_BUFFER", "cmdBuffer"),
607 Param("VK_STATE_BIND_POINT", "stateBindPoint"),
608 Param("VK_DYNAMIC_STATE_OBJECT", "state")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800609
Chia-I Wu53f07d72015-03-28 15:23:55 +0800610 Proto("void", "CmdBindDescriptorSets",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600611 [Param("VK_CMD_BUFFER", "cmdBuffer"),
612 Param("VK_PIPELINE_BIND_POINT", "pipelineBindPoint"),
613 Param("VK_DESCRIPTOR_SET_LAYOUT_CHAIN", "layoutChain"),
Chia-I Wu53f07d72015-03-28 15:23:55 +0800614 Param("uint32_t", "layoutChainSlot"),
615 Param("uint32_t", "count"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600616 Param("const VK_DESCRIPTOR_SET*", "pDescriptorSets"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600617 Param("const uint32_t*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800618
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600619 Proto("void", "CmdBindVertexBuffer",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600620 [Param("VK_CMD_BUFFER", "cmdBuffer"),
621 Param("VK_BUFFER", "buffer"),
622 Param("VK_GPU_SIZE", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600623 Param("uint32_t", "binding")]),
Chia-I Wu7a42e122014-11-08 10:48:20 +0800624
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600625 Proto("void", "CmdBindIndexBuffer",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600626 [Param("VK_CMD_BUFFER", "cmdBuffer"),
627 Param("VK_BUFFER", "buffer"),
628 Param("VK_GPU_SIZE", "offset"),
629 Param("VK_INDEX_TYPE", "indexType")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800630
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600631 Proto("void", "CmdDraw",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600632 [Param("VK_CMD_BUFFER", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600633 Param("uint32_t", "firstVertex"),
634 Param("uint32_t", "vertexCount"),
635 Param("uint32_t", "firstInstance"),
636 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800637
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600638 Proto("void", "CmdDrawIndexed",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600639 [Param("VK_CMD_BUFFER", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600640 Param("uint32_t", "firstIndex"),
641 Param("uint32_t", "indexCount"),
642 Param("int32_t", "vertexOffset"),
643 Param("uint32_t", "firstInstance"),
644 Param("uint32_t", "instanceCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800645
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600646 Proto("void", "CmdDrawIndirect",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600647 [Param("VK_CMD_BUFFER", "cmdBuffer"),
648 Param("VK_BUFFER", "buffer"),
649 Param("VK_GPU_SIZE", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600650 Param("uint32_t", "count"),
651 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800652
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600653 Proto("void", "CmdDrawIndexedIndirect",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600654 [Param("VK_CMD_BUFFER", "cmdBuffer"),
655 Param("VK_BUFFER", "buffer"),
656 Param("VK_GPU_SIZE", "offset"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600657 Param("uint32_t", "count"),
658 Param("uint32_t", "stride")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800659
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600660 Proto("void", "CmdDispatch",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600661 [Param("VK_CMD_BUFFER", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600662 Param("uint32_t", "x"),
663 Param("uint32_t", "y"),
664 Param("uint32_t", "z")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800665
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600666 Proto("void", "CmdDispatchIndirect",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600667 [Param("VK_CMD_BUFFER", "cmdBuffer"),
668 Param("VK_BUFFER", "buffer"),
669 Param("VK_GPU_SIZE", "offset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800670
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600671 Proto("void", "CmdCopyBuffer",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600672 [Param("VK_CMD_BUFFER", "cmdBuffer"),
673 Param("VK_BUFFER", "srcBuffer"),
674 Param("VK_BUFFER", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600675 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600676 Param("const VK_BUFFER_COPY*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800677
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600678 Proto("void", "CmdCopyImage",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600679 [Param("VK_CMD_BUFFER", "cmdBuffer"),
680 Param("VK_IMAGE", "srcImage"),
681 Param("VK_IMAGE_LAYOUT", "srcImageLayout"),
682 Param("VK_IMAGE", "destImage"),
683 Param("VK_IMAGE_LAYOUT", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600684 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600685 Param("const VK_IMAGE_COPY*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800686
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600687 Proto("void", "CmdBlitImage",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600688 [Param("VK_CMD_BUFFER", "cmdBuffer"),
689 Param("VK_IMAGE", "srcImage"),
690 Param("VK_IMAGE_LAYOUT", "srcImageLayout"),
691 Param("VK_IMAGE", "destImage"),
692 Param("VK_IMAGE_LAYOUT", "destImageLayout"),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600693 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600694 Param("const VK_IMAGE_BLIT*", "pRegions")]),
Courtney Goeltzenleuchter89299fa2015-03-08 17:02:18 -0600695
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600696 Proto("void", "CmdCopyBufferToImage",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600697 [Param("VK_CMD_BUFFER", "cmdBuffer"),
698 Param("VK_BUFFER", "srcBuffer"),
699 Param("VK_IMAGE", "destImage"),
700 Param("VK_IMAGE_LAYOUT", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600701 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600702 Param("const VK_BUFFER_IMAGE_COPY*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800703
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600704 Proto("void", "CmdCopyImageToBuffer",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600705 [Param("VK_CMD_BUFFER", "cmdBuffer"),
706 Param("VK_IMAGE", "srcImage"),
707 Param("VK_IMAGE_LAYOUT", "srcImageLayout"),
708 Param("VK_BUFFER", "destBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600709 Param("uint32_t", "regionCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600710 Param("const VK_BUFFER_IMAGE_COPY*", "pRegions")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800711
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600712 Proto("void", "CmdCloneImageData",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600713 [Param("VK_CMD_BUFFER", "cmdBuffer"),
714 Param("VK_IMAGE", "srcImage"),
715 Param("VK_IMAGE_LAYOUT", "srcImageLayout"),
716 Param("VK_IMAGE", "destImage"),
717 Param("VK_IMAGE_LAYOUT", "destImageLayout")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800718
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600719 Proto("void", "CmdUpdateBuffer",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600720 [Param("VK_CMD_BUFFER", "cmdBuffer"),
721 Param("VK_BUFFER", "destBuffer"),
722 Param("VK_GPU_SIZE", "destOffset"),
723 Param("VK_GPU_SIZE", "dataSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600724 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800725
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600726 Proto("void", "CmdFillBuffer",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600727 [Param("VK_CMD_BUFFER", "cmdBuffer"),
728 Param("VK_BUFFER", "destBuffer"),
729 Param("VK_GPU_SIZE", "destOffset"),
730 Param("VK_GPU_SIZE", "fillSize"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600731 Param("uint32_t", "data")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800732
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600733 Proto("void", "CmdClearColorImage",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600734 [Param("VK_CMD_BUFFER", "cmdBuffer"),
735 Param("VK_IMAGE", "image"),
736 Param("VK_IMAGE_LAYOUT", "imageLayout"),
737 Param("VK_CLEAR_COLOR", "color"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600738 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600739 Param("const VK_IMAGE_SUBRESOURCE_RANGE*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800740
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600741 Proto("void", "CmdClearDepthStencil",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600742 [Param("VK_CMD_BUFFER", "cmdBuffer"),
743 Param("VK_IMAGE", "image"),
744 Param("VK_IMAGE_LAYOUT", "imageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600745 Param("float", "depth"),
746 Param("uint32_t", "stencil"),
747 Param("uint32_t", "rangeCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600748 Param("const VK_IMAGE_SUBRESOURCE_RANGE*", "pRanges")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800749
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600750 Proto("void", "CmdResolveImage",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600751 [Param("VK_CMD_BUFFER", "cmdBuffer"),
752 Param("VK_IMAGE", "srcImage"),
753 Param("VK_IMAGE_LAYOUT", "srcImageLayout"),
754 Param("VK_IMAGE", "destImage"),
755 Param("VK_IMAGE_LAYOUT", "destImageLayout"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600756 Param("uint32_t", "rectCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600757 Param("const VK_IMAGE_RESOLVE*", "pRects")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800758
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600759 Proto("void", "CmdSetEvent",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600760 [Param("VK_CMD_BUFFER", "cmdBuffer"),
761 Param("VK_EVENT", "event"),
762 Param("VK_PIPE_EVENT", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800763
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600764 Proto("void", "CmdResetEvent",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600765 [Param("VK_CMD_BUFFER", "cmdBuffer"),
766 Param("VK_EVENT", "event"),
767 Param("VK_PIPE_EVENT", "pipeEvent")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800768
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600769 Proto("void", "CmdWaitEvents",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600770 [Param("VK_CMD_BUFFER", "cmdBuffer"),
771 Param("const VK_EVENT_WAIT_INFO*", "pWaitInfo")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000772
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600773 Proto("void", "CmdPipelineBarrier",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600774 [Param("VK_CMD_BUFFER", "cmdBuffer"),
775 Param("const VK_PIPELINE_BARRIER*", "pBarrier")]),
Mike Stroyanfb80d5f2014-12-04 11:08:39 +0000776
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600777 Proto("void", "CmdBeginQuery",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600778 [Param("VK_CMD_BUFFER", "cmdBuffer"),
779 Param("VK_QUERY_POOL", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600780 Param("uint32_t", "slot"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600781 Param("VK_FLAGS", "flags")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800782
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600783 Proto("void", "CmdEndQuery",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600784 [Param("VK_CMD_BUFFER", "cmdBuffer"),
785 Param("VK_QUERY_POOL", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600786 Param("uint32_t", "slot")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800787
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600788 Proto("void", "CmdResetQueryPool",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600789 [Param("VK_CMD_BUFFER", "cmdBuffer"),
790 Param("VK_QUERY_POOL", "queryPool"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600791 Param("uint32_t", "startQuery"),
792 Param("uint32_t", "queryCount")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800793
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600794 Proto("void", "CmdWriteTimestamp",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600795 [Param("VK_CMD_BUFFER", "cmdBuffer"),
796 Param("VK_TIMESTAMP_TYPE", "timestampType"),
797 Param("VK_BUFFER", "destBuffer"),
798 Param("VK_GPU_SIZE", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800799
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600800 Proto("void", "CmdInitAtomicCounters",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600801 [Param("VK_CMD_BUFFER", "cmdBuffer"),
802 Param("VK_PIPELINE_BIND_POINT", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600803 Param("uint32_t", "startCounter"),
804 Param("uint32_t", "counterCount"),
805 Param("const uint32_t*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800806
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600807 Proto("void", "CmdLoadAtomicCounters",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600808 [Param("VK_CMD_BUFFER", "cmdBuffer"),
809 Param("VK_PIPELINE_BIND_POINT", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600810 Param("uint32_t", "startCounter"),
811 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600812 Param("VK_BUFFER", "srcBuffer"),
813 Param("VK_GPU_SIZE", "srcOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800814
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600815 Proto("void", "CmdSaveAtomicCounters",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600816 [Param("VK_CMD_BUFFER", "cmdBuffer"),
817 Param("VK_PIPELINE_BIND_POINT", "pipelineBindPoint"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600818 Param("uint32_t", "startCounter"),
819 Param("uint32_t", "counterCount"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600820 Param("VK_BUFFER", "destBuffer"),
821 Param("VK_GPU_SIZE", "destOffset")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800822
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600823 Proto("VK_RESULT", "CreateFramebuffer",
824 [Param("VK_DEVICE", "device"),
825 Param("const VK_FRAMEBUFFER_CREATE_INFO*", "pCreateInfo"),
826 Param("VK_FRAMEBUFFER*", "pFramebuffer")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700827
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600828 Proto("VK_RESULT", "CreateRenderPass",
829 [Param("VK_DEVICE", "device"),
830 Param("const VK_RENDER_PASS_CREATE_INFO*", "pCreateInfo"),
831 Param("VK_RENDER_PASS*", "pRenderPass")]),
Jeremy Hayesd65ae082015-01-14 16:17:08 -0700832
Jon Ashburne13f1982015-02-02 09:58:11 -0700833 Proto("void", "CmdBeginRenderPass",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600834 [Param("VK_CMD_BUFFER", "cmdBuffer"),
835 Param("const VK_RENDER_PASS_BEGIN*", "pRenderPassBegin")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700836
837 Proto("void", "CmdEndRenderPass",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600838 [Param("VK_CMD_BUFFER", "cmdBuffer"),
839 Param("VK_RENDER_PASS", "renderPass")]),
Jon Ashburne13f1982015-02-02 09:58:11 -0700840
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600841 Proto("VK_RESULT", "DbgSetValidationLevel",
842 [Param("VK_DEVICE", "device"),
843 Param("VK_VALIDATION_LEVEL", "validationLevel")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800844
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600845 Proto("VK_RESULT", "DbgRegisterMsgCallback",
846 [Param("VK_INSTANCE", "instance"),
847 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600848 Param("void*", "pUserData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800849
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600850 Proto("VK_RESULT", "DbgUnregisterMsgCallback",
851 [Param("VK_INSTANCE", "instance"),
852 Param("VK_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800853
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600854 Proto("VK_RESULT", "DbgSetMessageFilter",
855 [Param("VK_DEVICE", "device"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600856 Param("int32_t", "msgCode"),
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600857 Param("VK_DBG_MSG_FILTER", "filter")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800858
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600859 Proto("VK_RESULT", "DbgSetObjectTag",
860 [Param("VK_BASE_OBJECT", "object"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600861 Param("size_t", "tagSize"),
862 Param("const void*", "pTag")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800863
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600864 Proto("VK_RESULT", "DbgSetGlobalOption",
865 [Param("VK_INSTANCE", "instance"),
866 Param("VK_DBG_GLOBAL_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600867 Param("size_t", "dataSize"),
868 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800869
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600870 Proto("VK_RESULT", "DbgSetDeviceOption",
871 [Param("VK_DEVICE", "device"),
872 Param("VK_DBG_DEVICE_OPTION", "dbgOption"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600873 Param("size_t", "dataSize"),
874 Param("const void*", "pData")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800875
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600876 Proto("void", "CmdDbgMarkerBegin",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600877 [Param("VK_CMD_BUFFER", "cmdBuffer"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600878 Param("const char*", "pMarker")]),
Chia-I Wufb2559d2014-08-01 11:19:52 +0800879
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600880 Proto("void", "CmdDbgMarkerEnd",
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600881 [Param("VK_CMD_BUFFER", "cmdBuffer")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800882 ],
Chia-I Wufb2559d2014-08-01 11:19:52 +0800883)
884
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800885wsi_x11 = Extension(
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600886 name="VK_WSI_X11",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600887 headers=["vkWsiX11Ext.h"],
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800888 objects=[],
Chia-I Wue442dc32015-01-01 09:31:15 +0800889 protos=[
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600890 Proto("VK_RESULT", "WsiX11AssociateConnection",
891 [Param("VK_PHYSICAL_GPU", "gpu"),
892 Param("const VK_WSI_X11_CONNECTION_INFO*", "pConnectionInfo")]),
Chia-I Wu6bdf0192014-09-13 13:36:06 +0800893
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600894 Proto("VK_RESULT", "WsiX11GetMSC",
895 [Param("VK_DEVICE", "device"),
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800896 Param("xcb_window_t", "window"),
897 Param("xcb_randr_crtc_t", "crtc"),
Mark Lobodzinski17caf572015-01-29 08:55:56 -0600898 Param("uint64_t*", "pMsc")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800899
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600900 Proto("VK_RESULT", "WsiX11CreatePresentableImage",
901 [Param("VK_DEVICE", "device"),
902 Param("const VK_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO*", "pCreateInfo"),
903 Param("VK_IMAGE*", "pImage"),
904 Param("VK_GPU_MEMORY*", "pMem")]),
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800905
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600906 Proto("VK_RESULT", "WsiX11QueuePresent",
907 [Param("VK_QUEUE", "queue"),
908 Param("const VK_WSI_X11_PRESENT_INFO*", "pPresentInfo"),
909 Param("VK_FENCE", "fence")]),
Chia-I Wue442dc32015-01-01 09:31:15 +0800910 ],
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800911)
912
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800913extensions = [core, wsi_x11]
914
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700915object_root_list = [
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600916 "VK_INSTANCE",
917 "VK_PHYSICAL_GPU",
918 "VK_BASE_OBJECT"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700919]
920
921object_base_list = [
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600922 "VK_DEVICE",
923 "VK_QUEUE",
924 "VK_GPU_MEMORY",
925 "VK_OBJECT"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700926]
927
928object_list = [
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600929 "VK_BUFFER",
930 "VK_BUFFER_VIEW",
931 "VK_IMAGE",
932 "VK_IMAGE_VIEW",
933 "VK_COLOR_ATTACHMENT_VIEW",
934 "VK_DEPTH_STENCIL_VIEW",
935 "VK_SHADER",
936 "VK_PIPELINE",
937 "VK_SAMPLER",
938 "VK_DESCRIPTOR_SET",
939 "VK_DESCRIPTOR_SET_LAYOUT",
940 "VK_DESCRIPTOR_SET_LAYOUT_CHAIN",
941 "VK_DESCRIPTOR_POOL",
942 "VK_DYNAMIC_STATE_OBJECT",
943 "VK_CMD_BUFFER",
944 "VK_FENCE",
945 "VK_SEMAPHORE",
946 "VK_EVENT",
947 "VK_QUERY_POOL",
948 "VK_FRAMEBUFFER",
949 "VK_RENDER_PASS"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700950]
951
952object_dynamic_state_list = [
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600953 "VK_DYNAMIC_VP_STATE_OBJECT",
954 "VK_DYNAMIC_RS_STATE_OBJECT",
955 "VK_DYNAMIC_CB_STATE_OBJECT",
956 "VK_DYNAMIC_DS_STATE_OBJECT"
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700957]
958
959object_type_list = object_root_list + object_base_list + object_list + object_dynamic_state_list
960
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600961object_parent_list = ["VK_BASE_OBJECT", "VK_OBJECT", "VK_DYNAMIC_STATE_OBJECT"]
Tobin Ehlis7e65d752015-01-15 17:51:52 -0700962
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800963headers = []
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800964objects = []
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800965protos = []
966for ext in extensions:
967 headers.extend(ext.headers)
Chia-I Wue86d8ab2015-01-04 14:46:22 +0800968 objects.extend(ext.objects)
Chia-I Wuc4f24e82015-01-01 08:46:31 +0800969 protos.extend(ext.protos)
Chia-I Wu6dee8b82014-09-23 10:37:23 +0800970
Chia-I Wu9a4ceb12015-01-01 14:45:58 +0800971proto_names = [proto.name for proto in protos]
Chia-I Wu900a2572014-08-01 14:44:16 +0800972
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -0600973def parse_vk_h(filename):
Chia-I Wu509a4122015-01-04 14:08:46 +0800974 # read object and protoype typedefs
975 object_lines = []
976 proto_lines = []
977 with open(filename, "r") as fp:
978 for line in fp:
979 line = line.strip()
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600980 if line.startswith("VK_DEFINE"):
Chia-I Wu509a4122015-01-04 14:08:46 +0800981 begin = line.find("(") + 1
982 end = line.find(",")
983 # extract the object type
984 object_lines.append(line[begin:end])
985 if line.startswith("typedef") and line.endswith(");"):
986 # drop leading "typedef " and trailing ");"
987 proto_lines.append(line[8:-2])
988
989 # parse proto_lines to protos
990 protos = []
991 for line in proto_lines:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -0600992 first, rest = line.split(" (VKAPI *vk")
Chia-I Wu509a4122015-01-04 14:08:46 +0800993 second, third = rest.split("Type)(")
994
995 # get the return type, no space before "*"
996 proto_ret = "*".join([t.rstrip() for t in first.split("*")])
997
998 # get the name
999 proto_name = second.strip()
1000
1001 # get the list of params
1002 param_strs = third.split(", ")
1003 params = []
1004 for s in param_strs:
1005 ty, name = s.rsplit(" ", 1)
1006
1007 # no space before "*"
1008 ty = "*".join([t.rstrip() for t in ty.split("*")])
1009 # attach [] to ty
1010 idx = name.rfind("[")
1011 if idx >= 0:
1012 ty += name[idx:]
1013 name = name[:idx]
1014
1015 params.append(Param(ty, name))
1016
1017 protos.append(Proto(proto_ret, proto_name, params))
1018
1019 # make them an extension and print
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001020 ext = Extension("VK_CORE",
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001021 headers=["vulkan.h", "vkDbg.h"],
Chia-I Wu509a4122015-01-04 14:08:46 +08001022 objects=object_lines,
1023 protos=protos)
1024 print("core =", str(ext))
1025
1026 print("")
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001027 print("typedef struct _VK_LAYER_DISPATCH_TABLE")
Chia-I Wu509a4122015-01-04 14:08:46 +08001028 print("{")
1029 for proto in ext.protos:
Courtney Goeltzenleuchterd8e229c2015-04-08 15:36:08 -06001030 print(" vk%sType %s;" % (proto.name, proto.name))
1031 print("} VK_LAYER_DISPATCH_TABLE;")
Chia-I Wu509a4122015-01-04 14:08:46 +08001032
1033if __name__ == "__main__":
Courtney Goeltzenleuchterf53c3cb2015-04-14 14:55:44 -06001034 parse_vk_h("include/vulkan.h")