blob: 21512643b5d16c1742ba82102c760640ee952bf3 [file] [log] [blame]
Tobin Ehlis98d109a2017-05-11 14:42:38 -06001#!/usr/bin/python -i
2
3import sys
4import xml.etree.ElementTree as etree
5import urllib2
6from bs4 import BeautifulSoup
7import json
8
9#############################
10# vuid_mapping.py script
11#
12# VUID Mapping Details
13# The Vulkan spec creation process automatically generates string-based unique IDs for each Valid Usage statement
14# For implicit VUs, the format is VUID-<func|struct>-[<param_name>]-<type>
15# func|struct is the name of the API function or structure that the VU is under
16# param_name is an optional entry with the name of the function or struct parameter
17# type is the type of implicit check, see table below for possible values
18#
19# For explicit VUs, the format is VUID-<func|struct>-[<param_name>]-<uniqueid>
20# All fields are the same as implicit VUs except the last parameter is a globally unique integer ID instead of a string type
21#
22# The values below are used to map the strings into unique integers that are used for the unique enum values returned by debug callbacks
23# Here's how the bits of the numerical unique ID map to the ID type and values
24# 31:21 - 11 bits that map to unique value for the function/struct
25# 20:1 - 20 bits that map to param-type combo for implicit VU and uniqueid for explicit VU
26# 0 - 1 bit on for implicit VU or off for explicit VU
27#
28# For implicit VUs 20:1 is split into 20:9 for parameter and 8:1 for type
29FUNC_STRUCT_SHIFT = 21
30EXPLICIT_ID_SHIFT = 1
31IMPLICIT_TYPE_SHIFT = 1
32IMPLICIT_PARAM_SHIFT = 9
33explicit_bit0 = 0x0 # All explicit IDs are even
34implicit_bit0 = 0x1 # All implicit IDs are odd
35# Implicit type values, shifted up by ID_SHIFT bits in final ID
36implicit_type_map = {
37'parameter' : 0,
38'requiredbitmask' : 1,
39'zerobitmask' : 2,
40'parent' : 3,
41'commonparent' : 4,
42'sType' : 5,
43'pNext' : 6,
44'unique' : 7,
45'queuetype' : 8,
46'recording' : 9,
47'cmdpool' : 10,
48'renderpass' : 11,
49'bufferlevel' : 12,
50'arraylength' : 13,
51}
52# Function/struct value mappings, shifted up FUNC_STRUCT_SHIFT bits in final ID
53func_struct_id_map = {
54'VkAcquireNextImageInfoKHX' : 0,
55'VkAllocationCallbacks' : 1,
56'VkAndroidSurfaceCreateInfoKHR' : 2,
57'VkApplicationInfo' : 3,
58'VkAttachmentDescription' : 4,
59'VkAttachmentReference' : 5,
60'VkBindBufferMemoryInfoKHX' : 6,
61'VkBindImageMemoryInfoKHX' : 7,
62'VkBindImageMemorySwapchainInfoKHX' : 8,
63'VkBindSparseInfo' : 9,
64'VkBufferCreateInfo' : 10,
65'VkBufferImageCopy' : 11,
66'VkBufferMemoryBarrier' : 12,
67'VkBufferViewCreateInfo' : 13,
68'VkClearAttachment' : 14,
69'VkClearDepthStencilValue' : 15,
70'VkClearValue' : 16,
71'VkCmdProcessCommandsInfoNVX' : 17,
72'VkCmdReserveSpaceForCommandsInfoNVX' : 18,
73'VkCommandBufferAllocateInfo' : 19,
74'VkCommandBufferBeginInfo' : 20,
75'VkCommandBufferInheritanceInfo' : 21,
76'VkCommandPoolCreateInfo' : 22,
77'VkComponentMapping' : 23,
78'VkComputePipelineCreateInfo' : 24,
79'VkCopyDescriptorSet' : 25,
80'VkD3D12FenceSubmitInfoKHX' : 26,
81'VkDebugMarkerMarkerInfoEXT' : 27,
82'VkDebugMarkerObjectNameInfoEXT' : 28,
83'VkDebugMarkerObjectTagInfoEXT' : 29,
84'VkDebugReportCallbackCreateInfoEXT' : 30,
85'VkDedicatedAllocationBufferCreateInfoNV' : 31,
86'VkDedicatedAllocationImageCreateInfoNV' : 32,
87'VkDedicatedAllocationMemoryAllocateInfoNV' : 33,
88'VkDescriptorBufferInfo' : 34,
89'VkDescriptorImageInfo' : 35,
90'VkDescriptorPoolCreateInfo' : 36,
91'VkDescriptorPoolSize' : 37,
92'VkDescriptorSetAllocateInfo' : 38,
93'VkDescriptorSetLayoutBinding' : 39,
94'VkDescriptorSetLayoutCreateInfo' : 40,
95'VkDescriptorUpdateTemplateCreateInfoKHR' : 41,
96'VkDescriptorUpdateTemplateEntryKHR' : 42,
97'VkDeviceCreateInfo' : 43,
98'VkDeviceEventInfoEXT' : 44,
99'VkDeviceGeneratedCommandsFeaturesNVX' : 45,
100'VkDeviceGeneratedCommandsLimitsNVX' : 46,
101'VkDeviceGroupBindSparseInfoKHX' : 47,
102'VkDeviceGroupCommandBufferBeginInfoKHX' : 48,
103'VkDeviceGroupDeviceCreateInfoKHX' : 49,
104'VkDeviceGroupPresentInfoKHX' : 50,
105'VkDeviceGroupRenderPassBeginInfoKHX' : 51,
106'VkDeviceGroupSubmitInfoKHX' : 52,
107'VkDeviceGroupSwapchainCreateInfoKHX' : 53,
108'VkDeviceQueueCreateInfo' : 54,
109'VkDispatchIndirectCommand' : 55,
110'VkDisplayEventInfoEXT' : 56,
111'VkDisplayModeCreateInfoKHR' : 57,
112'VkDisplayPowerInfoEXT' : 58,
113'VkDisplayPresentInfoKHR' : 59,
114'VkDisplaySurfaceCreateInfoKHR' : 60,
115'VkDrawIndexedIndirectCommand' : 61,
116'VkDrawIndirectCommand' : 62,
117'VkEventCreateInfo' : 63,
118'VkExportMemoryAllocateInfoKHX' : 64,
119'VkExportMemoryAllocateInfoNV' : 65,
120'VkExportMemoryWin32HandleInfoKHX' : 66,
121'VkExportMemoryWin32HandleInfoNV' : 67,
122'VkExportSemaphoreCreateInfoKHX' : 68,
123'VkExportSemaphoreWin32HandleInfoKHX' : 69,
124'VkExternalMemoryBufferCreateInfoKHX' : 70,
125'VkExternalMemoryImageCreateInfoKHX' : 71,
126'VkExternalMemoryImageCreateInfoNV' : 72,
127'VkFenceCreateInfo' : 73,
128'VkFramebufferCreateInfo' : 74,
129'VkGraphicsPipelineCreateInfo' : 75,
130'VkIOSSurfaceCreateInfoMVK' : 76,
131'VkImageBlit' : 77,
132'VkImageCopy' : 78,
133'VkImageCreateInfo' : 79,
134'VkImageMemoryBarrier' : 80,
135'VkImageResolve' : 81,
136'VkImageSubresource' : 82,
137'VkImageSubresourceLayers' : 83,
138'VkImageSubresourceRange' : 84,
139'VkImageSwapchainCreateInfoKHX' : 85,
140'VkImageViewCreateInfo' : 86,
141'VkImportMemoryFdInfoKHX' : 87,
142'VkImportMemoryWin32HandleInfoKHX' : 88,
143'VkImportMemoryWin32HandleInfoNV' : 89,
144'VkImportSemaphoreFdInfoKHX' : 90,
145'VkImportSemaphoreWin32HandleInfoKHX' : 91,
146'VkIndirectCommandsLayoutCreateInfoNVX' : 92,
147'VkIndirectCommandsLayoutTokenNVX' : 93,
148'VkIndirectCommandsTokenNVX' : 94,
149'VkInstanceCreateInfo' : 95,
150'VkMacOSSurfaceCreateInfoMVK' : 96,
151'VkMappedMemoryRange' : 97,
152'VkMemoryAllocateFlagsInfoKHX' : 98,
153'VkMemoryAllocateInfo' : 99,
154'VkMemoryBarrier' : 100,
155'VkMirSurfaceCreateInfoKHR' : 101,
156'VkObjectTableCreateInfoNVX' : 102,
157'VkObjectTableDescriptorSetEntryNVX' : 103,
158'VkObjectTableEntryNVX' : 104,
159'VkObjectTableIndexBufferEntryNVX' : 105,
160'VkObjectTablePipelineEntryNVX' : 106,
161'VkObjectTablePushConstantEntryNVX' : 107,
162'VkObjectTableVertexBufferEntryNVX' : 108,
163'VkPhysicalDeviceDiscardRectanglePropertiesEXT' : 109,
164'VkPhysicalDeviceExternalBufferInfoKHX' : 110,
165'VkPhysicalDeviceExternalImageFormatInfoKHX' : 111,
166'VkPhysicalDeviceExternalSemaphoreInfoKHX' : 112,
167'VkPhysicalDeviceFeatures' : 113,
168'VkPhysicalDeviceFeatures2KHR' : 114,
169'VkPhysicalDeviceImageFormatInfo2KHR' : 115,
170'VkPhysicalDeviceMultiviewFeaturesKHX' : 116,
171'VkPhysicalDevicePushDescriptorPropertiesKHR' : 117,
172'VkPhysicalDeviceSparseImageFormatInfo2KHR' : 118,
173'VkPhysicalDeviceSurfaceInfo2KHR' : 119,
174'VkPipelineCacheCreateInfo' : 120,
175'VkPipelineColorBlendAttachmentState' : 121,
176'VkPipelineColorBlendStateCreateInfo' : 122,
177'VkPipelineDepthStencilStateCreateInfo' : 123,
178'VkPipelineDiscardRectangleStateCreateInfoEXT' : 124,
179'VkPipelineDynamicStateCreateInfo' : 125,
180'VkPipelineInputAssemblyStateCreateInfo' : 126,
181'VkPipelineLayoutCreateInfo' : 127,
182'VkPipelineMultisampleStateCreateInfo' : 128,
183'VkPipelineRasterizationStateCreateInfo' : 129,
184'VkPipelineRasterizationStateRasterizationOrderAMD' : 130,
185'VkPipelineShaderStageCreateInfo' : 131,
186'VkPipelineTessellationStateCreateInfo' : 132,
187'VkPipelineVertexInputStateCreateInfo' : 133,
188'VkPipelineViewportStateCreateInfo' : 134,
189'VkPipelineViewportSwizzleStateCreateInfoNV' : 135,
190'VkPipelineViewportWScalingStateCreateInfoNV' : 136,
191'VkPresentInfoKHR' : 137,
192'VkPresentRegionKHR' : 138,
193'VkPresentRegionsKHR' : 139,
194'VkPresentTimesInfoGOOGLE' : 140,
195'VkPushConstantRange' : 141,
196'VkQueryPoolCreateInfo' : 142,
197'VkRectLayerKHR' : 143,
198'VkRenderPassBeginInfo' : 144,
199'VkRenderPassCreateInfo' : 145,
200'VkRenderPassMultiviewCreateInfoKHX' : 146,
201'VkSamplerCreateInfo' : 147,
202'VkSemaphoreCreateInfo' : 148,
203'VkShaderModuleCreateInfo' : 149,
204'VkSparseBufferMemoryBindInfo' : 150,
205'VkSparseImageMemoryBind' : 151,
206'VkSparseImageMemoryBindInfo' : 152,
207'VkSparseImageOpaqueMemoryBindInfo' : 153,
208'VkSparseMemoryBind' : 154,
209'VkSpecializationInfo' : 155,
210'VkSpecializationMapEntry' : 156,
211'VkStencilOpState' : 157,
212'VkSubmitInfo' : 158,
213'VkSubpassDependency' : 159,
214'VkSubpassDescription' : 160,
215'VkSurfaceCapabilities2EXT' : 161,
216'VkSwapchainCounterCreateInfoEXT' : 162,
217'VkSwapchainCreateInfoKHR' : 163,
218'VkValidationFlagsEXT' : 164,
219'VkVertexInputAttributeDescription' : 165,
220'VkVertexInputBindingDescription' : 166,
221'VkViSurfaceCreateInfoNN' : 167,
222'VkViewport' : 168,
223'VkViewportSwizzleNV' : 169,
224'VkWaylandSurfaceCreateInfoKHR' : 170,
225'VkWin32KeyedMutexAcquireReleaseInfoKHX' : 171,
226'VkWin32KeyedMutexAcquireReleaseInfoNV' : 172,
227'VkWin32SurfaceCreateInfoKHR' : 173,
228'VkWriteDescriptorSet' : 174,
229'VkXcbSurfaceCreateInfoKHR' : 175,
230'VkXlibSurfaceCreateInfoKHR' : 176,
231'vkAcquireNextImage2KHX' : 177,
232'vkAcquireNextImageKHR' : 178,
233'vkAcquireXlibDisplayEXT' : 179,
234'vkAllocateCommandBuffers' : 180,
235'vkAllocateDescriptorSets' : 181,
236'vkAllocateMemory' : 182,
237'vkBeginCommandBuffer' : 183,
238'vkBindBufferMemory' : 184,
239'vkBindBufferMemory2KHX' : 185,
240'vkBindImageMemory' : 186,
241'vkBindImageMemory2KHX' : 187,
242'vkCmdBeginQuery' : 188,
243'vkCmdBeginRenderPass' : 189,
244'vkCmdBindDescriptorSets' : 190,
245'vkCmdBindIndexBuffer' : 191,
246'vkCmdBindPipeline' : 192,
247'vkCmdBindVertexBuffers' : 193,
248'vkCmdBlitImage' : 194,
249'vkCmdClearAttachments' : 195,
250'vkCmdClearColorImage' : 196,
251'vkCmdClearDepthStencilImage' : 197,
252'vkCmdCopyBuffer' : 198,
253'vkCmdCopyBufferToImage' : 199,
254'vkCmdCopyImage' : 200,
255'vkCmdCopyImageToBuffer' : 201,
256'vkCmdCopyQueryPoolResults' : 202,
257'vkCmdDebugMarkerBeginEXT' : 203,
258'vkCmdDebugMarkerEndEXT' : 204,
259'vkCmdDebugMarkerInsertEXT' : 205,
260'vkCmdDispatch' : 206,
261'vkCmdDispatchBaseKHX' : 207,
262'vkCmdDispatchIndirect' : 208,
263'vkCmdDraw' : 209,
264'vkCmdDrawIndexed' : 210,
265'vkCmdDrawIndexedIndirect' : 211,
266'vkCmdDrawIndexedIndirectCountAMD' : 212,
267'vkCmdDrawIndirect' : 213,
268'vkCmdDrawIndirectCountAMD' : 214,
269'vkCmdEndQuery' : 215,
270'vkCmdEndRenderPass' : 216,
271'vkCmdExecuteCommands' : 217,
272'vkCmdFillBuffer' : 218,
273'vkCmdNextSubpass' : 219,
274'vkCmdPipelineBarrier' : 220,
275'vkCmdProcessCommandsNVX' : 221,
276'vkCmdPushConstants' : 222,
277'vkCmdPushDescriptorSetKHR' : 223,
278'vkCmdPushDescriptorSetWithTemplateKHR' : 224,
279'vkCmdReserveSpaceForCommandsNVX' : 225,
280'vkCmdResetEvent' : 226,
281'vkCmdResetQueryPool' : 227,
282'vkCmdResolveImage' : 228,
283'vkCmdSetBlendConstants' : 229,
284'vkCmdSetDepthBias' : 230,
285'vkCmdSetDepthBounds' : 231,
286'vkCmdSetDeviceMaskKHX' : 232,
287'vkCmdSetDiscardRectangleEXT' : 233,
288'vkCmdSetEvent' : 234,
289'vkCmdSetLineWidth' : 235,
290'vkCmdSetScissor' : 236,
291'vkCmdSetStencilCompareMask' : 237,
292'vkCmdSetStencilReference' : 238,
293'vkCmdSetStencilWriteMask' : 239,
294'vkCmdSetViewport' : 240,
295'vkCmdSetViewportWScalingNV' : 241,
296'vkCmdUpdateBuffer' : 242,
297'vkCmdWaitEvents' : 243,
298'vkCmdWriteTimestamp' : 244,
299'vkCreateAndroidSurfaceKHR' : 245,
300'vkCreateBuffer' : 246,
301'vkCreateBufferView' : 247,
302'vkCreateCommandPool' : 248,
303'vkCreateComputePipelines' : 249,
304'vkCreateDebugReportCallbackEXT' : 250,
305'vkCreateDescriptorPool' : 251,
306'vkCreateDescriptorSetLayout' : 252,
307'vkCreateDescriptorUpdateTemplateKHR' : 253,
308'vkCreateDevice' : 254,
309'vkCreateDisplayModeKHR' : 255,
310'vkCreateDisplayPlaneSurfaceKHR' : 256,
311'vkCreateEvent' : 257,
312'vkCreateFence' : 258,
313'vkCreateFramebuffer' : 259,
314'vkCreateGraphicsPipelines' : 260,
315'vkCreateIOSSurfaceMVK' : 261,
316'vkCreateImage' : 262,
317'vkCreateImageView' : 263,
318'vkCreateIndirectCommandsLayoutNVX' : 264,
319'vkCreateInstance' : 265,
320'vkCreateMacOSSurfaceMVK' : 266,
321'vkCreateMirSurfaceKHR' : 267,
322'vkCreateObjectTableNVX' : 268,
323'vkCreatePipelineCache' : 269,
324'vkCreatePipelineLayout' : 270,
325'vkCreateQueryPool' : 271,
326'vkCreateRenderPass' : 272,
327'vkCreateSampler' : 273,
328'vkCreateSemaphore' : 274,
329'vkCreateShaderModule' : 275,
330'vkCreateSharedSwapchainsKHR' : 276,
331'vkCreateSwapchainKHR' : 277,
332'vkCreateViSurfaceNN' : 278,
333'vkCreateWaylandSurfaceKHR' : 279,
334'vkCreateWin32SurfaceKHR' : 280,
335'vkCreateXcbSurfaceKHR' : 281,
336'vkCreateXlibSurfaceKHR' : 282,
337'vkDebugMarkerSetObjectNameEXT' : 283,
338'vkDebugMarkerSetObjectTagEXT' : 284,
339'vkDebugReportMessageEXT' : 285,
340'vkDestroyBuffer' : 286,
341'vkDestroyBufferView' : 287,
342'vkDestroyCommandPool' : 288,
343'vkDestroyDebugReportCallbackEXT' : 289,
344'vkDestroyDescriptorPool' : 290,
345'vkDestroyDescriptorSetLayout' : 291,
346'vkDestroyDescriptorUpdateTemplateKHR' : 292,
347'vkDestroyDevice' : 293,
348'vkDestroyEvent' : 294,
349'vkDestroyFence' : 295,
350'vkDestroyFramebuffer' : 296,
351'vkDestroyImage' : 297,
352'vkDestroyImageView' : 298,
353'vkDestroyIndirectCommandsLayoutNVX' : 299,
354'vkDestroyInstance' : 300,
355'vkDestroyObjectTableNVX' : 301,
356'vkDestroyPipeline' : 302,
357'vkDestroyPipelineCache' : 303,
358'vkDestroyPipelineLayout' : 304,
359'vkDestroyQueryPool' : 305,
360'vkDestroyRenderPass' : 306,
361'vkDestroySampler' : 307,
362'vkDestroySemaphore' : 308,
363'vkDestroyShaderModule' : 309,
364'vkDestroySurfaceKHR' : 310,
365'vkDestroySwapchainKHR' : 311,
366'vkDeviceWaitIdle' : 312,
367'vkDisplayPowerControlEXT' : 313,
368'vkEndCommandBuffer' : 314,
369'vkEnumerateDeviceExtensionProperties' : 315,
370'vkEnumerateDeviceLayerProperties' : 316,
371'vkEnumerateInstanceExtensionProperties' : 317,
372'vkEnumerateInstanceLayerProperties' : 318,
373'vkEnumeratePhysicalDeviceGroupsKHX' : 319,
374'vkEnumeratePhysicalDevices' : 320,
375'vkFlushMappedMemoryRanges' : 321,
376'vkFreeCommandBuffers' : 322,
377'vkFreeDescriptorSets' : 323,
378'vkFreeMemory' : 324,
379'vkGetBufferMemoryRequirements' : 325,
380'vkGetDeviceGroupPeerMemoryFeaturesKHX' : 326,
381'vkGetDeviceGroupPresentCapabilitiesKHX' : 327,
382'vkGetDeviceGroupSurfacePresentModesKHX' : 328,
383'vkGetDeviceMemoryCommitment' : 329,
384'vkGetDeviceProcAddr' : 330,
385'vkGetDeviceQueue' : 331,
386'vkGetDisplayModePropertiesKHR' : 332,
387'vkGetDisplayPlaneCapabilitiesKHR' : 333,
388'vkGetDisplayPlaneSupportedDisplaysKHR' : 334,
389'vkGetEventStatus' : 335,
390'vkGetFenceStatus' : 336,
391'vkGetImageMemoryRequirements' : 337,
392'vkGetImageSparseMemoryRequirements' : 338,
393'vkGetImageSubresourceLayout' : 339,
394'vkGetInstanceProcAddr' : 340,
395'vkGetMemoryFdKHX' : 341,
396'vkGetMemoryFdPropertiesKHX' : 342,
397'vkGetMemoryWin32HandleKHX' : 343,
398'vkGetMemoryWin32HandleNV' : 344,
399'vkGetMemoryWin32HandlePropertiesKHX' : 345,
400'vkGetPastPresentationTimingGOOGLE' : 346,
401'vkGetPhysicalDeviceDisplayPlanePropertiesKHR' : 347,
402'vkGetPhysicalDeviceDisplayPropertiesKHR' : 348,
403'vkGetPhysicalDeviceExternalBufferPropertiesKHX' : 349,
404'vkGetPhysicalDeviceExternalImageFormatPropertiesNV' : 350,
405'vkGetPhysicalDeviceExternalSemaphorePropertiesKHX' : 351,
406'vkGetPhysicalDeviceFeatures' : 352,
407'vkGetPhysicalDeviceFeatures2KHR' : 353,
408'vkGetPhysicalDeviceFormatProperties' : 354,
409'vkGetPhysicalDeviceFormatProperties2KHR' : 355,
410'vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX' : 356,
411'vkGetPhysicalDeviceImageFormatProperties' : 357,
412'vkGetPhysicalDeviceImageFormatProperties2KHR' : 358,
413'vkGetPhysicalDeviceMemoryProperties' : 359,
414'vkGetPhysicalDeviceMemoryProperties2KHR' : 360,
415'vkGetPhysicalDeviceMirPresentationSupportKHR' : 361,
416'vkGetPhysicalDevicePresentRectanglesKHX' : 362,
417'vkGetPhysicalDeviceProperties' : 363,
418'vkGetPhysicalDeviceProperties2KHR' : 364,
419'vkGetPhysicalDeviceQueueFamilyProperties' : 365,
420'vkGetPhysicalDeviceQueueFamilyProperties2KHR' : 366,
421'vkGetPhysicalDeviceSparseImageFormatProperties' : 367,
422'vkGetPhysicalDeviceSparseImageFormatProperties2KHR' : 368,
423'vkGetPhysicalDeviceSurfaceCapabilities2EXT' : 369,
424'vkGetPhysicalDeviceSurfaceCapabilities2KHR' : 370,
425'vkGetPhysicalDeviceSurfaceCapabilitiesKHR' : 371,
426'vkGetPhysicalDeviceSurfaceFormats2KHR' : 372,
427'vkGetPhysicalDeviceSurfaceFormatsKHR' : 373,
428'vkGetPhysicalDeviceSurfacePresentModesKHR' : 374,
429'vkGetPhysicalDeviceSurfaceSupportKHR' : 375,
430'vkGetPhysicalDeviceWaylandPresentationSupportKHR' : 376,
431'vkGetPhysicalDeviceWin32PresentationSupportKHR' : 377,
432'vkGetPhysicalDeviceXcbPresentationSupportKHR' : 378,
433'vkGetPhysicalDeviceXlibPresentationSupportKHR' : 379,
434'vkGetPipelineCacheData' : 380,
435'vkGetQueryPoolResults' : 381,
436'vkGetRandROutputDisplayEXT' : 382,
437'vkGetRefreshCycleDurationGOOGLE' : 383,
438'vkGetRenderAreaGranularity' : 384,
439'vkGetSemaphoreFdKHX' : 385,
440'vkGetSemaphoreWin32HandleKHX' : 386,
441'vkGetSwapchainCounterEXT' : 387,
442'vkGetSwapchainImagesKHR' : 388,
443'vkGetSwapchainStatusKHR' : 389,
444'vkImportSemaphoreFdKHX' : 390,
445'vkImportSemaphoreWin32HandleKHX' : 391,
446'vkInvalidateMappedMemoryRanges' : 392,
447'vkMapMemory' : 393,
448'vkMergePipelineCaches' : 394,
449'vkQueueBindSparse' : 395,
450'vkQueuePresentKHR' : 396,
451'vkQueueSubmit' : 397,
452'vkQueueWaitIdle' : 398,
453'vkRegisterDeviceEventEXT' : 399,
454'vkRegisterDisplayEventEXT' : 400,
455'vkRegisterObjectsNVX' : 401,
456'vkReleaseDisplayEXT' : 402,
457'vkResetCommandBuffer' : 403,
458'vkResetCommandPool' : 404,
459'vkResetDescriptorPool' : 405,
460'vkResetEvent' : 406,
461'vkResetFences' : 407,
462'vkSetEvent' : 408,
463'vkSetHdrMetadataEXT' : 409,
464'vkTrimCommandPoolKHR' : 410,
465'vkUnmapMemory' : 411,
466'vkUnregisterObjectsNVX' : 412,
467'vkUpdateDescriptorSetWithTemplateKHR' : 413,
468'vkUpdateDescriptorSets' : 414,
469'vkWaitForFences' : 415,
470### ADD New func/struct mappings above this line
471}
472# Mapping of params to unique IDs
473implicit_param_map = {
474'a' : 0,
475'addressModeU' : 1,
476'addressModeV' : 2,
477'addressModeW' : 3,
478'alphaBlendOp' : 4,
479'alphaMode' : 5,
480'aspectMask' : 6,
481'attachmentCount' : 7,
482'b' : 8,
483'back' : 9,
484'bindCount' : 10,
485'bindInfoCount' : 11,
486'bindingCount' : 12,
487'buffer' : 13,
488'bufferView' : 14,
489'callback' : 15,
490'colorBlendOp' : 16,
491'colorWriteMask' : 17,
492'commandBuffer' : 18,
493'commandBufferCount' : 19,
494'commandPool' : 20,
495'compareOp' : 21,
496'components' : 22,
497'compositeAlpha' : 23,
498'connection' : 24,
499'contents' : 25,
500'countBuffer' : 26,
501'counter' : 27,
502'createInfoCount' : 28,
503'cullMode' : 29,
504'dataSize' : 30,
505'dependencyFlags' : 31,
506'depthCompareOp' : 32,
507'depthFailOp' : 33,
508'descriptorCount' : 34,
509'descriptorPool' : 35,
510'descriptorSet' : 36,
511'descriptorSetCount' : 37,
512'descriptorSetLayout' : 38,
513'descriptorType' : 39,
514'descriptorUpdateEntryCount' : 40,
515'descriptorUpdateTemplate' : 41,
516'descriptorWriteCount' : 42,
517'device' : 43,
518'deviceEvent' : 44,
519'disabledValidationCheckCount' : 45,
520'discardRectangleCount' : 46,
521'discardRectangleMode' : 47,
522'display' : 48,
523'displayEvent' : 49,
524'displayMode' : 50,
525'dpy' : 51,
526'dstAccessMask' : 52,
527'dstAlphaBlendFactor' : 53,
528'dstBuffer' : 54,
529'dstCache' : 55,
530'dstColorBlendFactor' : 56,
531'dstImage' : 57,
532'dstImageLayout' : 58,
533'dstSet' : 59,
534'dstStageMask' : 60,
535'dstSubresource' : 61,
536'dynamicStateCount' : 62,
537'event' : 63,
538'eventCount' : 64,
539'externalHandleType' : 65,
540'faceMask' : 66,
541'failOp' : 67,
542'fence' : 68,
543'fenceCount' : 69,
544'filter' : 70,
545'finalLayout' : 71,
546'flags' : 72,
547'format' : 73,
548'framebuffer' : 74,
549'front' : 75,
550'frontFace' : 76,
551'g' : 77,
552'handleType' : 78,
553'handleTypes' : 79,
554'image' : 80,
555'imageColorSpace' : 81,
556'imageFormat' : 82,
557'imageLayout' : 83,
558'imageSharingMode' : 84,
559'imageSubresource' : 85,
560'imageType' : 86,
561'imageUsage' : 87,
562'imageView' : 88,
563'indexType' : 89,
564'indirectCommandsLayout' : 90,
565'indirectCommandsTokenCount' : 91,
566'initialLayout' : 92,
567'inputRate' : 93,
568'instance' : 94,
569'layout' : 95,
570'level' : 96,
571'loadOp' : 97,
572'magFilter' : 98,
573'memory' : 99,
574'memoryRangeCount' : 100,
575'minFilter' : 101,
576'mipmapMode' : 102,
577'mode' : 103,
578'modes' : 104,
579'module' : 105,
580'newLayout' : 106,
581'objectCount' : 107,
582'objectTable' : 108,
583'objectType' : 109,
584'oldLayout' : 110,
585'oldSwapchain' : 111,
586'pAcquireInfo' : 112,
587'pAcquireKeys' : 113,
588'pAcquireSyncs' : 114,
589'pAcquireTimeoutMilliseconds' : 115,
590'pAcquireTimeouts' : 116,
591'pAllocateInfo' : 117,
592'pAllocator' : 118,
593'pApplicationInfo' : 119,
594'pApplicationName' : 120,
595'pAttachments' : 121,
596'pAttributes' : 122,
597'pBeginInfo' : 123,
598'pBindInfo' : 124,
599'pBindInfos' : 125,
600'pBindings' : 126,
601'pBinds' : 127,
602'pBuffer' : 128,
603'pBufferBinds' : 129,
604'pBufferMemoryBarriers' : 130,
605'pBuffers' : 131,
606'pCallback' : 132,
607'pCapabilities' : 133,
608'pCode' : 134,
609'pColor' : 135,
610'pColorAttachments' : 136,
611'pCommandBufferDeviceMasks' : 137,
612'pCommandBuffers' : 138,
613'pCommandPool' : 139,
614'pCommittedMemoryInBytes' : 140,
615'pCorrelationMasks' : 141,
616'pCounterValue' : 142,
617'pCreateInfo' : 143,
618'pCreateInfos' : 144,
619'pData' : 145,
620'pDataSize' : 146,
621'pDependencies' : 147,
622'pDepthStencil' : 148,
623'pDepthStencilAttachment' : 149,
624'pDescriptorCopies' : 150,
625'pDescriptorPool' : 151,
626'pDescriptorSets' : 152,
627'pDescriptorUpdateEntries' : 153,
628'pDescriptorUpdateTemplate' : 154,
629'pDescriptorWrites' : 155,
630'pDevice' : 156,
631'pDeviceEventInfo' : 157,
632'pDeviceGroupPresentCapabilities' : 158,
633'pDeviceIndices' : 159,
634'pDeviceMasks' : 160,
635'pDeviceRenderAreas' : 161,
636'pDisabledValidationChecks' : 162,
637'pDiscardRectangles' : 163,
638'pDisplay' : 164,
639'pDisplayCount' : 165,
640'pDisplayEventInfo' : 166,
641'pDisplayPowerInfo' : 167,
642'pDisplayTimingProperties' : 168,
643'pDisplays' : 169,
644'pDynamicOffsets' : 170,
645'pDynamicState' : 171,
646'pDynamicStates' : 172,
647'pEnabledFeatures' : 173,
648'pEngineName' : 174,
649'pEvent' : 175,
650'pEvents' : 176,
651'pExternalBufferInfo' : 177,
652'pExternalBufferProperties' : 178,
653'pExternalImageFormatProperties' : 179,
654'pExternalSemaphoreInfo' : 180,
655'pExternalSemaphoreProperties' : 181,
656'pFd' : 182,
657'pFeatures' : 183,
658'pFence' : 184,
659'pFences' : 185,
660'pFormatInfo' : 186,
661'pFormatProperties' : 187,
662'pFramebuffer' : 188,
663'pGranularity' : 189,
664'pHandle' : 190,
665'pImage' : 191,
666'pImageBinds' : 192,
667'pImageFormatInfo' : 193,
668'pImageFormatProperties' : 194,
669'pImageIndex' : 195,
670'pImageIndices' : 196,
671'pImageMemoryBarriers' : 197,
672'pImageOpaqueBinds' : 198,
673'pImportSemaphoreFdInfo' : 199,
674'pImportSemaphoreWin32HandleInfo' : 200,
675'pIndirectCommandsLayout' : 201,
676'pIndirectCommandsTokens' : 202,
677'pInitialData' : 203,
678'pInputAssemblyState' : 204,
679'pInputAttachments' : 205,
680'pInstance' : 206,
681'pLayerName' : 207,
682'pLayerPrefix' : 208,
683'pLayout' : 209,
684'pLimits' : 210,
685'pMarkerInfo' : 211,
686'pMarkerName' : 212,
687'pMemory' : 213,
688'pMemoryBarriers' : 214,
689'pMemoryFdProperties' : 215,
690'pMemoryProperties' : 216,
691'pMemoryRanges' : 217,
692'pMemoryRequirements' : 218,
693'pMemoryWin32HandleProperties' : 219,
694'pMessage' : 220,
695'pMetadata' : 221,
696'pMode' : 222,
697'pModes' : 223,
698'pName' : 224,
699'pNameInfo' : 225,
700'pNext' : 226,
701'pObjectEntryCounts' : 227,
702'pObjectEntryTypes' : 228,
703'pObjectEntryUsageFlags' : 229,
704'pObjectIndices' : 230,
705'pObjectName' : 231,
706'pObjectTable' : 232,
707'pOffsets' : 233,
708'pPeerMemoryFeatures' : 234,
709'pPhysicalDeviceCount' : 235,
710'pPhysicalDeviceGroupCount' : 236,
711'pPhysicalDeviceGroupProperties' : 237,
712'pPhysicalDevices' : 238,
713'pPipelineCache' : 239,
714'pPipelineLayout' : 240,
715'pPipelines' : 241,
716'pPoolSizes' : 242,
717'pPresentInfo' : 243,
718'pPresentModeCount' : 244,
719'pPresentModes' : 245,
720'pPresentationTimingCount' : 246,
721'pPresentationTimings' : 247,
722'pPreserveAttachments' : 248,
723'pProcessCommandsInfo' : 249,
724'pProperties' : 250,
725'pPropertyCount' : 251,
726'pPushConstantRanges' : 252,
727'pQueryPool' : 253,
728'pQueue' : 254,
729'pQueueCreateInfos' : 255,
730'pQueueFamilyProperties' : 256,
731'pQueueFamilyPropertyCount' : 257,
732'pQueuePriorities' : 258,
733'pRanges' : 259,
734'pRasterizationState' : 260,
735'pRectCount' : 261,
736'pRectangles' : 262,
737'pRects' : 263,
738'pRegions' : 264,
739'pReleaseKeys' : 265,
740'pReleaseSyncs' : 266,
741'pRenderPass' : 267,
742'pRenderPassBegin' : 268,
743'pReserveSpaceInfo' : 269,
744'pResolveAttachments' : 270,
745'pResults' : 271,
746'pSFRRects' : 272,
747'pSampleMask' : 273,
748'pSampler' : 274,
749'pScissors' : 275,
750'pSemaphore' : 276,
751'pSetLayout' : 277,
752'pSetLayouts' : 278,
753'pShaderModule' : 279,
754'pSignalSemaphoreDeviceIndices' : 280,
755'pSignalSemaphoreValues' : 281,
756'pSignalSemaphores' : 282,
757'pSparseMemoryRequirementCount' : 283,
758'pSparseMemoryRequirements' : 284,
759'pSpecializationInfo' : 285,
760'pSrcCaches' : 286,
761'pStages' : 287,
762'pSubmits' : 288,
763'pSubpasses' : 289,
764'pSubresource' : 290,
765'pSupported' : 291,
766'pSurface' : 292,
767'pSurfaceCapabilities' : 293,
768'pSurfaceFormatCount' : 294,
769'pSurfaceFormats' : 295,
770'pSurfaceInfo' : 296,
771'pSwapchain' : 297,
772'pSwapchainImageCount' : 298,
773'pSwapchainImages' : 299,
774'pSwapchains' : 300,
775'pTag' : 301,
776'pTagInfo' : 302,
777'pTimes' : 303,
778'pTokens' : 304,
779'pValues' : 305,
780'pVertexAttributeDescriptions' : 306,
781'pVertexBindingDescriptions' : 307,
782'pVertexInputState' : 308,
783'pView' : 309,
784'pViewMasks' : 310,
785'pViewOffsets' : 311,
786'pWaitDstStageMask' : 312,
787'pWaitSemaphoreDeviceIndices' : 313,
788'pWaitSemaphoreValues' : 314,
789'pWaitSemaphores' : 315,
790'passOp' : 316,
791'physicalDevice' : 317,
792'pipeline' : 318,
793'pipelineBindPoint' : 319,
794'pipelineCache' : 320,
795'pipelineLayout' : 321,
796'pipelineStage' : 322,
797'polygonMode' : 323,
798'poolSizeCount' : 324,
799'powerState' : 325,
800'ppData' : 326,
801'ppEnabledExtensionNames' : 327,
802'ppEnabledLayerNames' : 328,
803'ppObjectTableEntries' : 329,
804'preTransform' : 330,
805'presentMode' : 331,
806'queryPool' : 332,
807'queryType' : 333,
808'queue' : 334,
809'queueCount' : 335,
810'queueCreateInfoCount' : 336,
811'r' : 337,
812'rangeCount' : 338,
813'rasterizationOrder' : 339,
814'rasterizationSamples' : 340,
815'rectCount' : 341,
816'regionCount' : 342,
817'renderPass' : 343,
818'sType' : 344,
819'sampler' : 345,
820'samples' : 346,
821'scissorCount' : 347,
822'semaphore' : 348,
823'sequencesCountBuffer' : 349,
824'sequencesIndexBuffer' : 350,
825'shaderModule' : 351,
826'sharingMode' : 352,
827'size' : 353,
828'srcAccessMask' : 354,
829'srcAlphaBlendFactor' : 355,
830'srcBuffer' : 356,
831'srcCacheCount' : 357,
832'srcColorBlendFactor' : 358,
833'srcImage' : 359,
834'srcImageLayout' : 360,
835'srcSet' : 361,
836'srcStageMask' : 362,
837'srcSubresource' : 363,
838'stage' : 364,
839'stageCount' : 365,
840'stageFlags' : 366,
841'stageMask' : 367,
842'stencilLoadOp' : 368,
843'stencilStoreOp' : 369,
844'storeOp' : 370,
845'subpassCount' : 371,
846'subresource' : 372,
847'subresourceRange' : 373,
848'surface' : 374,
849'surfaceCounters' : 375,
850'swapchain' : 376,
851'swapchainCount' : 377,
852'tagSize' : 378,
853'targetCommandBuffer' : 379,
854'templateType' : 380,
855'tiling' : 381,
856'tokenCount' : 382,
857'tokenType' : 383,
858'topology' : 384,
859'transform' : 385,
860'type' : 386,
861'usage' : 387,
862'viewType' : 388,
863'viewportCount' : 389,
864'w' : 390,
865'window' : 391,
866'x' : 392,
867'y' : 393,
868'z' : 394,
869### ADD New implicit param mappings above this line
870}
871
872uniqueid_set = set() # store uniqueid to make sure we don't have duplicates
873
874# Convert a string VUID into numerical value
875# See "VUID Mapping Details" comment above for more info
876def convertVUID(vuid_string):
877 """Convert a string-based VUID into a numberical value"""
878 #func_struct_update = False
879 #imp_param_update = False
880 if vuid_string in ['', None]:
881 return -1
882 vuid_parts = vuid_string.split('-')
883 if vuid_parts[1] not in func_struct_id_map:
884 print ("ERROR: Missing func/struct map value for '%s'!" % (vuid_parts[1]))
885 print (" TODO: Need to add mapping for this to end of func_struct_id_map")
886 print (" replace '### ADD New func/struct mappings above this line' line with \"'%s' : %d,\"" % (vuid_parts[1], len(func_struct_id_map)))
887 func_struct_id_map[vuid_parts[1]] = len(func_struct_id_map)
888 #func_struct_update = True
889 sys.exit()
890 uniqueid = func_struct_id_map[vuid_parts[1]] << FUNC_STRUCT_SHIFT
891 if vuid_parts[-1].isdigit(): # explit VUID has int on the end
892 explicit_id = int(vuid_parts[-1])
893 # For explicit case, id is explicit_base + func/struct mapping + unique id
894 uniqueid = uniqueid + (explicit_id << EXPLICIT_ID_SHIFT) + explicit_bit0
895 else: # implicit case
896 if vuid_parts[-1] not in implicit_type_map:
897 print("ERROR: Missing mapping for implicit type '%s'!\nTODO: Please add new mapping." % (vuid_parts[-1]))
898 sys.exit()
899 else:
900 param_id = 0 # Default when no param is available
901 if vuid_parts[-2] != vuid_parts[1]: # we have a parameter
902 if vuid_parts[-2] in implicit_param_map:
903 param_id = implicit_param_map[vuid_parts[-2]]
904 else:
905 print ("ERROR: Missing param '%s' from implicit_param_map\n TODO: Please add new mapping." % (vuid_parts[-2]))
906 print (" replace '### ADD New implicit param mappings above this line' line with \"'%s' : %d,\"" % (vuid_parts[-2], len(implicit_param_map)))
907 implicit_param_map[vuid_parts[-2]] = len(implicit_param_map)
908 #imp_param_update = True
909 sys.exit()
910 uniqueid = uniqueid + (param_id << IMPLICIT_PARAM_SHIFT) + (implicit_type_map[vuid_parts[-1]] << IMPLICIT_TYPE_SHIFT) + implicit_bit0
911 else: # No parameter so that field is 0
912 uniqueid = uniqueid + (implicit_type_map[vuid_parts[-1]] << IMPLICIT_TYPE_SHIFT) + implicit_bit0
913 if uniqueid in uniqueid_set:
914 print ("ERROR: Uniqueid %d for string id %s is a duplicate!" % (uniqueid, vuid_string))
915 print (" TODO: Figure out what caused the dupe and fix it")
Tobin Ehlis2c932132017-05-19 16:32:15 -0600916 sys.exit()
Tobin Ehlis98d109a2017-05-11 14:42:38 -0600917 print ("Storing uniqueid %d for unique string %s" % (uniqueid, vuid_string))
918 uniqueid_set.add(uniqueid)
919# if func_struct_update:
920# print ("func_struct_id_map updated, here's new structure")
921# print ("func_struct_id_map = {")
922# fs_id = 0
923# for fs in sorted(func_struct_id_map):
924# print ("'%s' : %d," % (fs, fs_id))
925# fs_id = fs_id + 1
926# print ("### ADD New func/struct mappings above this line")
927# print ("}")
928# if imp_param_update:
929# print ("implicit_param_map updated, here's new structure")
930# print ("implicit_param_map = {")
931# ip_id = 0
932# for ip in sorted(implicit_param_map):
933# print ("'%s' : %d," % (ip, ip_id))
934# ip_id = ip_id + 1
935# print ("### ADD New implicit param mappings above this line")
936# print ("}")
937
938 return uniqueid