blob: f1b23df1937ed3d851319bcff2ac1c7a75620be3 [file] [log] [blame]
Tobin Ehlis5ade0692016-10-05 17:18:15 -06001#!/usr/bin/python3 -i
2
3import sys
4import xml.etree.ElementTree as etree
5import urllib2
6#import codecs
7
8#############################
9# spec.py script
10#
11# Overview - this script is intended to generate validation error codes and message strings from the xhtml version of
12# the specification. In addition to generating the header file, it provides a number of corrollary services to aid in
13# generating/updating the header.
14#
15# Ideal flow - Not there currently, but the ideal flow for this script would be that you run the script, it pulls the
16# latest spec, compares it to the current set of generated error codes, and makes any updates as needed
17#
18# Current flow - the current flow acheives all of the ideal flow goals, but with more steps than are desired
19# 1. Get the spec - right now spec has to be manually generated or pulled from the web
20# 2. Generate header from spec - This is done in a single command line
21# 3. Generate database file from spec - Can be done along with step #2 above, the database file contains a list of
22# all error enums and message strings, along with some other info on if those errors are implemented/tested
23# 4. Update header using a given database file as the root and a new spec file as goal - This makes sure that existing
24# errors keep the same enum identifier while also making sure that new errors get a unique_id that continues on
25# from the end of the previous highest unique_id.
26#
27# TODO:
28# 1. Improve string matching to add more automation for figuring out which messages are changed vs. completely new
29#
30#
31#############################
32
33
34spec_filename = "vkspec.html" # can override w/ '-spec <filename>' option
35out_filename = "vk_validation_error_messages.h" # can override w/ '-out <filename>' option
36db_filename = "vk_validation_error_database.txt" # can override w/ '-gendb <filename>' option
37gen_db = False # set to True when '-gendb <filename>' option provided
38spec_compare = False # set to True with '-compare <db_filename>' option
39# This is the root spec link that is used in error messages to point users to spec sections
40spec_url = "https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html"
41# After the custom validation error message, this is the prefix for the standard message that includes the
42# spec valid usage language as well as the link to nearest section of spec to that language
43error_msg_prefix = "For more information refer to Vulkan Spec Section "
44ns = {'ns': 'http://www.w3.org/1999/xhtml'}
45# Dict of new enum values that should be forced to remap to old handles, explicitly set by -remap option
46remap_dict = {}
47
48def printHelp():
49 print "Usage: python spec.py [-spec <specfile.html>] [-out <headerfile.h>] [-gendb <databasefile.txt>] [-compare <databasefile.txt>] [-update] [-remap <new_id-old_id,count>] [-help]"
50 print "\n Default script behavior is to parse the specfile and generate a header of unique error enums and corresponding error messages based on the specfile.\n"
51 print " Default specfile is from online at %s" % (spec_url)
52 print " Default headerfile is %s" % (out_filename)
53 print " Default databasefile is %s" % (db_filename)
54 print "\nIf '-gendb' option is specified then a database file is generated to default file or <databasefile.txt> if supplied. The database file stores"
55 print " the list of enums and their error messages."
56 print "\nIf '-compare' option is specified then the given database file will be read in as the baseline for generating the new specfile"
57 print "\nIf '-update' option is specified this triggers the master flow to automate updating header and database files using default db file as baseline"
58 print " and online spec file as the latest. The default header and database files will be updated in-place for review and commit to the git repo."
59 print "\nIf '-remap' option is specified it supplies forced remapping from new enum ids to old enum ids. This should only be specified along with -update"
60 print " option. Starting at newid and remapping to oldid, count ids will be remapped. Default count is '1' and use ':' to specify multiple remappings."
61
62class Specification:
63 def __init__(self):
64 self.tree = None
65 self.val_error_dict = {} # string for enum is key that references text for output message
66 self.error_db_dict = {} # dict of previous error values read in from database file
67 self.delimiter = '~^~' # delimiter for db file
68 self.copyright = """/* THIS FILE IS GENERATED. DO NOT EDIT. */
69
70/*
71 * Vulkan
72 *
73 * Copyright (c) 2016 Google Inc.
74 *
75 * Licensed under the Apache License, Version 2.0 (the "License");
76 * you may not use this file except in compliance with the License.
77 * You may obtain a copy of the License at
78 *
79 * http://www.apache.org/licenses/LICENSE-2.0
80 *
81 * Unless required by applicable law or agreed to in writing, software
82 * distributed under the License is distributed on an "AS IS" BASIS,
83 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
84 * See the License for the specific language governing permissions and
85 * limitations under the License.
86 *
87 * Author: Tobin Ehlis <tobine@google.com>
88 */"""
89 def _checkInternetSpec(self):
90 """Verify that we can access the spec online"""
91 try:
92 online = urllib2.urlopen(spec_url,timeout=1)
93 return True
94 except urllib2.URLError as err:
95 return False
96 return False
97 def loadFile(self, online=True, spec_file=spec_filename):
98 """Load an API registry XML file into a Registry object and parse it"""
99 # Check if spec URL is available
100 if (online and self._checkInternetSpec()):
101 print "Using spec from online at %s" % (spec_url)
102 self.tree = etree.parse(urllib2.urlopen(spec_url))
103 else:
104 print "Using local spec %s" % (spec_file)
105 self.tree = etree.parse(spec_file)
106 #self.tree.write("tree_output.xhtml")
107 #self.tree = etree.parse("tree_output.xhtml")
108 self.parseTree()
109 def updateDict(self, updated_dict):
110 """Assign internal dict to use updated_dict"""
111 self.val_error_dict = updated_dict
112 def parseTree(self):
113 """Parse the registry Element, once created"""
114 print "Parsing spec file..."
115 valid_usage = False # are we under a valid usage branch?
116 unique_enum_id = 0
117 self.root = self.tree.getroot()
118 #print "ROOT: %s" % self.root
119 prev_heading = '' # Last seen section heading or sub-heading
120 prev_link = '' # Last seen link id within the spec
121 for tag in self.root.iter(): # iterate down tree
122 # Grab most recent section heading and link
123 if tag.tag in ['{http://www.w3.org/1999/xhtml}h2', '{http://www.w3.org/1999/xhtml}h3']:
124 if tag.get('class') != 'title':
125 continue
126 #print "Found heading %s" % (tag.tag)
127 prev_heading = "".join(tag.itertext())
128 # Insert a space between heading number & title
129 sh_list = prev_heading.rsplit('.', 1)
130 prev_heading = '. '.join(sh_list)
131 prev_link = tag[0].get('id')
132 #print "Set prev_heading %s to have link of %s" % (prev_heading.encode("ascii", "ignore"), prev_link.encode("ascii", "ignore"))
133 elif tag.tag == '{http://www.w3.org/1999/xhtml}a': # grab any intermediate links
134 if tag.get('id') != None:
135 prev_link = tag.get('id')
136 #print "Updated prev link to %s" % (prev_link)
137 elif tag.tag == '{http://www.w3.org/1999/xhtml}strong': # identify valid usage sections
138 if None != tag.text and 'Valid Usage' in tag.text:
139 valid_usage = True
140 else:
141 valid_usage = False
142 elif tag.tag == '{http://www.w3.org/1999/xhtml}li' and valid_usage: # grab actual valid usage requirements
143 error_msg_str = "%s '%s' which states '%s' (%s#%s)" % (error_msg_prefix, prev_heading, "".join(tag.itertext()).replace('\n', ''), spec_url, prev_link)
144 # Some txt has multiple spaces so split on whitespace and join w/ single space
145 error_msg_str = " ".join(error_msg_str.split())
146 enum_str = "VALIDATION_ERROR_%05d" % (unique_enum_id)
147 # TODO : '\' chars in spec error messages are most likely bad spec txt that needs to be updated
148 self.val_error_dict[enum_str] = error_msg_str.encode("ascii", "ignore").replace("\\", "/")
149 unique_enum_id = unique_enum_id + 1
150 #print "dict contents: %s:" % (self.val_error_dict)
151 #print "Added enum to dict: %s" % (enum_str.encode("ascii", "ignore"))
152 #print "Validation Error Dict has a total of %d unique errors and contents are:\n%s" % (unique_enum_id, self.val_error_dict)
153 def genHeader(self, header_file):
154 """Generate a header file based on the contents of a parsed spec"""
155 print "Generating header %s..." % (header_file)
156 file_contents = []
157 file_contents.append(self.copyright)
158 file_contents.append('\n#pragma once')
159 file_contents.append('\n// enum values for unique validation error codes')
160 file_contents.append('// Corresponding validation error message for each enum is given in the mapping table below')
161 file_contents.append('// When a given error occurs, these enum values should be passed to the as the messageCode')
162 file_contents.append('// parameter to the PFN_vkDebugReportCallbackEXT function')
163 enum_decl = ['enum UNIQUE_VALIDATION_ERROR_CODE {']
164 error_string_map = ['std::unordered_map<int, char const *const> validation_error_map{']
165 for enum in sorted(self.val_error_dict):
166 #print "Header enum is %s" % (enum)
167 enum_decl.append(' %s = %d,' % (enum, int(enum.split('_')[-1])))
168 error_string_map.append(' {%s, "%s"},' % (enum, self.val_error_dict[enum]))
169 enum_decl.append('};')
170 error_string_map.append('};')
171 file_contents.extend(enum_decl)
172 file_contents.append('\n// Mapping from unique validation error enum to the corresponding error message')
173 file_contents.append('// The error message should be appended to the end of a custom error message that is passed')
174 file_contents.append('// as the pMessage parameter to the PFN_vkDebugReportCallbackEXT function')
175 file_contents.extend(error_string_map)
176 #print "File contents: %s" % (file_contents)
177 with open(header_file, "w") as outfile:
178 outfile.write("\n".join(file_contents))
179 def analyze(self):
180 """Print out some stats on the valid usage dict"""
181 # Create dict for # of occurences of identical strings
182 str_count_dict = {}
183 unique_id_count = 0
184 for enum in self.val_error_dict:
185 err_str = self.val_error_dict[enum]
186 if err_str in str_count_dict:
187 #print "Found repeat error string"
188 str_count_dict[err_str] = str_count_dict[err_str] + 1
189 else:
190 str_count_dict[err_str] = 1
191 unique_id_count = unique_id_count + 1
192 print "Processed %d unique_ids" % (unique_id_count)
193 repeat_string = 0
194 for es in str_count_dict:
195 if str_count_dict[es] > 1:
196 repeat_string = repeat_string + 1
197 #print "String '%s' repeated %d times" % (es, repeat_string)
198 print "Found %d repeat strings" % (repeat_string)
199 def genDB(self, db_file):
200 """Generate a database of check_enum, check_coded?, testname, error_string"""
201 db_lines = []
202 # Write header for database file
203 db_lines.append("# This is a database file with validation error check information")
204 db_lines.append("# Comments are denoted with '#' char")
205 db_lines.append("# The format of the lines is:")
206 db_lines.append("# <error_enum>%s<check_implemented>%s<testname>%s<errormsg>" % (self.delimiter, self.delimiter, self.delimiter))
207 db_lines.append("# error_enum: Unique error enum for this check of format VALIDATION_ERROR_<uniqueid>")
208 db_lines.append("# check_implemented: 'Y' if check has been implemented in layers, 'U' for unknown, or 'N' for not implemented")
209 db_lines.append("# testname: Name of validation test for this check, 'Unknown' for unknown, or 'None' if not implmented")
210 db_lines.append("# errormsg: The unique error message for this check that includes spec language and link")
211 for enum in sorted(self.val_error_dict):
212 # Default to unknown if check or test are implemented, then update below if appropriate
213 implemented = 'U'
214 testname = 'Unknown'
215 # If we have an existing db entry for this enum, use its implemented/testname values
216 if enum in self.error_db_dict:
217 implemented = self.error_db_dict[enum]['check_implemented']
218 testname = self.error_db_dict[enum]['testname']
219 #print "delimiter: %s, id: %s, str: %s" % (self.delimiter, enum, self.val_error_dict[enum])
220 # No existing entry so default to N for implemented and None for testname
221 db_lines.append("%s%s%s%s%s%s%s" % (enum, self.delimiter, implemented, self.delimiter, testname, self.delimiter, self.val_error_dict[enum]))
222 print "Generating database file %s" % (db_file)
223 with open(db_file, "w") as outfile:
224 outfile.write("\n".join(db_lines))
225 def readDB(self, db_file):
226 """Read a db file into a dict, format of each line is <enum><implemented Y|N?><testname><errormsg>"""
227 db_dict = {} # This is a simple db of just enum->errormsg, the same as is created from spec
228 max_id = 0
229 with open(db_file, "r") as infile:
230 for line in infile:
231 if line.startswith('#'):
232 continue
233 line = line.strip()
234 db_line = line.split(self.delimiter)
235 error_enum = db_line[0]
236 implemented = db_line[1]
237 testname = db_line[2]
238 error_str = db_line[3]
239 db_dict[error_enum] = error_str
240 # Also read complete database contents into our class var for later use
241 self.error_db_dict[error_enum] = {}
242 self.error_db_dict[error_enum]['check_implemented'] = implemented
243 self.error_db_dict[error_enum]['testname'] = testname
244 self.error_db_dict[error_enum]['error_string'] = error_str
245 unique_id = int(db_line[0].split('_')[-1])
246 if unique_id > max_id:
247 max_id = unique_id
248 return (db_dict, max_id)
249 # Compare unique ids from original database to data generated from updated spec
250 # 1. If a new id and error code exactly match original, great
251 # 2. If new id is not in original, but exact error code is, need to use original error code
252 # 3. If new id and new error are not in original, make sure new id picks up from end of original list
253 # 4. If new id in original, but error strings don't match then:
254 # 4a. If error string has exact match in original, update new to use original
255 # 4b. If error string not in original, may be updated error message, manually address
256 def compareDB(self, orig_db_dict, max_id):
257 """Compare orig database dict to new dict, report out findings, and return potential new dict for parsed spec"""
258 # First create reverse dicts of err_strings to IDs
259 next_id = max_id + 1
260 orig_err_to_id_dict = {}
261 # Create an updated dict in-place that will be assigned to self.val_error_dict when done
262 updated_val_error_dict = {}
263 for enum in orig_db_dict:
264 orig_err_to_id_dict[orig_db_dict[enum]] = enum
265 new_err_to_id_dict = {}
266 for enum in self.val_error_dict:
267 new_err_to_id_dict[self.val_error_dict[enum]] = enum
268 ids_parsed = 0
269 # Now parse through new dict and figure out what to do with non-matching things
270 for enum in sorted(self.val_error_dict):
271 ids_parsed = ids_parsed + 1
272 enum_list = enum.split('_') # grab sections of enum for use below
273 if enum in orig_db_dict:
274 if self.val_error_dict[enum] == orig_db_dict[enum]:
275 #print "Exact match for enum %s" % (enum)
276 # Nothing to see here
277 if enum in updated_val_error_dict:
278 print "ERROR: About to overwrite entry for %s" % (enum)
279 updated_val_error_dict[enum] = self.val_error_dict[enum]
280 elif self.val_error_dict[enum] in orig_err_to_id_dict:
281 # Same value w/ different error id, need to anchor to original id
282 #print "Need to switch new id %s to original id %s" % (enum, orig_err_to_id_dict[self.val_error_dict[enum]])
283 # Update id at end of new enum to be same id from original enum
284 enum_list[-1] = orig_err_to_id_dict[self.val_error_dict[enum]].split('_')[-1]
285 new_enum = "_".join(enum_list)
286 if new_enum in updated_val_error_dict:
287 print "ERROR: About to overwrite entry for %s" % (new_enum)
288 updated_val_error_dict[new_enum] = self.val_error_dict[enum]
289 else:
290 # No error match:
291 # First check if only link has changed, in which case keep ID but update message
292 orig_msg_list = orig_db_dict[enum].split('(', 1)
293 new_msg_list = self.val_error_dict[enum].split('(', 1)
294 if orig_msg_list[0] == new_msg_list[0]: # Msg is same bug link has changed, keep enum & update msg
295 print "NOTE: Found that only spec link changed for %s so keeping same id w/ new link" % (enum)
296 updated_val_error_dict[enum] = self.val_error_dict[enum]
297 # Second, check if user is forcing remap here
298 elif enum_list[-1] in remap_dict:
299 enum_list[-1] = remap_dict[enum_list[-1]]
300 new_enum = "_".join(enum_list)
301 print "NOTE: Using user-supplied remap to force %s to be %s" % (enum, new_enum)
302 updated_val_error_dict[new_enum] = self.val_error_dict[enum]
303 # Finally, this seems to be a new error so need to pick it up from end of original unique ids & flag for review
304 else:
305 enum_list[-1] = "%05d" % (next_id)
306 new_enum = "_".join(enum_list)
307 next_id = next_id + 1
308 print "MANUALLY VERIFY: Updated new enum %s to be unique %s. Make sure new error msg is actually unique and not just changed" % (enum, new_enum)
309 print " New error string: %s" % (self.val_error_dict[enum])
310 if new_enum in updated_val_error_dict:
311 print "ERROR: About to overwrite entry for %s" % (new_enum)
312 updated_val_error_dict[new_enum] = self.val_error_dict[enum]
313 else: # new enum is not in orig db
314 if self.val_error_dict[enum] in orig_err_to_id_dict:
315 #print "New enum %s not in orig dict, but exact error message matches original unique id %s" % (enum, orig_err_to_id_dict[self.val_error_dict[enum]])
316 # Update new unique_id to use original
317 enum_list[-1] = orig_err_to_id_dict[self.val_error_dict[enum]].split('_')[-1]
318 new_enum = "_".join(enum_list)
319 if new_enum in updated_val_error_dict:
320 print "ERROR: About to overwrite entry for %s" % (new_enum)
321 updated_val_error_dict[new_enum] = self.val_error_dict[enum]
322 else:
323 enum_list[-1] = "%05d" % (next_id)
324 new_enum = "_".join(enum_list)
325 next_id = next_id + 1
326 print "Completely new id and error code, update new id from %s to unique %s" % (enum, new_enum)
327 if new_enum in updated_val_error_dict:
328 print "ERROR: About to overwrite entry for %s" % (new_enum)
329 updated_val_error_dict[new_enum] = self.val_error_dict[enum]
330 # Assign parsed dict to be the udpated dict based on db compare
331 print "In compareDB parsed %d entries" % (ids_parsed)
332 return updated_val_error_dict
333 def validateUpdateDict(self, update_dict):
334 """Compare original dict vs. update dict and make sure that all of the checks are still there"""
335 # Currently just make sure that the same # of checks as the original checks are there
336 #orig_ids = {}
337 orig_id_count = len(self.val_error_dict)
338 #update_ids = {}
339 update_id_count = len(update_dict)
340 if orig_id_count != update_id_count:
341 print "Original dict had %d unique_ids, but updated dict has %d!" % (orig_id_count, update_id_count)
342 return False
343 print "Original dict and updated dict both have %d unique_ids. Great!" % (orig_id_count)
344 return True
345 # TODO : include some more analysis
346
347# User passes in arg of form <new_id1>-<old_id1>[,count1]:<new_id2>-<old_id2>[,count2]:...
348# new_id# = the new enum id that was assigned to an error
349# old_id# = the previous enum id that was assigned to the same error
350# [,count#] = The number of ids to remap starting at new_id#=old_id# and ending at new_id[#+count#-1]=old_id[#+count#-1]
351# If not supplied, then ,1 is assumed, which will only update a single id
352def updateRemapDict(remap_string):
353 """Set up global remap_dict based on user input"""
354 remap_list = remap_string.split(":")
355 for rmap in remap_list:
356 count = 1 # Default count if none supplied
357 id_count_list = rmap.split(',')
358 if len(id_count_list) > 1:
359 count = int(id_count_list[1])
360 new_old_id_list = id_count_list[0].split('-')
361 for offset in range(count):
362 remap_dict["%05d" % (int(new_old_id_list[0]) + offset)] = "%05d" % (int(new_old_id_list[1]) + offset)
363 for new_id in sorted(remap_dict):
364 print "Set to remap new id %s to old id %s" % (new_id, remap_dict[new_id])
365
366if __name__ == "__main__":
367 i = 1
368 use_online = True # Attempt to grab spec from online by default
369 update_option = False
370 while (i < len(sys.argv)):
371 arg = sys.argv[i]
372 i = i + 1
373 if (arg == '-spec'):
374 spec_filename = sys.argv[i]
375 # If user specifies local specfile, skip online
376 use_online = False
377 i = i + 1
378 elif (arg == '-out'):
379 out_filename = sys.argv[i]
380 i = i + 1
381 elif (arg == '-gendb'):
382 gen_db = True
383 # Set filename if supplied, else use default
384 if i < len(sys.argv) and not sys.argv[i].startswith('-'):
385 db_filename = sys.argv[i]
386 i = i + 1
387 elif (arg == '-compare'):
388 db_filename = sys.argv[i]
389 spec_compare = True
390 i = i + 1
391 elif (arg == '-update'):
392 update_option = True
393 spec_compare = True
394 gen_db = True
395 elif (arg == '-remap'):
396 updateRemapDict(sys.argv[i])
397 i = i + 1
398 elif (arg in ['-help', '-h']):
399 printHelp()
400 sys.exit()
401 if len(remap_dict) > 1 and not update_option:
402 print "ERROR: '-remap' option can only be used along with '-update' option. Exiting."
403 sys.exit()
404 spec = Specification()
405 spec.loadFile(use_online, spec_filename)
406 #spec.parseTree()
407 #spec.genHeader(out_filename)
408 spec.analyze()
409 if (spec_compare):
410 # Read in old spec info from db file
411 (orig_db_dict, max_id) = spec.readDB(db_filename)
412 # New spec data should already be read into self.val_error_dict
413 updated_dict = spec.compareDB(orig_db_dict, max_id)
414 update_valid = spec.validateUpdateDict(updated_dict)
415 if update_valid:
416 spec.updateDict(updated_dict)
417 else:
418 sys.exit()
419 if (gen_db):
420 spec.genDB(db_filename)
421 print "Writing out file (-out) to '%s'" % (out_filename)
422 spec.genHeader(out_filename)
423
424##### Example dataset
425# <div class="sidebar">
426# <div class="titlepage">
427# <div>
428# <div>
429# <p class="title">
430# <strong>Valid Usage</strong> # When we get to this guy, we know we're under interesting sidebar
431# </p>
432# </div>
433# </div>
434# </div>
435# <div class="itemizedlist">
436# <ul class="itemizedlist" style="list-style-type: disc; ">
437# <li class="listitem">
438# <em class="parameter">
439# <code>device</code>
440# </em>
441# <span class="normative">must</span> be a valid
442# <code class="code">VkDevice</code> handle
443# </li>
444# <li class="listitem">
445# <em class="parameter">
446# <code>commandPool</code>
447# </em>
448# <span class="normative">must</span> be a valid
449# <code class="code">VkCommandPool</code> handle
450# </li>
451# <li class="listitem">
452# <em class="parameter">
453# <code>flags</code>
454# </em>
455# <span class="normative">must</span> be a valid combination of
456# <code class="code">
457# <a class="link" href="#VkCommandPoolResetFlagBits">VkCommandPoolResetFlagBits</a>
458# </code> values
459# </li>
460# <li class="listitem">
461# <em class="parameter">
462# <code>commandPool</code>
463# </em>
464# <span class="normative">must</span> have been created, allocated, or retrieved from
465# <em class="parameter">
466# <code>device</code>
467# </em>
468# </li>
469# <li class="listitem">All
470# <code class="code">VkCommandBuffer</code>
471# objects allocated from
472# <em class="parameter">
473# <code>commandPool</code>
474# </em>
475# <span class="normative">must</span> not currently be pending execution
476# </li>
477# </ul>
478# </div>
479# </div>
480##### Second example dataset
481# <div class="sidebar">
482# <div class="titlepage">
483# <div>
484# <div>
485# <p class="title">
486# <strong>Valid Usage</strong>
487# </p>
488# </div>
489# </div>
490# </div>
491# <div class="itemizedlist">
492# <ul class="itemizedlist" style="list-style-type: disc; ">
493# <li class="listitem">The <em class="parameter"><code>queueFamilyIndex</code></em> member of any given element of <em class="parameter"><code>pQueueCreateInfos</code></em> <span class="normative">must</span> be unique within <em class="parameter"><code>pQueueCreateInfos</code></em>
494# </li>
495# </ul>
496# </div>
497# </div>
498# <div class="sidebar">
499# <div class="titlepage">
500# <div>
501# <div>
502# <p class="title">
503# <strong>Valid Usage (Implicit)</strong>
504# </p>
505# </div>
506# </div>
507# </div>
508# <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
509#<em class="parameter"><code>sType</code></em> <span class="normative">must</span> be <code class="code">VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO</code>
510#</li><li class="listitem">
511#<em class="parameter"><code>pNext</code></em> <span class="normative">must</span> be <code class="literal">NULL</code>
512#</li><li class="listitem">
513#<em class="parameter"><code>flags</code></em> <span class="normative">must</span> be <code class="literal">0</code>
514#</li><li class="listitem">
515#<em class="parameter"><code>pQueueCreateInfos</code></em> <span class="normative">must</span> be a pointer to an array of <em class="parameter"><code>queueCreateInfoCount</code></em> valid <code class="code">VkDeviceQueueCreateInfo</code> structures
516#</li>