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