From 6cfda7bab5bc9588afde7041c812256aa68ff620 Mon Sep 17 00:00:00 2001 From: Mike Stroyan Date: Thu, 7 Jan 2016 15:35:37 -0700 Subject: layers: bring xml and scripts from documentation These are repo git@gitlab.khronos.org:vulkan/vulkan.git from commit 51ffe091889e08ca5196c5635363a5358c85ff82 --- generator.py | 2184 +++++++++++++++++++++++++ genvk.py | 293 ++++ reg.py | 762 +++++++++ vk.xml | 5037 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 8276 insertions(+) create mode 100644 generator.py create mode 100755 genvk.py create mode 100755 reg.py create mode 100644 vk.xml diff --git a/generator.py b/generator.py new file mode 100644 index 00000000..b5729862 --- /dev/null +++ b/generator.py @@ -0,0 +1,2184 @@ +#!/usr/bin/python3 -i +import os,re,sys + +def write( *args, **kwargs ): + file = kwargs.pop('file',sys.stdout) + end = kwargs.pop( 'end','\n') + file.write( ' '.join([str(arg) for arg in args]) ) + file.write( end ) + +# noneStr - returns string argument, or "" if argument is None. +# Used in converting lxml Elements into text. +# str - string to convert +def noneStr(str): + if (str): + return str + else: + return "" + +# enquote - returns string argument with surrounding quotes, +# for serialization into Python code. +def enquote(str): + if (str): + return "'" + str + "'" + else: + return None + +# Primary sort key for regSortFeatures. +# Sorts by category of the feature name string: +# Core API features (those defined with a tag) +# ARB/KHR/OES (Khronos extensions) +# other (EXT/vendor extensions) +# This will need changing for Vulkan! +def regSortCategoryKey(feature): + if (feature.elem.tag == 'feature'): + return 0 + elif (feature.category == 'ARB' or + feature.category == 'KHR' or + feature.category == 'OES'): + return 1 + else: + return 2 + +# Secondary sort key for regSortFeatures. +# Sorts by extension name. +def regSortNameKey(feature): + return feature.name + +# Second sort key for regSortFeatures. +# Sorts by feature version. elements all have version number "0" +def regSortFeatureVersionKey(feature): + return float(feature.version) + +# Tertiary sort key for regSortFeatures. +# Sorts by extension number. elements all have extension number 0. +def regSortExtensionNumberKey(feature): + return int(feature.number) + +# regSortFeatures - default sort procedure for features. +# Sorts by primary key of feature category ('feature' or 'extension') +# then by version number (for features) +# then by extension number (for extensions) +def regSortFeatures(featureList): + featureList.sort(key = regSortExtensionNumberKey) + featureList.sort(key = regSortFeatureVersionKey) + featureList.sort(key = regSortCategoryKey) + +# GeneratorOptions - base class for options used during header production +# These options are target language independent, and used by +# Registry.apiGen() and by base OutputGenerator objects. +# +# Members +# filename - name of file to generate, or None to write to stdout. +# apiname - string matching 'apiname' attribute, e.g. 'gl'. +# profile - string specifying API profile , e.g. 'core', or None. +# versions - regex matching API versions to process interfaces for. +# Normally '.*' or '[0-9]\.[0-9]' to match all defined versions. +# emitversions - regex matching API versions to actually emit +# interfaces for (though all requested versions are considered +# when deciding which interfaces to generate). For GL 4.3 glext.h, +# this might be '1\.[2-5]|[2-4]\.[0-9]'. +# defaultExtensions - If not None, a string which must in its +# entirety match the pattern in the "supported" attribute of +# the . Defaults to None. Usually the same as apiname. +# addExtensions - regex matching names of additional extensions +# to include. Defaults to None. +# removeExtensions - regex matching names of extensions to +# remove (after defaultExtensions and addExtensions). Defaults +# to None. +# sortProcedure - takes a list of FeatureInfo objects and sorts +# them in place to a preferred order in the generated output. +# Default is core API versions, ARB/KHR/OES extensions, all +# other extensions, alphabetically within each group. +# The regex patterns can be None or empty, in which case they match +# nothing. +class GeneratorOptions: + """Represents options during header production from an API registry""" + def __init__(self, + filename = None, + apiname = None, + profile = None, + versions = '.*', + emitversions = '.*', + defaultExtensions = None, + addExtensions = None, + removeExtensions = None, + sortProcedure = regSortFeatures): + self.filename = filename + self.apiname = apiname + self.profile = profile + self.versions = self.emptyRegex(versions) + self.emitversions = self.emptyRegex(emitversions) + self.defaultExtensions = defaultExtensions + self.addExtensions = self.emptyRegex(addExtensions) + self.removeExtensions = self.emptyRegex(removeExtensions) + self.sortProcedure = sortProcedure + # + # Substitute a regular expression which matches no version + # or extension names for None or the empty string. + def emptyRegex(self,pat): + if (pat == None or pat == ''): + return '_nomatch_^' + else: + return pat + +# CGeneratorOptions - subclass of GeneratorOptions. +# +# Adds options used by COutputGenerator objects during C language header +# generation. +# +# Additional members +# prefixText - list of strings to prefix generated header with +# (usually a copyright statement + calling convention macros). +# protectFile - True if multiple inclusion protection should be +# generated (based on the filename) around the entire header. +# protectFeature - True if #ifndef..#endif protection should be +# generated around a feature interface in the header file. +# genFuncPointers - True if function pointer typedefs should be +# generated +# protectProto - If conditional protection should be generated +# around prototype declarations, set to either '#ifdef' +# to require opt-in (#ifdef protectProtoStr) or '#ifndef' +# to require opt-out (#ifndef protectProtoStr). Otherwise +# set to None. +# protectProtoStr - #ifdef/#ifndef symbol to use around prototype +# declarations, if protectProto is set +# apicall - string to use for the function declaration prefix, +# such as APICALL on Windows. +# apientry - string to use for the calling convention macro, +# in typedefs, such as APIENTRY. +# apientryp - string to use for the calling convention macro +# in function pointer typedefs, such as APIENTRYP. +# indentFuncProto - True if prototype declarations should put each +# parameter on a separate line +# indentFuncPointer - True if typedefed function pointers should put each +# parameter on a separate line +# alignFuncParam - if nonzero and parameters are being put on a +# separate line, align parameter names at the specified column +class CGeneratorOptions(GeneratorOptions): + """Represents options during C interface generation for headers""" + def __init__(self, + filename = None, + apiname = None, + profile = None, + versions = '.*', + emitversions = '.*', + defaultExtensions = None, + addExtensions = None, + removeExtensions = None, + sortProcedure = regSortFeatures, + prefixText = "", + genFuncPointers = True, + protectFile = True, + protectFeature = True, + protectProto = None, + protectProtoStr = None, + apicall = '', + apientry = '', + apientryp = '', + indentFuncProto = True, + indentFuncPointer = False, + alignFuncParam = 0): + GeneratorOptions.__init__(self, filename, apiname, profile, + versions, emitversions, defaultExtensions, + addExtensions, removeExtensions, sortProcedure) + self.prefixText = prefixText + self.genFuncPointers = genFuncPointers + self.protectFile = protectFile + self.protectFeature = protectFeature + self.protectProto = protectProto + self.protectProtoStr = protectProtoStr + self.apicall = apicall + self.apientry = apientry + self.apientryp = apientryp + self.indentFuncProto = indentFuncProto + self.indentFuncPointer = indentFuncPointer + self.alignFuncParam = alignFuncParam + +# DocGeneratorOptions - subclass of GeneratorOptions. +# +# Shares many members with CGeneratorOptions, since +# both are writing C-style declarations: +# +# prefixText - list of strings to prefix generated header with +# (usually a copyright statement + calling convention macros). +# apicall - string to use for the function declaration prefix, +# such as APICALL on Windows. +# apientry - string to use for the calling convention macro, +# in typedefs, such as APIENTRY. +# apientryp - string to use for the calling convention macro +# in function pointer typedefs, such as APIENTRYP. +# genDirectory - directory into which to generate include files +# indentFuncProto - True if prototype declarations should put each +# parameter on a separate line +# indentFuncPointer - True if typedefed function pointers should put each +# parameter on a separate line +# alignFuncParam - if nonzero and parameters are being put on a +# separate line, align parameter names at the specified column +# +# Additional members: +# +class DocGeneratorOptions(GeneratorOptions): + """Represents options during C interface generation for Asciidoc""" + def __init__(self, + filename = None, + apiname = None, + profile = None, + versions = '.*', + emitversions = '.*', + defaultExtensions = None, + addExtensions = None, + removeExtensions = None, + sortProcedure = regSortFeatures, + prefixText = "", + apicall = '', + apientry = '', + apientryp = '', + genDirectory = 'gen', + indentFuncProto = True, + indentFuncPointer = False, + alignFuncParam = 0, + expandEnumerants = True): + GeneratorOptions.__init__(self, filename, apiname, profile, + versions, emitversions, defaultExtensions, + addExtensions, removeExtensions, sortProcedure) + self.prefixText = prefixText + self.apicall = apicall + self.apientry = apientry + self.apientryp = apientryp + self.genDirectory = genDirectory + self.indentFuncProto = indentFuncProto + self.indentFuncPointer = indentFuncPointer + self.alignFuncParam = alignFuncParam + self.expandEnumerants = expandEnumerants + +# OutputGenerator - base class for generating API interfaces. +# Manages basic logic, logging, and output file control +# Derived classes actually generate formatted output. +# +# ---- methods ---- +# OutputGenerator(errFile, warnFile, diagFile) +# errFile, warnFile, diagFile - file handles to write errors, +# warnings, diagnostics to. May be None to not write. +# logMsg(level, *args) - log messages of different categories +# level - 'error', 'warn', or 'diag'. 'error' will also +# raise a UserWarning exception +# *args - print()-style arguments +# setExtMap(map) - specify a dictionary map from extension names to +# numbers, used in creating values for extension enumerants. +# beginFile(genOpts) - start a new interface file +# genOpts - GeneratorOptions controlling what's generated and how +# endFile() - finish an interface file, closing it when done +# beginFeature(interface, emit) - write interface for a feature +# and tag generated features as having been done. +# interface - element for the / to generate +# emit - actually write to the header only when True +# endFeature() - finish an interface. +# genType(typeinfo,name) - generate interface for a type +# typeinfo - TypeInfo for a type +# genStruct(typeinfo,name) - generate interface for a C "struct" type. +# typeinfo - TypeInfo for a type interpreted as a struct +# genGroup(groupinfo,name) - generate interface for a group of enums (C "enum") +# groupinfo - GroupInfo for a group +# genEnum(enuminfo, name) - generate interface for an enum (constant) +# enuminfo - EnumInfo for an enum +# name - enum name +# genCmd(cmdinfo) - generate interface for a command +# cmdinfo - CmdInfo for a command +# makeCDecls(cmd) - return C prototype and function pointer typedef for a +# Element, as a list of two strings +# cmd - Element for the +# newline() - print a newline to the output file (utility function) +# +class OutputGenerator: + """Generate specified API interfaces in a specific style, such as a C header""" + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + self.outFile = None + self.errFile = errFile + self.warnFile = warnFile + self.diagFile = diagFile + # Internal state + self.featureName = None + self.genOpts = None + self.registry = None + # Used for extension enum value generation + self.extBase = 1000000000 + self.extBlockSize = 1000 + # + # logMsg - write a message of different categories to different + # destinations. + # level - + # 'diag' (diagnostic, voluminous) + # 'warn' (warning) + # 'error' (fatal error - raises exception after logging) + # *args - print()-style arguments to direct to corresponding log + def logMsg(self, level, *args): + """Log a message at the given level. Can be ignored or log to a file""" + if (level == 'error'): + strfile = io.StringIO() + write('ERROR:', *args, file=strfile) + if (self.errFile != None): + write(strfile.getvalue(), file=self.errFile) + raise UserWarning(strfile.getvalue()) + elif (level == 'warn'): + if (self.warnFile != None): + write('WARNING:', *args, file=self.warnFile) + elif (level == 'diag'): + if (self.diagFile != None): + write('DIAG:', *args, file=self.diagFile) + else: + raise UserWarning( + '*** FATAL ERROR in Generator.logMsg: unknown level:' + level) + # + # enumToValue - parses and converts an tag into a value. + # Returns a list + # first element - integer representation of the value, or None + # if needsNum is False. The value must be a legal number + # if needsNum is True. + # second element - string representation of the value + # There are several possible representations of values. + # A 'value' attribute simply contains the value. + # A 'bitpos' attribute defines a value by specifying the bit + # position which is set in that value. + # A 'offset','extbase','extends' triplet specifies a value + # as an offset to a base value defined by the specified + # 'extbase' extension name, which is then cast to the + # typename specified by 'extends'. This requires probing + # the registry database, and imbeds knowledge of the + # Vulkan extension enum scheme in this function. + def enumToValue(self, elem, needsNum): + name = elem.get('name') + numVal = None + if ('value' in elem.keys()): + value = elem.get('value') + # print('About to translate value =', value, 'type =', type(value)) + if (needsNum): + numVal = int(value, 0) + # If there's a non-integer, numeric 'type' attribute (e.g. 'u' or + # 'ull'), append it to the string value. + # t = enuminfo.elem.get('type') + # if (t != None and t != '' and t != 'i' and t != 's'): + # value += enuminfo.type + self.logMsg('diag', 'Enum', name, '-> value [', numVal, ',', value, ']') + return [numVal, value] + if ('bitpos' in elem.keys()): + value = elem.get('bitpos') + numVal = int(value, 0) + numVal = 1 << numVal + value = '0x%08x' % numVal + self.logMsg('diag', 'Enum', name, '-> bitpos [', numVal, ',', value, ']') + return [numVal, value] + if ('offset' in elem.keys()): + # Obtain values in the mapping from the attributes + enumNegative = False + offset = int(elem.get('offset'),0) + extnumber = int(elem.get('extnumber'),0) + extends = elem.get('extends') + if ('dir' in elem.keys()): + enumNegative = True + self.logMsg('diag', 'Enum', name, 'offset =', offset, + 'extnumber =', extnumber, 'extends =', extends, + 'enumNegative =', enumNegative) + # Now determine the actual enumerant value, as defined + # in the "Layers and Extensions" appendix of the spec. + numVal = self.extBase + (extnumber - 1) * self.extBlockSize + offset + if (enumNegative): + numVal = -numVal + value = '%d' % numVal + # More logic needed! + self.logMsg('diag', 'Enum', name, '-> offset [', numVal, ',', value, ']') + return [numVal, value] + return [None, None] + # + def beginFile(self, genOpts): + self.genOpts = genOpts + # + # Open specified output file. Not done in constructor since a + # Generator can be used without writing to a file. + if (self.genOpts.filename != None): + self.outFile = open(self.genOpts.filename, 'w') + else: + self.outFile = sys.stdout + def endFile(self): + self.errFile and self.errFile.flush() + self.warnFile and self.warnFile.flush() + self.diagFile and self.diagFile.flush() + self.outFile.flush() + if (self.outFile != sys.stdout and self.outFile != sys.stderr): + self.outFile.close() + self.genOpts = None + # + def beginFeature(self, interface, emit): + self.emit = emit + self.featureName = interface.get('name') + # If there's an additional 'protect' attribute in the feature, save it + self.featureExtraProtect = interface.get('protect') + def endFeature(self): + # Derived classes responsible for emitting feature + self.featureName = None + self.featureExtraProtect = None + # Utility method to validate we're generating something only inside a + # tag + def validateFeature(self, featureType, featureName): + if (self.featureName == None): + raise UserWarning('Attempt to generate', featureType, name, + 'when not in feature') + # + # Type generation + def genType(self, typeinfo, name): + self.validateFeature('type', name) + # + # Struct (e.g. C "struct" type) generation + def genStruct(self, typeinfo, name): + self.validateFeature('struct', name) + # + # Group (e.g. C "enum" type) generation + def genGroup(self, groupinfo, name): + self.validateFeature('group', name) + # + # Enumerant (really, constant) generation + def genEnum(self, enuminfo, name): + self.validateFeature('enum', name) + # + # Command generation + def genCmd(self, cmd, name): + self.validateFeature('command', name) + # + # Utility functions - turn a into C-language prototype + # and typedef declarations for that name. + # name - contents of tag + # tail - whatever text follows that tag in the Element + def makeProtoName(self, name, tail): + return self.genOpts.apientry + name + tail + def makeTypedefName(self, name, tail): + return '(' + self.genOpts.apientryp + 'PFN_' + name + tail + ')' + # + # makeCParamDecl - return a string which is an indented, formatted + # declaration for a or block (e.g. function parameter + # or structure/union member). + # param - Element ( or ) to format + # aligncol - if non-zero, attempt to align the nested element + # at this column + def makeCParamDecl(self, param, aligncol): + paramdecl = ' ' + noneStr(param.text) + for elem in param: + text = noneStr(elem.text) + tail = noneStr(elem.tail) + if (elem.tag == 'name' and aligncol > 0): + self.logMsg('diag', 'Aligning parameter', elem.text, 'to column', self.genOpts.alignFuncParam) + # Align at specified column, if possible + paramdecl = paramdecl.rstrip() + oldLen = len(paramdecl) + paramdecl = paramdecl.ljust(aligncol) + newLen = len(paramdecl) + self.logMsg('diag', 'Adjust length of parameter decl from', oldLen, 'to', newLen, ':', paramdecl) + paramdecl += text + tail + return paramdecl + # + # getCParamTypeLength - return the length of the type field is an indented, formatted + # declaration for a or block (e.g. function parameter + # or structure/union member). + # param - Element ( or ) to identify + def getCParamTypeLength(self, param): + paramdecl = ' ' + noneStr(param.text) + for elem in param: + text = noneStr(elem.text) + tail = noneStr(elem.tail) + if (elem.tag == 'name'): + # Align at specified column, if possible + newLen = len(paramdecl.rstrip()) + self.logMsg('diag', 'Identifying length of', elem.text, 'as', newLen) + paramdecl += text + tail + return newLen + # + # makeCDecls - return C prototype and function pointer typedef for a + # command, as a two-element list of strings. + # cmd - Element containing a tag + def makeCDecls(self, cmd): + """Generate C function pointer typedef for Element""" + proto = cmd.find('proto') + params = cmd.findall('param') + # Begin accumulating prototype and typedef strings + pdecl = self.genOpts.apicall + tdecl = 'typedef ' + # + # Insert the function return type/name. + # For prototypes, add APIENTRY macro before the name + # For typedefs, add (APIENTRY *) around the name and + # use the PFN_cmdnameproc naming convention. + # Done by walking the tree for element by element. + # lxml.etree has elem.text followed by (elem[i], elem[i].tail) + # for each child element and any following text + # Leading text + pdecl += noneStr(proto.text) + tdecl += noneStr(proto.text) + # For each child element, if it's a wrap in appropriate + # declaration. Otherwise append its contents and tail contents. + for elem in proto: + text = noneStr(elem.text) + tail = noneStr(elem.tail) + if (elem.tag == 'name'): + pdecl += self.makeProtoName(text, tail) + tdecl += self.makeTypedefName(text, tail) + else: + pdecl += text + tail + tdecl += text + tail + # Now add the parameter declaration list, which is identical + # for prototypes and typedefs. Concatenate all the text from + # a node without the tags. No tree walking required + # since all tags are ignored. + # Uses: self.indentFuncProto + # self.indentFuncPointer + # self.alignFuncParam + # Might be able to doubly-nest the joins, e.g. + # ','.join(('_'.join([l[i] for i in range(0,len(l))]) + n = len(params) + # Indented parameters + if n > 0: + indentdecl = '(\n' + for i in range(0,n): + paramdecl = self.makeCParamDecl(params[i], self.genOpts.alignFuncParam) + if (i < n - 1): + paramdecl += ',\n' + else: + paramdecl += ');' + indentdecl += paramdecl + else: + indentdecl = '(void);' + # Non-indented parameters + paramdecl = '(' + if n > 0: + for i in range(0,n): + paramdecl += ''.join([t for t in params[i].itertext()]) + if (i < n - 1): + paramdecl += ', ' + else: + paramdecl += 'void' + paramdecl += ");"; + return [ pdecl + indentdecl, tdecl + paramdecl ] + # + def newline(self): + write('', file=self.outFile) + + def setRegistry(self, registry): + self.registry = registry + # + +# COutputGenerator - subclass of OutputGenerator. +# Generates C-language API interfaces. +# +# ---- methods ---- +# COutputGenerator(errFile, warnFile, diagFile) - args as for +# OutputGenerator. Defines additional internal state. +# ---- methods overriding base class ---- +# beginFile(genOpts) +# endFile() +# beginFeature(interface, emit) +# endFeature() +# genType(typeinfo,name) +# genStruct(typeinfo,name) +# genGroup(groupinfo,name) +# genEnum(enuminfo, name) +# genCmd(cmdinfo) +class COutputGenerator(OutputGenerator): + """Generate specified API interfaces in a specific style, such as a C header""" + # This is an ordered list of sections in the header file. + TYPE_SECTIONS = ['include', 'define', 'basetype', 'handle', 'enum', + 'group', 'bitmask', 'funcpointer', 'struct'] + ALL_SECTIONS = TYPE_SECTIONS + ['commandPointer', 'command'] + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + OutputGenerator.__init__(self, errFile, warnFile, diagFile) + # Internal state - accumulators for different inner block text + self.sections = dict([(section, []) for section in self.ALL_SECTIONS]) + # + def beginFile(self, genOpts): + OutputGenerator.beginFile(self, genOpts) + # C-specific + # + # Multiple inclusion protection & C++ wrappers. + if (genOpts.protectFile and self.genOpts.filename): + headerSym = '__' + re.sub('\.h', '_h_', os.path.basename(self.genOpts.filename)) + write('#ifndef', headerSym, file=self.outFile) + write('#define', headerSym, '1', file=self.outFile) + self.newline() + write('#ifdef __cplusplus', file=self.outFile) + write('extern "C" {', file=self.outFile) + write('#endif', file=self.outFile) + self.newline() + # + # User-supplied prefix text, if any (list of strings) + if (genOpts.prefixText): + for s in genOpts.prefixText: + write(s, file=self.outFile) + # + # Some boilerplate describing what was generated - this + # will probably be removed later since the extensions + # pattern may be very long. + # write('/* Generated C header for:', file=self.outFile) + # write(' * API:', genOpts.apiname, file=self.outFile) + # if (genOpts.profile): + # write(' * Profile:', genOpts.profile, file=self.outFile) + # write(' * Versions considered:', genOpts.versions, file=self.outFile) + # write(' * Versions emitted:', genOpts.emitversions, file=self.outFile) + # write(' * Default extensions included:', genOpts.defaultExtensions, file=self.outFile) + # write(' * Additional extensions included:', genOpts.addExtensions, file=self.outFile) + # write(' * Extensions removed:', genOpts.removeExtensions, file=self.outFile) + # write(' */', file=self.outFile) + def endFile(self): + # C-specific + # Finish C++ wrapper and multiple inclusion protection + self.newline() + write('#ifdef __cplusplus', file=self.outFile) + write('}', file=self.outFile) + write('#endif', file=self.outFile) + if (self.genOpts.protectFile and self.genOpts.filename): + self.newline() + write('#endif', file=self.outFile) + # Finish processing in superclass + OutputGenerator.endFile(self) + def beginFeature(self, interface, emit): + # Start processing in superclass + OutputGenerator.beginFeature(self, interface, emit) + # C-specific + # Accumulate includes, defines, types, enums, function pointer typedefs, + # end function prototypes separately for this feature. They're only + # printed in endFeature(). + self.sections = dict([(section, []) for section in self.ALL_SECTIONS]) + def endFeature(self): + # C-specific + # Actually write the interface to the output file. + if (self.emit): + self.newline() + if (self.genOpts.protectFeature): + write('#ifndef', self.featureName, file=self.outFile) + # If type declarations are needed by other features based on + # this one, it may be necessary to suppress the ExtraProtect, + # or move it below the 'for section...' loop. + if (self.featureExtraProtect != None): + write('#ifdef', self.featureExtraProtect, file=self.outFile) + write('#define', self.featureName, '1', file=self.outFile) + for section in self.TYPE_SECTIONS: + contents = self.sections[section] + if contents: + write('\n'.join(contents), file=self.outFile) + self.newline() + if (self.genOpts.genFuncPointers and self.sections['commandPointer']): + write('\n'.join(self.sections['commandPointer']), file=self.outFile) + self.newline() + if (self.sections['command']): + if (self.genOpts.protectProto): + write(self.genOpts.protectProto, + self.genOpts.protectProtoStr, file=self.outFile) + write('\n'.join(self.sections['command']), end='', file=self.outFile) + if (self.genOpts.protectProto): + write('#endif', file=self.outFile) + else: + self.newline() + if (self.featureExtraProtect != None): + write('#endif /*', self.featureExtraProtect, '*/', file=self.outFile) + if (self.genOpts.protectFeature): + write('#endif /*', self.featureName, '*/', file=self.outFile) + # Finish processing in superclass + OutputGenerator.endFeature(self) + # + # Append a definition to the specified section + def appendSection(self, section, text): + # self.sections[section].append('SECTION: ' + section + '\n') + self.sections[section].append(text) + # + # Type generation + def genType(self, typeinfo, name): + OutputGenerator.genType(self, typeinfo, name) + typeElem = typeinfo.elem + # If the type is a struct type, traverse the imbedded tags + # generating a structure. Otherwise, emit the tag text. + category = typeElem.get('category') + if (category == 'struct' or category == 'union'): + self.genStruct(typeinfo, name) + else: + # Replace tags with an APIENTRY-style string + # (from self.genOpts). Copy other text through unchanged. + # If the resulting text is an empty string, don't emit it. + s = noneStr(typeElem.text) + for elem in typeElem: + if (elem.tag == 'apientry'): + s += self.genOpts.apientry + noneStr(elem.tail) + else: + s += noneStr(elem.text) + noneStr(elem.tail) + if s: + # Add extra newline after multi-line entries. + if '\n' in s: + s += '\n' + self.appendSection(category, s) + # + # Struct (e.g. C "struct" type) generation. + # This is a special case of the tag where the contents are + # interpreted as a set of tags instead of freeform C + # C type declarations. The tags are just like + # tags - they are a declaration of a struct or union member. + # Only simple member declarations are supported (no nested + # structs etc.) + def genStruct(self, typeinfo, typeName): + OutputGenerator.genStruct(self, typeinfo, typeName) + body = 'typedef ' + typeinfo.elem.get('category') + ' ' + typeName + ' {\n' + # paramdecl = self.makeCParamDecl(typeinfo.elem, self.genOpts.alignFuncParam) + targetLen = 0; + for member in typeinfo.elem.findall('.//member'): + targetLen = max(targetLen, self.getCParamTypeLength(member)) + for member in typeinfo.elem.findall('.//member'): + body += self.makeCParamDecl(member, targetLen + 4) + body += ';\n' + body += '} ' + typeName + ';\n' + self.appendSection('struct', body) + # + # Group (e.g. C "enum" type) generation. + # These are concatenated together with other types. + def genGroup(self, groupinfo, groupName): + OutputGenerator.genGroup(self, groupinfo, groupName) + groupElem = groupinfo.elem + # See if this group needs min/max/num/padding at end + expand = 'expand' in groupElem.keys() + if (expand): + expandPrefix = groupElem.get('expand') + # Prefix + body = "\ntypedef enum " + groupName + " {\n" + + # Loop over the nested 'enum' tags. Keep track of the minimum and + # maximum numeric values, if they can be determined; but only for + # core API enumerants, not extension enumerants. This is inferred + # by looking for 'extends' attributes. + minName = None + for elem in groupElem.findall('enum'): + # Convert the value to an integer and use that to track min/max. + # Values of form -(number) are accepted but nothing more complex. + # Should catch exceptions here for more complex constructs. Not yet. + (numVal,strVal) = self.enumToValue(elem, True) + name = elem.get('name') + body += " " + name + " = " + strVal + ",\n" + if (expand and elem.get('extends') is None): + if (minName == None): + minName = maxName = name + minValue = maxValue = numVal + elif (numVal < minValue): + minName = name + minValue = numVal + elif (numVal > maxValue): + maxName = name + maxValue = numVal + # Generate min/max value tokens and a range-padding enum. Need some + # additional padding to generate correct names... + if (expand): + body += " " + expandPrefix + "_BEGIN_RANGE = " + minName + ",\n" + body += " " + expandPrefix + "_END_RANGE = " + maxName + ",\n" + body += " " + expandPrefix + "_RANGE_SIZE = (" + maxName + " - " + minName + " + 1),\n" + body += " " + expandPrefix + "_MAX_ENUM = 0x7FFFFFFF\n" + # Postfix + body += "} " + groupName + ";" + if groupElem.get('type') == 'bitmask': + section = 'bitmask' + else: + section = 'group' + self.appendSection(section, body) + # Enumerant generation + # tags may specify their values in several ways, but are usually + # just integers. + def genEnum(self, enuminfo, name): + OutputGenerator.genEnum(self, enuminfo, name) + (numVal,strVal) = self.enumToValue(enuminfo.elem, False) + body = '#define ' + name.ljust(33) + ' ' + strVal + self.appendSection('enum', body) + # + # Command generation + def genCmd(self, cmdinfo, name): + OutputGenerator.genCmd(self, cmdinfo, name) + # + decls = self.makeCDecls(cmdinfo.elem) + self.appendSection('command', decls[0] + '\n') + if (self.genOpts.genFuncPointers): + self.appendSection('commandPointer', decls[1]) + +# DocOutputGenerator - subclass of OutputGenerator. +# Generates AsciiDoc includes with C-language API interfaces, for reference +# pages and the Vulkan specification. Similar to COutputGenerator, but +# each interface is written into a different file as determined by the +# options, only actual C types are emitted, and none of the boilerplate +# preprocessor code is emitted. +# +# ---- methods ---- +# DocOutputGenerator(errFile, warnFile, diagFile) - args as for +# OutputGenerator. Defines additional internal state. +# ---- methods overriding base class ---- +# beginFile(genOpts) +# endFile() +# beginFeature(interface, emit) +# endFeature() +# genType(typeinfo,name) +# genStruct(typeinfo,name) +# genGroup(groupinfo,name) +# genEnum(enuminfo, name) +# genCmd(cmdinfo) +class DocOutputGenerator(OutputGenerator): + """Generate specified API interfaces in a specific style, such as a C header""" + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + OutputGenerator.__init__(self, errFile, warnFile, diagFile) + # + def beginFile(self, genOpts): + OutputGenerator.beginFile(self, genOpts) + def endFile(self): + OutputGenerator.endFile(self) + def beginFeature(self, interface, emit): + # Start processing in superclass + OutputGenerator.beginFeature(self, interface, emit) + def endFeature(self): + # Finish processing in superclass + OutputGenerator.endFeature(self) + # + # Generate an include file + # + # directory - subdirectory to put file in + # basename - base name of the file + # contents - contents of the file (Asciidoc boilerplate aside) + def writeInclude(self, directory, basename, contents): + # Create file + filename = self.genOpts.genDirectory + '/' + directory + '/' + basename + '.txt' + self.logMsg('diag', '# Generating include file:', filename) + fp = open(filename, 'w') + # Asciidoc anchor + write('[[{0},{0}]]'.format(basename), file=fp) + write('["source","{basebackend@docbook:c++:cpp}",title=""]', file=fp) + write('------------------------------------------------------------------------------', file=fp) + write(contents, file=fp) + write('------------------------------------------------------------------------------', file=fp) + fp.close() + # + # Type generation + def genType(self, typeinfo, name): + OutputGenerator.genType(self, typeinfo, name) + typeElem = typeinfo.elem + # If the type is a struct type, traverse the imbedded tags + # generating a structure. Otherwise, emit the tag text. + category = typeElem.get('category') + if (category == 'struct' or category == 'union'): + self.genStruct(typeinfo, name) + else: + # Replace tags with an APIENTRY-style string + # (from self.genOpts). Copy other text through unchanged. + # If the resulting text is an empty string, don't emit it. + s = noneStr(typeElem.text) + for elem in typeElem: + if (elem.tag == 'apientry'): + s += self.genOpts.apientry + noneStr(elem.tail) + else: + s += noneStr(elem.text) + noneStr(elem.tail) + if (len(s) > 0): + if (category == 'bitmask'): + self.writeInclude('flags', name, s + '\n') + elif (category == 'enum'): + self.writeInclude('enums', name, s + '\n') + elif (category == 'funcpointer'): + self.writeInclude('funcpointers', name, s+ '\n') + else: + self.logMsg('diag', '# NOT writing include file for type:', + name, 'category: ', category) + else: + self.logMsg('diag', '# NOT writing empty include file for type', name) + # + # Struct (e.g. C "struct" type) generation. + # This is a special case of the tag where the contents are + # interpreted as a set of tags instead of freeform C + # C type declarations. The tags are just like + # tags - they are a declaration of a struct or union member. + # Only simple member declarations are supported (no nested + # structs etc.) + def genStruct(self, typeinfo, typeName): + OutputGenerator.genStruct(self, typeinfo, typeName) + s = 'typedef ' + typeinfo.elem.get('category') + ' ' + typeName + ' {\n' + # paramdecl = self.makeCParamDecl(typeinfo.elem, self.genOpts.alignFuncParam) + targetLen = 0; + for member in typeinfo.elem.findall('.//member'): + targetLen = max(targetLen, self.getCParamTypeLength(member)) + for member in typeinfo.elem.findall('.//member'): + s += self.makeCParamDecl(member, targetLen + 4) + s += ';\n' + s += '} ' + typeName + ';' + self.writeInclude('structs', typeName, s) + # + # Group (e.g. C "enum" type) generation. + # These are concatenated together with other types. + def genGroup(self, groupinfo, groupName): + OutputGenerator.genGroup(self, groupinfo, groupName) + groupElem = groupinfo.elem + # See if this group needs min/max/num/padding at end + expand = self.genOpts.expandEnumerants and ('expand' in groupElem.keys()) + if (expand): + expandPrefix = groupElem.get('expand') + # Prefix + s = "typedef enum " + groupName + " {\n" + + # Loop over the nested 'enum' tags. Keep track of the minimum and + # maximum numeric values, if they can be determined. + minName = None + for elem in groupElem.findall('enum'): + # Convert the value to an integer and use that to track min/max. + # Values of form -(number) are accepted but nothing more complex. + # Should catch exceptions here for more complex constructs. Not yet. + (numVal,strVal) = self.enumToValue(elem, True) + name = elem.get('name') + s += " " + name + " = " + strVal + ",\n" + if (expand and elem.get('extends') is None): + if (minName == None): + minName = maxName = name + minValue = maxValue = numVal + elif (numVal < minValue): + minName = name + minValue = numVal + elif (numVal > maxValue): + maxName = name + maxValue = numVal + # Generate min/max value tokens and a range-padding enum. Need some + # additional padding to generate correct names... + if (expand): + s += "\n" + s += " " + expandPrefix + "_BEGIN_RANGE = " + minName + ",\n" + s += " " + expandPrefix + "_END_RANGE = " + maxName + ",\n" + s += " " + expandPrefix + "_NUM = (" + maxName + " - " + minName + " + 1),\n" + s += " " + expandPrefix + "_MAX_ENUM = 0x7FFFFFFF\n" + # Postfix + s += "} " + groupName + ";" + self.writeInclude('enums', groupName, s) + # Enumerant generation + # tags may specify their values in several ways, but are usually + # just integers. + def genEnum(self, enuminfo, name): + OutputGenerator.genEnum(self, enuminfo, name) + (numVal,strVal) = self.enumToValue(enuminfo.elem, False) + s = '#define ' + name.ljust(33) + ' ' + strVal + self.logMsg('diag', '# NOT writing compile-time constant', name) + # self.writeInclude('consts', name, s) + # + # Command generation + def genCmd(self, cmdinfo, name): + OutputGenerator.genCmd(self, cmdinfo, name) + # + decls = self.makeCDecls(cmdinfo.elem) + self.writeInclude('protos', name, decls[0]) + +# PyOutputGenerator - subclass of OutputGenerator. +# Generates Python data structures describing API names. +# Similar to DocOutputGenerator, but writes a single +# file. +# +# ---- methods ---- +# PyOutputGenerator(errFile, warnFile, diagFile) - args as for +# OutputGenerator. Defines additional internal state. +# ---- methods overriding base class ---- +# beginFile(genOpts) +# endFile() +# genType(typeinfo,name) +# genStruct(typeinfo,name) +# genGroup(groupinfo,name) +# genEnum(enuminfo, name) +# genCmd(cmdinfo) +class PyOutputGenerator(OutputGenerator): + """Generate specified API interfaces in a specific style, such as a C header""" + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + OutputGenerator.__init__(self, errFile, warnFile, diagFile) + # + def beginFile(self, genOpts): + OutputGenerator.beginFile(self, genOpts) + for dict in [ 'flags', 'enums', 'structs', 'consts', 'enums', + 'consts', 'protos', 'funcpointers' ]: + write(dict, '= {}', file=self.outFile) + def endFile(self): + OutputGenerator.endFile(self) + # + # Add a name from the interface + # + # dict - type of name (see beginFile above) + # name - name to add + # value - A serializable Python value for the name + def addName(self, dict, name, value=None): + write(dict + "['" + name + "'] = ", value, file=self.outFile) + # + # Type generation + # For 'struct' or 'union' types, defer to genStruct() to + # add to the dictionary. + # For 'bitmask' types, add the type name to the 'flags' dictionary, + # with the value being the corresponding 'enums' name defining + # the acceptable flag bits. + # For 'enum' types, add the type name to the 'enums' dictionary, + # with the value being '@STOPHERE@' (because this case seems + # never to happen). + # For 'funcpointer' types, add the type name to the 'funcpointers' + # dictionary. + # For 'handle' and 'define' types, add the handle or #define name + # to the 'struct' dictionary, because that's how the spec sources + # tag these types even though they aren't structs. + def genType(self, typeinfo, name): + OutputGenerator.genType(self, typeinfo, name) + typeElem = typeinfo.elem + # If the type is a struct type, traverse the imbedded tags + # generating a structure. Otherwise, emit the tag text. + category = typeElem.get('category') + if (category == 'struct' or category == 'union'): + self.genStruct(typeinfo, name) + else: + # Extract the type name + # (from self.genOpts). Copy other text through unchanged. + # If the resulting text is an empty string, don't emit it. + count = len(noneStr(typeElem.text)) + for elem in typeElem: + count += len(noneStr(elem.text)) + len(noneStr(elem.tail)) + if (count > 0): + if (category == 'bitmask'): + requiredEnum = typeElem.get('requires') + self.addName('flags', name, enquote(requiredEnum)) + elif (category == 'enum'): + # This case never seems to come up! + # @enums C 'enum' name Dictionary of enumerant names + self.addName('enums', name, enquote('@STOPHERE@')) + elif (category == 'funcpointer'): + self.addName('funcpointers', name, None) + elif (category == 'handle' or category == 'define'): + self.addName('structs', name, None) + else: + write('# Unprocessed type:', name, 'category:', category, file=self.outFile) + else: + write('# Unprocessed type:', name, file=self.outFile) + # + # Struct (e.g. C "struct" type) generation. + # + # Add the struct name to the 'structs' dictionary, with the + # value being an ordered list of the struct member names. + def genStruct(self, typeinfo, typeName): + OutputGenerator.genStruct(self, typeinfo, typeName) + + members = [member.text for member in typeinfo.elem.findall('.//member/name')] + self.addName('structs', typeName, members) + # + # Group (e.g. C "enum" type) generation. + # These are concatenated together with other types. + # + # Add the enum type name to the 'enums' dictionary, with + # the value being an ordered list of the enumerant names. + # Add each enumerant name to the 'consts' dictionary, with + # the value being the enum type the enumerant is part of. + def genGroup(self, groupinfo, groupName): + OutputGenerator.genGroup(self, groupinfo, groupName) + groupElem = groupinfo.elem + + # @enums C 'enum' name Dictionary of enumerant names + # @consts C enumerant/const name Name of corresponding 'enums' key + + # Loop over the nested 'enum' tags. Keep track of the minimum and + # maximum numeric values, if they can be determined. + enumerants = [elem.get('name') for elem in groupElem.findall('enum')] + for name in enumerants: + self.addName('consts', name, enquote(groupName)) + self.addName('enums', groupName, enumerants) + # Enumerant generation (compile-time constants) + # + # Add the constant name to the 'consts' dictionary, with the + # value being None to indicate that the constant isn't + # an enumeration value. + def genEnum(self, enuminfo, name): + OutputGenerator.genEnum(self, enuminfo, name) + + # @consts C enumerant/const name Name of corresponding 'enums' key + + self.addName('consts', name, None) + # + # Command generation + # + # Add the command name to the 'protos' dictionary, with the + # value being an ordered list of the parameter names. + def genCmd(self, cmdinfo, name): + OutputGenerator.genCmd(self, cmdinfo, name) + + params = [param.text for param in cmdinfo.elem.findall('param/name')] + self.addName('protos', name, params) + +# ValidityOutputGenerator - subclass of OutputGenerator. +# Generates AsciiDoc includes of valid usage information, for reference +# pages and the Vulkan specification. Similar to DocOutputGenerator. +# +# ---- methods ---- +# ValidityOutputGenerator(errFile, warnFile, diagFile) - args as for +# OutputGenerator. Defines additional internal state. +# ---- methods overriding base class ---- +# beginFile(genOpts) +# endFile() +# beginFeature(interface, emit) +# endFeature() +# genCmd(cmdinfo) +class ValidityOutputGenerator(OutputGenerator): + """Generate specified API interfaces in a specific style, such as a C header""" + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + OutputGenerator.__init__(self, errFile, warnFile, diagFile) + + def beginFile(self, genOpts): + OutputGenerator.beginFile(self, genOpts) + def endFile(self): + OutputGenerator.endFile(self) + def beginFeature(self, interface, emit): + # Start processing in superclass + OutputGenerator.beginFeature(self, interface, emit) + def endFeature(self): + # Finish processing in superclass + OutputGenerator.endFeature(self) + + def makeParameterName(self, name): + return 'pname:' + name + + def makeStructName(self, name): + return 'sname:' + name + + def makeBaseTypeName(self, name): + return 'basetype:' + name + + def makeEnumerationName(self, name): + return 'elink:' + name + + def makeEnumerantName(self, name): + return 'ename:' + name + + def makeFLink(self, name): + return 'flink:' + name + + # + # Generate an include file + # + # directory - subdirectory to put file in + # basename - base name of the file + # contents - contents of the file (Asciidoc boilerplate aside) + def writeInclude(self, directory, basename, validity, threadsafety, commandpropertiesentry, successcodes, errorcodes): + # Create file + filename = self.genOpts.genDirectory + '/' + directory + '/' + basename + '.txt' + self.logMsg('diag', '# Generating include file:', filename) + fp = open(filename, 'w') + # Asciidoc anchor + + # Valid Usage + if validity is not None: + write('.Valid Usage', file=fp) + write('*' * 80, file=fp) + write(validity, file=fp, end='') + write('*' * 80, file=fp) + write('', file=fp) + + # Host Synchronization + if threadsafety is not None: + write('.Host Synchronization', file=fp) + write('*' * 80, file=fp) + write(threadsafety, file=fp, end='') + write('*' * 80, file=fp) + write('', file=fp) + + # Command Properties - contained within a block, to avoid table numbering + if commandpropertiesentry is not None: + write('.Command Properties', file=fp) + write('*' * 80, file=fp) + write('[options="header", width="100%"]', file=fp) + write('|=====================', file=fp) + write('|Command Buffer Levels|Render Pass Scope|Supported Queue Types', file=fp) + write(commandpropertiesentry, file=fp) + write('|=====================', file=fp) + write('*' * 80, file=fp) + write('', file=fp) + + # Success Codes - contained within a block, to avoid table numbering + if successcodes is not None or errorcodes is not None: + write('.Return Codes', file=fp) + write('*' * 80, file=fp) + if successcodes is not None: + write('<>::', file=fp) + write(successcodes, file=fp) + if errorcodes is not None: + write('<>::', file=fp) + write(errorcodes, file=fp) + write('*' * 80, file=fp) + write('', file=fp) + + fp.close() + + # + # Check if the parameter passed in is a pointer + def paramIsPointer(self, param): + ispointer = False + paramtype = param.find('type') + if paramtype.tail is not None and '*' in paramtype.tail: + ispointer = True + + return ispointer + + # + # Check if the parameter passed in is a static array + def paramIsStaticArray(self, param): + if param.find('name').tail is not None: + if param.find('name').tail[0] == '[': + return True + + # + # Get the length of a parameter that's been identified as a static array + def staticArrayLength(self, param): + paramname = param.find('name') + paramenumsize = param.find('enum') + + if paramenumsize is not None: + return paramenumsize.text + else: + return paramname.tail[1:-1] + + # + # Check if the parameter passed in is a pointer to an array + def paramIsArray(self, param): + return param.attrib.get('len') is not None + + # + # Get the parent of a handle object + def getHandleParent(self, typename): + types = self.registry.findall("types/type") + for elem in types: + if (elem.find("name") is not None and elem.find('name').text == typename) or elem.attrib.get('name') == typename: + return elem.attrib.get('parent') + + # + # Check if a parent object is dispatchable or not + def isHandleTypeDispatchable(self, handlename): + handle = self.registry.find("types/type/[name='" + handlename + "'][@category='handle']") + if handle is not None and handle.find('type').text == 'VK_DEFINE_HANDLE': + return True + else: + return False + + def isHandleOptional(self, param, params): + + # See if the handle is optional + isOptional = False + + # Simple, if it's optional, return true + if param.attrib.get('optional') is not None: + return True + + # If no validity is being generated, it usually means that validity is complex and not absolute, so let's say yes. + if param.attrib.get('noautovalidity') is not None: + return True + + # If the parameter is an array and we haven't already returned, find out if any of the len parameters are optional + if self.paramIsArray(param): + lengths = param.attrib.get('len').split(',') + for length in lengths: + if (length) != 'null-terminated' and (length) != '1': + for otherparam in params: + if otherparam.find('name').text == length: + if otherparam.attrib.get('optional') is not None: + return True + + return False + # + # Get the category of a type + def getTypeCategory(self, typename): + types = self.registry.findall("types/type") + for elem in types: + if (elem.find("name") is not None and elem.find('name').text == typename) or elem.attrib.get('name') == typename: + return elem.attrib.get('category') + + # + # Make a chunk of text for the end of a parameter if it is an array + def makeAsciiDocPreChunk(self, param, params): + paramname = param.find('name') + paramtype = param.find('type') + + # General pre-amble. Check optionality and add stuff. + asciidoc = '* ' + + if self.paramIsStaticArray(param): + asciidoc += 'Any given element of ' + + elif self.paramIsArray(param): + lengths = param.attrib.get('len').split(',') + + # Find all the parameters that are called out as optional, so we can document that they might be zero, and the array may be ignored + optionallengths = [] + for length in lengths: + if (length) != 'null-terminated' and (length) != '1': + for otherparam in params: + if otherparam.find('name').text == length: + if otherparam.attrib.get('optional') is not None: + if self.paramIsPointer(otherparam): + optionallengths.append('the value referenced by ' + self.makeParameterName(length)) + else: + optionallengths.append(self.makeParameterName(length)) + + # Document that these arrays may be ignored if any of the length values are 0 + if len(optionallengths) != 0 or param.attrib.get('optional') is not None: + asciidoc += 'If ' + + + if len(optionallengths) != 0: + if len(optionallengths) == 1: + + asciidoc += optionallengths[0] + asciidoc += ' is ' + + else: + asciidoc += ' or '.join(optionallengths) + asciidoc += ' are ' + + asciidoc += 'not `0`, ' + + if len(optionallengths) != 0 and param.attrib.get('optional') is not None: + asciidoc += 'and ' + + if param.attrib.get('optional') is not None: + asciidoc += self.makeParameterName(paramname.text) + asciidoc += ' is not `NULL`, ' + + elif param.attrib.get('optional') is not None: + # Don't generate this stub for bitflags + if self.getTypeCategory(paramtype.text) != 'bitmask': + if param.attrib.get('optional').split(',')[0] == 'true': + asciidoc += 'If ' + asciidoc += self.makeParameterName(paramname.text) + asciidoc += ' is not ' + if self.paramIsArray(param) or self.paramIsPointer(param) or self.isHandleTypeDispatchable(paramtype.text): + asciidoc += '`NULL`' + elif self.getTypeCategory(paramtype.text) == 'handle': + asciidoc += 'sname:VK_NULL_HANDLE' + else: + asciidoc += '`0`' + + asciidoc += ', ' + + return asciidoc + + # + # Make the generic asciidoc line chunk portion used for all parameters. + # May return an empty string if nothing to validate. + def createValidationLineForParameterIntroChunk(self, param, params, typetext): + asciidoc = '' + paramname = param.find('name') + paramtype = param.find('type') + + asciidoc += self.makeAsciiDocPreChunk(param, params) + + asciidoc += self.makeParameterName(paramname.text) + asciidoc += ' must: be ' + + if self.paramIsArray(param): + # Arrays. These are hard to get right, apparently + + lengths = param.attrib.get('len').split(',') + + if (lengths[0]) == 'null-terminated': + asciidoc += 'a null-terminated ' + elif (lengths[0]) == '1': + asciidoc += 'a pointer to ' + else: + asciidoc += 'a pointer to an array of ' + + # Handle equations, which are currently denoted with latex + if 'latexmath:' in lengths[0]: + asciidoc += lengths[0] + else: + asciidoc += self.makeParameterName(lengths[0]) + asciidoc += ' ' + + for length in lengths[1:]: + if (length) == 'null-terminated': # This should always be the last thing. If it ever isn't for some bizarre reason, then this will need some massaging. + asciidoc += 'null-terminated ' + elif (length) == '1': + asciidoc += 'pointers to ' + else: + asciidoc += 'pointers to arrays of ' + # Handle equations, which are currently denoted with latex + if 'latex:' in length: + asciidoc += length + else: + asciidoc += self.makeParameterName(length) + asciidoc += ' ' + + # Void pointers don't actually point at anything - remove the word "to" + if paramtype.text == 'void': + if lengths[-1] == '1': + if len(lengths) > 1: + asciidoc = asciidoc[:-5] # Take care of the extra s added by the post array chunk function. #HACK# + else: + asciidoc = asciidoc[:-4] + else: + # An array of void values is a byte array. + asciidoc += 'byte' + + elif paramtype.text == 'char': + # A null terminated array of chars is a string + if lengths[-1] == 'null-terminated': + asciidoc += 'string' + else: + # Else it's just a bunch of chars + asciidoc += 'char value' + elif param.text is not None: + # If a value is "const" that means it won't get modified, so it must be valid going into the function. + if 'const' in param.text: + typecategory = self.getTypeCategory(paramtype.text) + if (typecategory != 'struct' and typecategory != 'union' and typecategory != 'basetype' and typecategory is not None) or not self.isStructAlwaysValid(paramtype.text): + asciidoc += 'valid ' + + asciidoc += typetext + + # pluralize + if len(lengths) > 1 or (lengths[0] != '1' and lengths[0] != 'null-terminated'): + asciidoc += 's' + + elif self.paramIsPointer(param): + # Handle pointers - which are really special case arrays (i.e. they don't have a length) + pointercount = paramtype.tail.count('*') + + # Could be multi-level pointers (e.g. ppData - pointer to a pointer). Handle that. + for i in range(0, pointercount): + asciidoc += 'a pointer to ' + + if paramtype.text == 'void': + # If there's only one pointer, it's optional, and it doesn't point at anything in particular - we don't need any language. + if pointercount == 1 and param.attrib.get('optional') is not None: + return '' # early return + else: + # Pointer to nothing in particular - delete the " to " portion + asciidoc = asciidoc[:-4] + else: + # Add an article for English semantic win + asciidoc += 'a ' + + # If a value is "const" that means it won't get modified, so it must be valid going into the function. + if param.text is not None and paramtype.text != 'void': + if 'const' in param.text: + asciidoc += 'valid ' + + asciidoc += typetext + + else: + # Non-pointer, non-optional things must be valid + asciidoc += 'a valid ' + asciidoc += typetext + + if asciidoc != '': + asciidoc += '\n' + + # Add additional line for non-optional bitmasks + if self.getTypeCategory(paramtype.text) == 'bitmask': + if param.attrib.get('optional') is None: + asciidoc += '* ' + if self.paramIsArray(param): + asciidoc += 'Each element of ' + asciidoc += 'pname:' + asciidoc += paramname.text + asciidoc += ' mustnot: be `0`' + asciidoc += '\n' + + return asciidoc + + def makeAsciiDocLineForParameter(self, param, params, typetext): + if param.attrib.get('noautovalidity') is not None: + return '' + asciidoc = self.createValidationLineForParameterIntroChunk(param, params, typetext) + + return asciidoc + + # Try to do check if a structure is always considered valid (i.e. there's no rules to its acceptance) + def isStructAlwaysValid(self, structname): + + struct = self.registry.find("types/type[@name='" + structname + "']") + + params = struct.findall('member') + validity = struct.find('validity') + + if validity is not None: + return False + + for param in params: + paramname = param.find('name') + paramtype = param.find('type') + typecategory = self.getTypeCategory(paramtype.text) + + if paramname.text == 'pNext': + return False + + if paramname.text == 'sType': + return False + + if paramtype.text == 'void' or paramtype.text == 'char' or self.paramIsArray(param) or self.paramIsPointer(param): + if self.makeAsciiDocLineForParameter(param, params, '') != '': + return False + elif typecategory == 'handle' or typecategory == 'enum' or typecategory == 'bitmask' or param.attrib.get('returnedonly') == 'true': + return False + elif typecategory == 'struct' or typecategory == 'union': + if self.isStructAlwaysValid(paramtype.text) is False: + return False + + return True + + # + # Make an entire asciidoc line for a given parameter + def createValidationLineForParameter(self, param, params, typecategory): + asciidoc = '' + paramname = param.find('name') + paramtype = param.find('type') + + if paramtype.text == 'void' or paramtype.text == 'char': + # Chars and void are special cases - needs care inside the generator functions + # A null-terminated char array is a string, else it's chars. + # An array of void values is a byte array, a void pointer is just a pointer to nothing in particular + asciidoc += self.makeAsciiDocLineForParameter(param, params, '') + elif typecategory == 'bitmask': + bitsname = paramtype.text.replace('Flags', 'FlagBits') + if self.registry.find("enums[@name='" + bitsname + "']") is None: + asciidoc += '* ' + asciidoc += self.makeParameterName(paramname.text) + asciidoc += ' must: be `0`' + asciidoc += '\n' + else: + if self.paramIsArray(param): + asciidoc += self.makeAsciiDocLineForParameter(param, params, 'combinations of ' + self.makeEnumerationName(bitsname) + ' value') + else: + asciidoc += self.makeAsciiDocLineForParameter(param, params, 'combination of ' + self.makeEnumerationName(bitsname) + ' values') + elif typecategory == 'handle': + asciidoc += self.makeAsciiDocLineForParameter(param, params, self.makeStructName(paramtype.text) + ' handle') + elif typecategory == 'enum': + asciidoc += self.makeAsciiDocLineForParameter(param, params, self.makeEnumerationName(paramtype.text) + ' value') + elif typecategory == 'struct': + if (self.paramIsArray(param) or self.paramIsPointer(param)) or not self.isStructAlwaysValid(paramtype.text): + asciidoc += self.makeAsciiDocLineForParameter(param, params, self.makeStructName(paramtype.text) + ' structure') + elif typecategory == 'union': + if (self.paramIsArray(param) or self.paramIsPointer(param)) or not self.isStructAlwaysValid(paramtype.text): + asciidoc += self.makeAsciiDocLineForParameter(param, params, self.makeStructName(paramtype.text) + ' union') + elif self.paramIsArray(param) or self.paramIsPointer(param): + asciidoc += self.makeAsciiDocLineForParameter(param, params, self.makeBaseTypeName(paramtype.text) + ' value') + + return asciidoc + + # + # Make an asciidoc validity entry for a handle's parent object + def makeAsciiDocHandleParent(self, param, params): + asciidoc = '' + paramname = param.find('name') + paramtype = param.find('type') + + # Deal with handle parents + handleparent = self.getHandleParent(paramtype.text) + if handleparent is not None: + parentreference = None + for otherparam in params: + if otherparam.find('type').text == handleparent: + parentreference = otherparam.find('name').text + if parentreference is not None: + asciidoc += '* ' + + if self.isHandleOptional(param, params): + if self.paramIsArray(param): + asciidoc += 'Each element of ' + asciidoc += self.makeParameterName(paramname.text) + asciidoc += ' that is a valid handle' + else: + asciidoc += 'If ' + asciidoc += self.makeParameterName(paramname.text) + asciidoc += ' is a valid handle, it' + else: + if self.paramIsArray(param): + asciidoc += 'Each element of ' + asciidoc += self.makeParameterName(paramname.text) + asciidoc += ' must: have been created, allocated or retrieved from ' + asciidoc += self.makeParameterName(parentreference) + + asciidoc += '\n' + return asciidoc + + # + # Generate an asciidoc validity line for the sType value of a struct + def makeStructureType(self, blockname, param): + asciidoc = '* ' + paramname = param.find('name') + paramtype = param.find('type') + + asciidoc += self.makeParameterName(paramname.text) + asciidoc += ' must: be ' + + structuretype = '' + for elem in re.findall(r'(([A-Z][a-z]+)|([A-Z][A-Z]+))', blockname): + if elem[0] == 'Vk': + structuretype += 'VK_STRUCTURE_TYPE_' + else: + structuretype += elem[0].upper() + structuretype += '_' + + asciidoc += self.makeEnumerantName(structuretype[:-1]) + asciidoc += '\n' + + return asciidoc + + # + # Generate an asciidoc validity line for the pNext value of a struct + def makeStructureExtensionPointer(self, param): + asciidoc = '* ' + paramname = param.find('name') + paramtype = param.find('type') + + asciidoc += self.makeParameterName(paramname.text) + + validextensionstructs = param.attrib.get('validextensionstructs') + if validextensionstructs is None: + asciidoc += ' must: be `NULL`' + else: + extensionstructs = validextensionstructs.split(',') + asciidoc += ' must: point to one of ' + extensionstructs[:-1].join(', ') + ' or ' + extensionstructs[-1] + 'if the extension that introduced them is enabled ' + + asciidoc += '\n' + + return asciidoc + + # + # Generate all the valid usage information for a given struct or command + def makeValidUsageStatements(self, cmd, blockname, params, usages): + # Start the asciidoc block for this + asciidoc = '' + + handles = [] + anyparentedhandlesoptional = False + parentdictionary = {} + arraylengths = set() + for param in params: + paramname = param.find('name') + paramtype = param.find('type') + + # Get the type's category + typecategory = self.getTypeCategory(paramtype.text) + + # Generate language to independently validate a parameter + if paramtype.text == 'VkStructureType' and paramname.text == 'sType': + asciidoc += self.makeStructureType(blockname, param) + elif paramtype.text == 'void' and paramname.text == 'pNext': + asciidoc += self.makeStructureExtensionPointer(param) + else: + asciidoc += self.createValidationLineForParameter(param, params, typecategory) + + # Ensure that any parenting is properly validated, and list that a handle was found + if typecategory == 'handle': + # Don't detect a parent for return values! + if not self.paramIsPointer(param) or (param.text is not None and 'const' in param.text): + parent = self.getHandleParent(paramtype.text) + if parent is not None: + handles.append(param) + + # If any param is optional, it affects the output + if self.isHandleOptional(param, params): + anyparentedhandlesoptional = True + + # Find the first dispatchable parent + ancestor = parent + while ancestor is not None and not self.isHandleTypeDispatchable(ancestor): + ancestor = self.getHandleParent(ancestor) + + # If one was found, add this parameter to the parent dictionary + if ancestor is not None: + if ancestor not in parentdictionary: + parentdictionary[ancestor] = [] + + if self.paramIsArray(param): + parentdictionary[ancestor].append('the elements of ' + self.makeParameterName(paramname.text)) + else: + parentdictionary[ancestor].append(self.makeParameterName(paramname.text)) + + # Get the array length for this parameter + arraylength = param.attrib.get('len') + if arraylength is not None: + for onelength in arraylength.split(','): + arraylengths.add(onelength) + + # For any vkQueue* functions, there might be queue type data + if 'vkQueue' in blockname: + # The queue type must be valid + queuetypes = cmd.attrib.get('queues') + if queuetypes is not None: + queuebits = [] + for queuetype in re.findall(r'([^,]+)', queuetypes): + queuebits.append(queuetype.replace('_',' ')) + + asciidoc += '* ' + asciidoc += 'The pname:queue must: support ' + if len(queuebits) == 1: + asciidoc += queuebits[0] + else: + asciidoc += (', ').join(queuebits[:-1]) + asciidoc += ' or ' + asciidoc += queuebits[-1] + asciidoc += ' operations' + asciidoc += '\n' + + if 'vkCmd' in blockname: + # The commandBuffer parameter must be being recorded + asciidoc += '* ' + asciidoc += 'pname:commandBuffer must: be in the recording state' + asciidoc += '\n' + + # The queue type must be valid + queuetypes = cmd.attrib.get('queues') + queuebits = [] + for queuetype in re.findall(r'([^,]+)', queuetypes): + queuebits.append(queuetype.replace('_',' ')) + + asciidoc += '* ' + asciidoc += 'The sname:VkCommandPool that pname:commandBuffer was allocated from must: support ' + if len(queuebits) == 1: + asciidoc += queuebits[0] + else: + asciidoc += (', ').join(queuebits[:-1]) + asciidoc += ' or ' + asciidoc += queuebits[-1] + asciidoc += ' operations' + asciidoc += '\n' + + # Must be called inside/outside a renderpass appropriately + renderpass = cmd.attrib.get('renderpass') + + if renderpass != 'both': + asciidoc += '* This command must: only be called ' + asciidoc += renderpass + asciidoc += ' of a render pass instance' + asciidoc += '\n' + + # Must be in the right level command buffer + cmdbufferlevel = cmd.attrib.get('cmdbufferlevel') + + if cmdbufferlevel != 'primary,secondary': + asciidoc += '* pname:commandBuffer must: be a ' + asciidoc += cmdbufferlevel + asciidoc += ' sname:VkCommandBuffer' + asciidoc += '\n' + + # Any non-optional arraylengths should specify they must be greater than 0 + for param in params: + paramname = param.find('name') + + for arraylength in arraylengths: + if paramname.text == arraylength and param.attrib.get('optional') is None: + # Get all the array dependencies + arrays = cmd.findall("param/[@len='" + arraylength + "'][@optional='true']") + + # Get all the optional array dependencies, including those not generating validity for some reason + optionalarrays = cmd.findall("param/[@len='" + arraylength + "'][@optional='true']") + optionalarrays.extend(cmd.findall("param/[@len='" + arraylength + "'][@noautovalidity='true']")) + + asciidoc += '* ' + + # Allow lengths to be arbitrary if all their dependents are optional + if len(optionalarrays) == len(arrays) and len(optionalarrays) != 0: + asciidoc += 'If ' + if len(optionalarrays) > 1: + asciidoc += 'any of ' + + for array in optionalarrays[:-1]: + asciidoc += self.makeParameterName(optionalarrays.find('name').text) + asciidoc += ', ' + + if len(optionalarrays) > 1: + asciidoc += 'and ' + asciidoc += self.makeParameterName(optionalarrays[-1].find('name').text) + asciidoc += ' are ' + else: + asciidoc += self.makeParameterName(optionalarrays[-1].find('name').text) + asciidoc += ' is ' + + asciidoc += 'not `NULL`, ' + + if self.paramIsPointer(param): + asciidoc += 'the value referenced by ' + else: + asciidoc += 'the value of ' + + elif self.paramIsPointer(param): + asciidoc += 'The value referenced by ' + else: + asciidoc += 'The value of ' + + asciidoc += self.makeParameterName(arraylength) + asciidoc += ' must: be greater than `0`' + asciidoc += '\n' + + # Find the parents of all objects referenced in this command + for param in handles: + asciidoc += self.makeAsciiDocHandleParent(param, params) + + # Find the common ancestors of objects + noancestorscount = 0 + while noancestorscount < len(parentdictionary): + noancestorscount = 0 + oldparentdictionary = parentdictionary.copy() + for parent in oldparentdictionary.items(): + ancestor = self.getHandleParent(parent[0]) + + while ancestor is not None and ancestor not in parentdictionary: + ancestor = self.getHandleParent(ancestor) + + if ancestor is not None: + parentdictionary[ancestor] += parentdictionary.pop(parent[0]) + else: + # No ancestors possible - so count it up + noancestorscount += 1 + + # Add validation language about common ancestors + for parent in parentdictionary.items(): + if len(parent[1]) > 1: + parentlanguage = '* ' + + parentlanguage += 'Each of ' + parentlanguage += ", ".join(parent[1][:-1]) + parentlanguage += ' and ' + parentlanguage += parent[1][-1] + if anyparentedhandlesoptional is True: + parentlanguage += ' that are valid handles' + parentlanguage += ' must: have been created, allocated or retrieved from the same ' + parentlanguage += self.makeStructName(parent[0]) + parentlanguage += '\n' + + # Capitalize and add to the main language + asciidoc += parentlanguage + + # Add in any plain-text validation language that's in the xml + for usage in usages: + asciidoc += '* ' + asciidoc += usage.text + asciidoc += '\n' + + # In case there's nothing to report, return None + if asciidoc == '': + return None + # Delimit the asciidoc block + return asciidoc + + def makeThreadSafetyBlock(self, cmd, paramtext): + """Generate C function pointer typedef for Element""" + paramdecl = '' + + # For any vkCmd* functions, the commandBuffer parameter must be being recorded + if cmd.find('proto/name') is not None and 'vkCmd' in cmd.find('proto/name'): + paramdecl += '* ' + paramdecl += 'The sname:VkCommandPool that pname:commandBuffer was created from' + paramdecl += '\n' + + # Find and add any parameters that are thread unsafe + explicitexternsyncparams = cmd.findall(paramtext + "[@externsync]") + if (explicitexternsyncparams is not None): + for param in explicitexternsyncparams: + externsyncattribs = param.attrib.get('externsync') + paramname = param.find('name') + for externsyncattrib in externsyncattribs.split(','): + paramdecl += '* ' + paramdecl += 'Host access to ' + if externsyncattrib == 'true': + if self.paramIsArray(param): + paramdecl += 'each member of ' + self.makeParameterName(paramname.text) + elif self.paramIsPointer(param): + paramdecl += 'the object referenced by ' + self.makeParameterName(paramname.text) + else: + paramdecl += self.makeParameterName(paramname.text) + else: + paramdecl += 'pname:' + paramdecl += externsyncattrib + paramdecl += ' must: be externally synchronized\n' + + # Find and add any "implicit" parameters that are thread unsafe + implicitexternsyncparams = cmd.find('implicitexternsyncparams') + if (implicitexternsyncparams is not None): + for elem in implicitexternsyncparams: + paramdecl += '* ' + paramdecl += 'Host access to ' + paramdecl += elem.text + paramdecl += ' must: be externally synchronized\n' + + if (paramdecl == ''): + return None + else: + return paramdecl + + def makeCommandPropertiesTableEntry(self, cmd, name): + + if 'vkCmd' in name: + # Must be called inside/outside a renderpass appropriately + cmdbufferlevel = cmd.attrib.get('cmdbufferlevel') + cmdbufferlevel = (' + \n').join(cmdbufferlevel.title().split(',')) + + renderpass = cmd.attrib.get('renderpass') + renderpass = renderpass.capitalize() + + queues = cmd.attrib.get('queues') + queues = (' + \n').join(queues.upper().split(',')) + + return '|' + cmdbufferlevel + '|' + renderpass + '|' + queues + elif 'vkQueue' in name: + # Must be called inside/outside a renderpass appropriately + + queues = cmd.attrib.get('queues') + if queues is None: + queues = 'Any' + else: + queues = (' + \n').join(queues.upper().split(',')) + + return '|-|-|' + queues + + return None + + def makeSuccessCodes(self, cmd, name): + + successcodes = cmd.attrib.get('successcodes') + if successcodes is not None: + + successcodeentry = '' + successcodes = successcodes.split(',') + return '* ' + '\n* '.join(successcodes) + + return None + + def makeErrorCodes(self, cmd, name): + + errorcodes = cmd.attrib.get('errorcodes') + if errorcodes is not None: + + errorcodeentry = '' + errorcodes = errorcodes.split(',') + return '* ' + '\n* '.join(errorcodes) + + return None + + # + # Command generation + def genCmd(self, cmdinfo, name): + OutputGenerator.genCmd(self, cmdinfo, name) + # + # Get all thh parameters + params = cmdinfo.elem.findall('param') + usages = cmdinfo.elem.findall('validity/usage') + + validity = self.makeValidUsageStatements(cmdinfo.elem, name, params, usages) + threadsafety = self.makeThreadSafetyBlock(cmdinfo.elem, 'param') + commandpropertiesentry = self.makeCommandPropertiesTableEntry(cmdinfo.elem, name) + successcodes = self.makeSuccessCodes(cmdinfo.elem, name) + errorcodes = self.makeErrorCodes(cmdinfo.elem, name) + + self.writeInclude('validity/protos', name, validity, threadsafety, commandpropertiesentry, successcodes, errorcodes) + + # + # Struct Generation + def genStruct(self, typeinfo, typename): + OutputGenerator.genStruct(self, typeinfo, typename) + + # Anything that's only ever returned can't be set by the user, so shouldn't have any validity information. + if typeinfo.elem.attrib.get('returnedonly') is None: + params = typeinfo.elem.findall('member') + usages = typeinfo.elem.findall('validity/usage') + + validity = self.makeValidUsageStatements(typeinfo.elem, typename, params, usages) + threadsafety = self.makeThreadSafetyBlock(typeinfo.elem, 'member') + + self.writeInclude('validity/structs', typename, validity, threadsafety, None, None, None) + else: + # Still generate files for return only structs, in case this state changes later + self.writeInclude('validity/structs', typename, None, None, None, None, None) + + # + # Type Generation + def genType(self, typeinfo, typename): + OutputGenerator.genType(self, typeinfo, typename) + + category = typeinfo.elem.get('category') + if (category == 'struct' or category == 'union'): + self.genStruct(typeinfo, typename) + +# HostSynchronizationOutputGenerator - subclass of OutputGenerator. +# Generates AsciiDoc includes of the externsync parameter table for the +# fundamentals chapter of the Vulkan specification. Similar to +# DocOutputGenerator. +# +# ---- methods ---- +# HostSynchronizationOutputGenerator(errFile, warnFile, diagFile) - args as for +# OutputGenerator. Defines additional internal state. +# ---- methods overriding base class ---- +# genCmd(cmdinfo) +class HostSynchronizationOutputGenerator(OutputGenerator): + # Generate Host Synchronized Parameters in a table at the top of the spec + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + OutputGenerator.__init__(self, errFile, warnFile, diagFile) + + threadsafety = {'parameters': '', 'parameterlists': '', 'implicit': ''} + + def makeParameterName(self, name): + return 'pname:' + name + + def makeFLink(self, name): + return 'flink:' + name + + # + # Generate an include file + # + # directory - subdirectory to put file in + # basename - base name of the file + # contents - contents of the file (Asciidoc boilerplate aside) + def writeInclude(self): + + if self.threadsafety['parameters'] is not None: + # Create file + filename = self.genOpts.genDirectory + '/' + self.genOpts.filename + '/parameters.txt' + self.logMsg('diag', '# Generating include file:', filename) + fp = open(filename, 'w') + + # Host Synchronization + write('.Externally Synchronized Parameters', file=fp) + write('*' * 80, file=fp) + write(self.threadsafety['parameters'], file=fp, end='') + write('*' * 80, file=fp) + write('', file=fp) + + if self.threadsafety['parameterlists'] is not None: + # Create file + filename = self.genOpts.genDirectory + '/' + self.genOpts.filename + '/parameterlists.txt' + self.logMsg('diag', '# Generating include file:', filename) + fp = open(filename, 'w') + + # Host Synchronization + write('.Externally Synchronized Parameter Lists', file=fp) + write('*' * 80, file=fp) + write(self.threadsafety['parameterlists'], file=fp, end='') + write('*' * 80, file=fp) + write('', file=fp) + + if self.threadsafety['implicit'] is not None: + # Create file + filename = self.genOpts.genDirectory + '/' + self.genOpts.filename + '/implicit.txt' + self.logMsg('diag', '# Generating include file:', filename) + fp = open(filename, 'w') + + # Host Synchronization + write('.Implicit Externally Synchronized Parameters', file=fp) + write('*' * 80, file=fp) + write(self.threadsafety['implicit'], file=fp, end='') + write('*' * 80, file=fp) + write('', file=fp) + + fp.close() + + # + # Check if the parameter passed in is a pointer to an array + def paramIsArray(self, param): + return param.attrib.get('len') is not None + + # Check if the parameter passed in is a pointer + def paramIsPointer(self, param): + ispointer = False + paramtype = param.find('type') + if paramtype.tail is not None and '*' in paramtype.tail: + ispointer = True + + return ispointer + + # Turn the "name[].member[]" notation into plain English. + def makeThreadDereferenceHumanReadable(self, dereference): + matches = re.findall(r"[\w]+[^\w]*",dereference) + stringval = '' + for match in reversed(matches): + if '->' in match or '.' in match: + stringval += 'member of ' + if '[]' in match: + stringval += 'each element of ' + + stringval += 'the ' + stringval += self.makeParameterName(re.findall(r"[\w]+",match)[0]) + stringval += ' ' + + stringval += 'parameter' + + return stringval[0].upper() + stringval[1:] + + def makeThreadSafetyBlocks(self, cmd, paramtext): + protoname = cmd.find('proto/name').text + + # Find and add any parameters that are thread unsafe + explicitexternsyncparams = cmd.findall(paramtext + "[@externsync]") + if (explicitexternsyncparams is not None): + for param in explicitexternsyncparams: + externsyncattribs = param.attrib.get('externsync') + paramname = param.find('name') + for externsyncattrib in externsyncattribs.split(','): + + tempstring = '* ' + if externsyncattrib == 'true': + if self.paramIsArray(param): + tempstring += 'Each element of the ' + elif self.paramIsPointer(param): + tempstring += 'The object referenced by the ' + else: + tempstring += 'The ' + + tempstring += self.makeParameterName(paramname.text) + tempstring += ' parameter' + + else: + tempstring += self.makeThreadDereferenceHumanReadable(externsyncattrib) + + tempstring += ' in ' + tempstring += self.makeFLink(protoname) + tempstring += '\n' + + + if ' element of ' in tempstring: + self.threadsafety['parameterlists'] += tempstring + else: + self.threadsafety['parameters'] += tempstring + + + # Find and add any "implicit" parameters that are thread unsafe + implicitexternsyncparams = cmd.find('implicitexternsyncparams') + if (implicitexternsyncparams is not None): + for elem in implicitexternsyncparams: + self.threadsafety['implicit'] += '* ' + self.threadsafety['implicit'] += elem.text[0].upper() + self.threadsafety['implicit'] += elem.text[1:] + self.threadsafety['implicit'] += ' in ' + self.threadsafety['implicit'] += self.makeFLink(protoname) + self.threadsafety['implicit'] += '\n' + + + # For any vkCmd* functions, the commandBuffer parameter must be being recorded + if protoname is not None and 'vkCmd' in protoname: + self.threadsafety['implicit'] += '* ' + self.threadsafety['implicit'] += 'The sname:VkCommandPool that pname:commandBuffer was allocated from, in ' + self.threadsafety['implicit'] += self.makeFLink(protoname) + + self.threadsafety['implicit'] += '\n' + + # + # Command generation + def genCmd(self, cmdinfo, name): + OutputGenerator.genCmd(self, cmdinfo, name) + # + # Get all thh parameters + params = cmdinfo.elem.findall('param') + usages = cmdinfo.elem.findall('validity/usage') + + self.makeThreadSafetyBlocks(cmdinfo.elem, 'param') + + self.writeInclude() diff --git a/genvk.py b/genvk.py new file mode 100755 index 00000000..5421d417 --- /dev/null +++ b/genvk.py @@ -0,0 +1,293 @@ +#!/usr/bin/env python +# +# Copyright (c) 2013-2015 The Khronos Group Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and/or associated documentation files (the +# "Materials"), to deal in the Materials without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Materials, and to +# permit persons to whom the Materials are furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Materials. +# +# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +import sys, time, pdb, string, cProfile +from reg import * +from generator import write, CGeneratorOptions, COutputGenerator, DocGeneratorOptions, DocOutputGenerator, PyOutputGenerator, ValidityOutputGenerator, HostSynchronizationOutputGenerator + +# debug - start header generation in debugger +# dump - dump registry after loading +# profile - enable Python profiling +# protect - whether to use #ifndef protections +# registry - use specified XML registry instead of gl.xml +# target - string name of target header, or all targets if None +# timeit - time length of registry loading & header generation +# validate - validate return & parameter group tags against +debug = False +dump = False +profile = False +protect = True +target = None +timeit = False +validate= False +# Default input / log files +errFilename = None +diagFilename = 'diag.txt' +regFilename = 'vk.xml' + +if __name__ == '__main__': + i = 1 + while (i < len(sys.argv)): + arg = sys.argv[i] + i = i + 1 + if (arg == '-debug'): + write('Enabling debug (-debug)', file=sys.stderr) + debug = True + elif (arg == '-dump'): + write('Enabling dump (-dump)', file=sys.stderr) + dump = True + elif (arg == '-noprotect'): + write('Disabling inclusion protection in output headers', file=sys.stderr) + protect = False + elif (arg == '-profile'): + write('Enabling profiling (-profile)', file=sys.stderr) + profile = True + elif (arg == '-registry'): + regFilename = sys.argv[i] + i = i+1 + write('Using registry ', regFilename, file=sys.stderr) + elif (arg == '-time'): + write('Enabling timing (-time)', file=sys.stderr) + timeit = True + elif (arg == '-validate'): + write('Enabling group validation (-validate)', file=sys.stderr) + validate = True + elif (arg[0:1] == '-'): + write('Unrecognized argument:', arg, file=sys.stderr) + exit(1) + else: + target = arg + write('Using target', target, file=sys.stderr) + +# Simple timer functions +startTime = None +def startTimer(): + global startTime + startTime = time.clock() +def endTimer(msg): + global startTime + endTime = time.clock() + if (timeit): + write(msg, endTime - startTime) + startTime = None + +# Load & parse registry +reg = Registry() + +startTimer() +tree = etree.parse(regFilename) +endTimer('Time to make ElementTree =') + +startTimer() +reg.loadElementTree(tree) +endTimer('Time to parse ElementTree =') + +if (validate): + reg.validateGroups() + +if (dump): + write('***************************************') + write('Performing Registry dump to regdump.txt') + write('***************************************') + reg.dumpReg(filehandle = open('regdump.txt','w')) + +# Turn a list of strings into a regexp string matching exactly those strings +def makeREstring(list): + return '^(' + '|'.join(list) + ')$' + +# Descriptive names for various regexp patterns used to select +# versions and extensions +allVersions = allExtensions = '.*' +noVersions = noExtensions = None + +# Copyright text prefixing all headers (list of strings). +prefixStrings = [ + '/*', + '** Copyright (c) 2015 The Khronos Group Inc.', + '**', + '** Permission is hereby granted, free of charge, to any person obtaining a', + '** copy of this software and/or associated documentation files (the', + '** "Materials"), to deal in the Materials without restriction, including', + '** without limitation the rights to use, copy, modify, merge, publish,', + '** distribute, sublicense, and/or sell copies of the Materials, and to', + '** permit persons to whom the Materials are furnished to do so, subject to', + '** the following conditions:', + '**', + '** The above copyright notice and this permission notice shall be included', + '** in all copies or substantial portions of the Materials.', + '**', + '** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,', + '** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF', + '** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.', + '** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY', + '** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,', + '** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE', + '** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.', + '*/', + '' +] + +# Text specific to Vulkan headers +vkPrefixStrings = [ + '/*', + '** This header is generated from the Khronos Vulkan XML API Registry.', + '**', + '*/', + '' +] + +# Defaults for generating re-inclusion protection wrappers (or not) +protectFile = protect +protectFeature = protect +protectProto = protect + +buildList = [ + # Vulkan 1.0 - core API + extensions. To generate just the core API, + # change to 'defaultExtensions = None' below. + [ COutputGenerator, + CGeneratorOptions( + filename = '../vulkan/vulkan.h', + apiname = 'vulkan', + profile = None, + versions = allVersions, + emitversions = allVersions, + defaultExtensions = 'vulkan', + addExtensions = None, + removeExtensions = None, + prefixText = prefixStrings + vkPrefixStrings, + genFuncPointers = True, + protectFile = protectFile, + protectFeature = False, + protectProto = '#ifndef', + protectProtoStr = 'VK_NO_PROTOTYPES', + apicall = 'VKAPI_ATTR ', + apientry = 'VKAPI_CALL ', + apientryp = 'VKAPI_PTR *', + alignFuncParam = 48) + ], + # Vulkan 1.0 draft - core API include files for spec + # Overwrites include subdirectories in spec source tree + # The generated include files do not include the calling convention + # macros (apientry etc.), unlike the header files. + [ DocOutputGenerator, + DocGeneratorOptions( + filename = 'vulkan-docs', + apiname = 'vulkan', + profile = None, + versions = allVersions, + emitversions = allVersions, + defaultExtensions = 'vulkan', + addExtensions = None, + removeExtensions = None, + prefixText = prefixStrings + vkPrefixStrings, + apicall = '', + apientry = '', + apientryp = '*', + genDirectory = '../../doc/specs/vulkan', + alignFuncParam = 48, + expandEnumerants = False) + ], + # Vulkan 1.0 draft - API names to validate man/api spec includes & links + # filename = 'vkapi.py', + [ PyOutputGenerator, + DocGeneratorOptions( + filename = '../../doc/specs/vulkan/vkapi.py', + apiname = 'vulkan', + profile = None, + versions = allVersions, + emitversions = allVersions, + defaultExtensions = None, + addExtensions = None, + removeExtensions = None) + ], + # Vulkan 1.0 draft - core API include files for spec + # Overwrites include subdirectories in spec source tree + [ ValidityOutputGenerator, + DocGeneratorOptions( + filename = 'validity', + apiname = 'vulkan', + profile = None, + versions = allVersions, + emitversions = allVersions, + defaultExtensions = None, + addExtensions = None, + removeExtensions = None, + genDirectory = '../../doc/specs/vulkan') + ], + # Vulkan 1.0 draft - core API include files for spec + # Overwrites include subdirectories in spec source tree + [ HostSynchronizationOutputGenerator, + DocGeneratorOptions( + filename = 'hostsynctable', + apiname = 'vulkan', + profile = None, + versions = allVersions, + emitversions = allVersions, + defaultExtensions = None, + addExtensions = None, + removeExtensions = None, + genDirectory = '../../doc/specs/vulkan') + ], + None +] + +# create error/warning & diagnostic files +if (errFilename): + errWarn = open(errFilename,'w') +else: + errWarn = sys.stderr +diag = open(diagFilename, 'w') + +def genHeaders(): + # Loop over targets, building each + generated = 0 + for item in buildList: + if (item == None): + break + createGenerator = item[0] + genOpts = item[1] + if (target and target != genOpts.filename): + # write('*** Skipping', genOpts.filename) + continue + write('*** Building', genOpts.filename) + generated = generated + 1 + startTimer() + gen = createGenerator(errFile=errWarn, + warnFile=errWarn, + diagFile=diag) + reg.setGenerator(gen) + reg.apiGen(genOpts) + write('** Generated', genOpts.filename) + endTimer('Time to generate ' + genOpts.filename + ' =') + if (target and generated == 0): + write('Failed to generate target:', target) + +if (debug): + pdb.run('genHeaders()') +elif (profile): + import cProfile, pstats + cProfile.run('genHeaders()', 'profile.txt') + p = pstats.Stats('profile.txt') + p.strip_dirs().sort_stats('time').print_stats(50) +else: + genHeaders() diff --git a/reg.py b/reg.py new file mode 100755 index 00000000..8be9adf0 --- /dev/null +++ b/reg.py @@ -0,0 +1,762 @@ +#!/usr/bin/python3 -i +# +# Copyright (c) 2013-2015 The Khronos Group Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and/or associated documentation files (the +# "Materials"), to deal in the Materials without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Materials, and to +# permit persons to whom the Materials are furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Materials. +# +# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +import io,os,re,string,sys +from lxml import etree + +# matchAPIProfile - returns whether an API and profile +# being generated matches an element's profile +# api - string naming the API to match +# profile - string naming the profile to match +# elem - Element which (may) have 'api' and 'profile' +# attributes to match to. +# If a tag is not present in the Element, the corresponding API +# or profile always matches. +# Otherwise, the tag must exactly match the API or profile. +# Thus, if 'profile' = core: +# with no attribute will match +# will match +# will not match +# Possible match conditions: +# Requested Element +# Profile Profile +# --------- -------- +# None None Always matches +# 'string' None Always matches +# None 'string' Does not match. Can't generate multiple APIs +# or profiles, so if an API/profile constraint +# is present, it must be asked for explicitly. +# 'string' 'string' Strings must match +# +# ** In the future, we will allow regexes for the attributes, +# not just strings, so that api="^(gl|gles2)" will match. Even +# this isn't really quite enough, we might prefer something +# like "gl(core)|gles1(common-lite)". +def matchAPIProfile(api, profile, elem): + """Match a requested API & profile name to a api & profile attributes of an Element""" + match = True + # Match 'api', if present + if ('api' in elem.attrib): + if (api == None): + raise UserWarning("No API requested, but 'api' attribute is present with value '" + + elem.get('api') + "'") + elif (api != elem.get('api')): + # Requested API doesn't match attribute + return False + if ('profile' in elem.attrib): + if (profile == None): + raise UserWarning("No profile requested, but 'profile' attribute is present with value '" + + elem.get('profile') + "'") + elif (profile != elem.get('profile')): + # Requested profile doesn't match attribute + return False + return True + +# BaseInfo - base class for information about a registry feature +# (type/group/enum/command/API/extension). +# required - should this feature be defined during header generation +# (has it been removed by a profile or version)? +# declared - has this feature been defined already? +# elem - lxml.etree Element for this feature +# resetState() - reset required/declared to initial values. Used +# prior to generating a new API interface. +class BaseInfo: + """Represents the state of a registry feature, used during API generation""" + def __init__(self, elem): + self.required = False + self.declared = False + self.elem = elem + def resetState(self): + self.required = False + self.declared = False + +# TypeInfo - registry information about a type. No additional state +# beyond BaseInfo is required. +class TypeInfo(BaseInfo): + """Represents the state of a registry type""" + def __init__(self, elem): + BaseInfo.__init__(self, elem) + +# GroupInfo - registry information about a group of related enums +# in an block, generally corresponding to a C "enum" type. +class GroupInfo(BaseInfo): + """Represents the state of a registry group""" + def __init__(self, elem): + BaseInfo.__init__(self, elem) + +# EnumInfo - registry information about an enum +# type - numeric type of the value of the tag +# ( '' for GLint, 'u' for GLuint, 'ull' for GLuint64 ) +class EnumInfo(BaseInfo): + """Represents the state of a registry enum""" + def __init__(self, elem): + BaseInfo.__init__(self, elem) + self.type = elem.get('type') + if (self.type == None): + self.type = '' + +# CmdInfo - registry information about a command +class CmdInfo(BaseInfo): + """Represents the state of a registry command""" + def __init__(self, elem): + BaseInfo.__init__(self, elem) + +# FeatureInfo - registry information about an API +# or +# name - feature name string (e.g. 'vk_ext_khr_surface') +# version - feature version number (e.g. 1.2). +# features are unversioned and assigned version number 0. +# ** This is confusingly taken from the 'number' attribute of . +# Needs fixing. +# number - extension number, used for ordering and for +# assigning enumerant offsets. features do +# not have extension numbers and are assigned number 0. +# category - category, e.g. VERSION or khr/vendor tag +# emit - has this feature been defined already? +class FeatureInfo(BaseInfo): + """Represents the state of an API feature (version/extension)""" + def __init__(self, elem): + BaseInfo.__init__(self, elem) + self.name = elem.get('name') + # Determine element category (vendor). Only works + # for elements. + if (elem.tag == 'feature'): + self.category = 'VERSION' + self.version = elem.get('number') + self.number = "0" + else: + self.category = self.name.split('_', 2)[1] + self.version = "0" + self.number = elem.get('number') + self.emit = False + +from generator import write, GeneratorOptions, OutputGenerator + +# Registry - object representing an API registry, loaded from an XML file +# Members +# tree - ElementTree containing the root +# typedict - dictionary of TypeInfo objects keyed by type name +# groupdict - dictionary of GroupInfo objects keyed by group name +# enumdict - dictionary of EnumInfo objects keyed by enum name +# cmddict - dictionary of CmdInfo objects keyed by command name +# apidict - dictionary of Elements keyed by API name +# extensions - list of Elements +# extdict - dictionary of Elements keyed by extension name +# gen - OutputGenerator object used to write headers / messages +# genOpts - GeneratorOptions object used to control which +# fetures to write and how to format them +# emitFeatures - True to actually emit features for a version / extension, +# or False to just treat them as emitted +# Public methods +# loadElementTree(etree) - load registry from specified ElementTree +# loadFile(filename) - load registry from XML file +# setGenerator(gen) - OutputGenerator to use +# parseTree() - parse the registry once loaded & create dictionaries +# dumpReg(maxlen, filehandle) - diagnostic to dump the dictionaries +# to specified file handle (default stdout). Truncates type / +# enum / command elements to maxlen characters (default 80) +# generator(g) - specify the output generator object +# apiGen(apiname, genOpts) - generate API headers for the API type +# and profile specified in genOpts, but only for the versions and +# extensions specified there. +# apiReset() - call between calls to apiGen() to reset internal state +# Private methods +# addElementInfo(elem,info,infoName,dictionary) - add feature info to dict +# lookupElementInfo(fname,dictionary) - lookup feature info in dict +class Registry: + """Represents an API registry loaded from XML""" + def __init__(self): + self.tree = None + self.typedict = {} + self.groupdict = {} + self.enumdict = {} + self.cmddict = {} + self.apidict = {} + self.extensions = [] + self.extdict = {} + # A default output generator, so commands prior to apiGen can report + # errors via the generator object. + self.gen = OutputGenerator() + self.genOpts = None + self.emitFeatures = False + def loadElementTree(self, tree): + """Load ElementTree into a Registry object and parse it""" + self.tree = tree + self.parseTree() + def loadFile(self, file): + """Load an API registry XML file into a Registry object and parse it""" + self.tree = etree.parse(file) + self.parseTree() + def setGenerator(self, gen): + """Specify output generator object. None restores the default generator""" + self.gen = gen + self.gen.setRegistry(self.tree) + + # addElementInfo - add information about an element to the + # corresponding dictionary + # elem - ///// Element + # info - corresponding {Type|Group|Enum|Cmd|Feature}Info object + # infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' / 'extension' + # dictionary - self.{type|group|enum|cmd|api|ext}dict + # If the Element has an 'api' attribute, the dictionary key is the + # tuple (name,api). If not, the key is the name. 'name' is an + # attribute of the Element + def addElementInfo(self, elem, info, infoName, dictionary): + if ('api' in elem.attrib): + key = (elem.get('name'),elem.get('api')) + else: + key = elem.get('name') + if key in dictionary: + self.gen.logMsg('warn', '*** Attempt to redefine', + infoName, 'with key:', key) + else: + dictionary[key] = info + # + # lookupElementInfo - find a {Type|Enum|Cmd}Info object by name. + # If an object qualified by API name exists, use that. + # fname - name of type / enum / command + # dictionary - self.{type|enum|cmd}dict + def lookupElementInfo(self, fname, dictionary): + key = (fname, self.genOpts.apiname) + if (key in dictionary): + # self.gen.logMsg('diag', 'Found API-specific element for feature', fname) + return dictionary[key] + elif (fname in dictionary): + # self.gen.logMsg('diag', 'Found generic element for feature', fname) + return dictionary[fname] + else: + return None + def parseTree(self): + """Parse the registry Element, once created""" + # This must be the Element for the root + self.reg = self.tree.getroot() + # + # Create dictionary of registry types from toplevel tags + # and add 'name' attribute to each tag (where missing) + # based on its element. + # + # There's usually one block; more are OK + # Required attributes: 'name' or nested tag contents + self.typedict = {} + for type in self.reg.findall('types/type'): + # If the doesn't already have a 'name' attribute, set + # it from contents of its tag. + if (type.get('name') == None): + type.attrib['name'] = type.find('name').text + self.addElementInfo(type, TypeInfo(type), 'type', self.typedict) + # + # Create dictionary of registry enum groups from tags. + # + # Required attributes: 'name'. If no name is given, one is + # generated, but that group can't be identified and turned into an + # enum type definition - it's just a container for tags. + self.groupdict = {} + for group in self.reg.findall('enums'): + self.addElementInfo(group, GroupInfo(group), 'group', self.groupdict) + # + # Create dictionary of registry enums from tags + # + # tags usually define different namespaces for the values + # defined in those tags, but the actual names all share the + # same dictionary. + # Required attributes: 'name', 'value' + # For containing which have type="enum" or type="bitmask", + # tag all contained s are required. This is a stopgap until + # a better scheme for tagging core and extension enums is created. + self.enumdict = {} + for enums in self.reg.findall('enums'): + required = (enums.get('type') != None) + for enum in enums.findall('enum'): + enumInfo = EnumInfo(enum) + enumInfo.required = required + self.addElementInfo(enum, enumInfo, 'enum', self.enumdict) + # + # Create dictionary of registry commands from tags + # and add 'name' attribute to each tag (where missing) + # based on its element. + # + # There's usually only one block; more are OK. + # Required attributes: 'name' or tag contents + self.cmddict = {} + for cmd in self.reg.findall('commands/command'): + # If the doesn't already have a 'name' attribute, set + # it from contents of its tag. + if (cmd.get('name') == None): + cmd.attrib['name'] = cmd.find('proto/name').text + ci = CmdInfo(cmd) + self.addElementInfo(cmd, ci, 'command', self.cmddict) + # + # Create dictionaries of API and extension interfaces + # from toplevel and tags. + # + self.apidict = {} + for feature in self.reg.findall('feature'): + featureInfo = FeatureInfo(feature) + self.addElementInfo(feature, featureInfo, 'feature', self.apidict) + self.extensions = self.reg.findall('extensions/extension') + self.extdict = {} + for feature in self.extensions: + featureInfo = FeatureInfo(feature) + self.addElementInfo(feature, featureInfo, 'extension', self.extdict) + + # Add additional enums defined only in tags + # to the corresponding core type. + # When seen here, a copy, processed to contain the numeric enum + # value, is added to the corresponding element, as well + # as adding to the enum dictionary. Also add a 'extnumber' + # attribute containing the extension number. + # + # For tags which are actually just constants, if there's + # no 'extends' tag but there is a 'value' or 'bitpos' tag, just + # add an EnumInfo record to the dictionary. That works because + # output generation of constants is purely dependency-based, and + # doesn't need to iterate through the XML tags. + # + # Something like this will need to be done for 'feature's up + # above, if we use the same mechanism for adding to the core + # API in 1.1. + for enum in feature.findall('require/enum'): + addEnumInfo = False + groupName = enum.get('extends') + if (groupName != None): + # self.gen.logMsg('diag', '*** Found extension enum', + # enum.get('name')) + # Add extension number attribute to the element + enum.attrib['extnumber'] = featureInfo.number + # Look up the GroupInfo with matching groupName + if (groupName in self.groupdict.keys()): + # self.gen.logMsg('diag', '*** Matching group', + # groupName, 'found, adding element...') + gi = self.groupdict[groupName] + gi.elem.append(enum) + else: + self.gen.logMsg('warn', '*** NO matching group', + groupName, 'for enum', enum.get('name'), 'found.') + addEnumInfo = True + elif (enum.get('value') or enum.get('bitpos')): + # self.gen.logMsg('diag', '*** Adding extension constant "enum"', + # enum.get('name')) + addEnumInfo = True + if (addEnumInfo): + enumInfo = EnumInfo(enum) + self.addElementInfo(enum, enumInfo, 'enum', self.enumdict) + def dumpReg(self, maxlen = 40, filehandle = sys.stdout): + """Dump all the dictionaries constructed from the Registry object""" + write('***************************************', file=filehandle) + write(' ** Dumping Registry contents **', file=filehandle) + write('***************************************', file=filehandle) + write('// Types', file=filehandle) + for name in self.typedict: + tobj = self.typedict[name] + write(' Type', name, '->', etree.tostring(tobj.elem)[0:maxlen], file=filehandle) + write('// Groups', file=filehandle) + for name in self.groupdict: + gobj = self.groupdict[name] + write(' Group', name, '->', etree.tostring(gobj.elem)[0:maxlen], file=filehandle) + write('// Enums', file=filehandle) + for name in self.enumdict: + eobj = self.enumdict[name] + write(' Enum', name, '->', etree.tostring(eobj.elem)[0:maxlen], file=filehandle) + write('// Commands', file=filehandle) + for name in self.cmddict: + cobj = self.cmddict[name] + write(' Command', name, '->', etree.tostring(cobj.elem)[0:maxlen], file=filehandle) + write('// APIs', file=filehandle) + for key in self.apidict: + write(' API Version ', key, '->', + etree.tostring(self.apidict[key].elem)[0:maxlen], file=filehandle) + write('// Extensions', file=filehandle) + for key in self.extdict: + write(' Extension', key, '->', + etree.tostring(self.extdict[key].elem)[0:maxlen], file=filehandle) + # write('***************************************', file=filehandle) + # write(' ** Dumping XML ElementTree **', file=filehandle) + # write('***************************************', file=filehandle) + # write(etree.tostring(self.tree.getroot(),pretty_print=True), file=filehandle) + # + # typename - name of type + # required - boolean (to tag features as required or not) + def markTypeRequired(self, typename, required): + """Require (along with its dependencies) or remove (but not its dependencies) a type""" + self.gen.logMsg('diag', '*** tagging type:', typename, '-> required =', required) + # Get TypeInfo object for tag corresponding to typename + type = self.lookupElementInfo(typename, self.typedict) + if (type != None): + if (required): + # Tag type dependencies in 'required' attributes as + # required. This DOES NOT un-tag dependencies in a + # tag. See comments in markRequired() below for the reason. + if ('requires' in type.elem.attrib): + depType = type.elem.get('requires') + self.gen.logMsg('diag', '*** Generating dependent type', + depType, 'for type', typename) + self.markTypeRequired(depType, required) + # Tag types used in defining this type (e.g. in nested + # tags) + # Look for in entire tree, + # not just immediate children + for subtype in type.elem.findall('.//type'): + self.gen.logMsg('diag', '*** markRequired: type requires dependent ', subtype.text) + self.markTypeRequired(subtype.text, required) + # Tag enums used in defining this type, for example in + # member[MEMBER_SIZE] + for subenum in type.elem.findall('.//enum'): + self.gen.logMsg('diag', '*** markRequired: type requires dependent ', subenum.text) + self.markEnumRequired(subenum.text, required) + type.required = required + else: + self.gen.logMsg('warn', '*** type:', typename , 'IS NOT DEFINED') + # + # enumname - name of enum + # required - boolean (to tag features as required or not) + def markEnumRequired(self, enumname, required): + self.gen.logMsg('diag', '*** tagging enum:', enumname, '-> required =', required) + enum = self.lookupElementInfo(enumname, self.enumdict) + if (enum != None): + enum.required = required + else: + self.gen.logMsg('warn', '*** enum:', enumname , 'IS NOT DEFINED') + # + # features - Element for or tag + # required - boolean (to tag features as required or not) + def markRequired(self, features, required): + """Require or remove features specified in the Element""" + self.gen.logMsg('diag', '*** markRequired (features = , required =', required, ')') + # Loop over types, enums, and commands in the tag + # @@ It would be possible to respect 'api' and 'profile' attributes + # in individual features, but that's not done yet. + for typeElem in features.findall('type'): + self.markTypeRequired(typeElem.get('name'), required) + for enumElem in features.findall('enum'): + self.markEnumRequired(enumElem.get('name'), required) + for cmdElem in features.findall('command'): + name = cmdElem.get('name') + self.gen.logMsg('diag', '*** tagging command:', name, '-> required =', required) + cmd = self.lookupElementInfo(name, self.cmddict) + if (cmd != None): + cmd.required = required + # Tag all parameter types of this command as required. + # This DOES NOT remove types of commands in a + # tag, because many other commands may use the same type. + # We could be more clever and reference count types, + # instead of using a boolean. + if (required): + # Look for in entire tree, + # not just immediate children + for type in cmd.elem.findall('.//type'): + self.gen.logMsg('diag', '*** markRequired: command implicitly requires dependent type', type.text) + self.markTypeRequired(type.text, required) + else: + self.gen.logMsg('warn', '*** command:', name, 'IS NOT DEFINED') + # + # interface - Element for or , containing + # and tags + # api - string specifying API name being generated + # profile - string specifying API profile being generated + def requireAndRemoveFeatures(self, interface, api, profile): + """Process and tags for a or """ + # marks things that are required by this version/profile + for feature in interface.findall('require'): + if (matchAPIProfile(api, profile, feature)): + self.markRequired(feature,True) + # marks things that are removed by this version/profile + for feature in interface.findall('remove'): + if (matchAPIProfile(api, profile, feature)): + self.markRequired(feature,False) + # + # generateFeature - generate a single type / enum group / enum / command, + # and all its dependencies as needed. + # fname - name of feature (//) + # ftype - type of feature, 'type' | 'enum' | 'command' + # dictionary - of *Info objects - self.{type|enum|cmd}dict + def generateFeature(self, fname, ftype, dictionary): + f = self.lookupElementInfo(fname, dictionary) + if (f == None): + # No such feature. This is an error, but reported earlier + self.gen.logMsg('diag', '*** No entry found for feature', fname, + 'returning!') + return + # + # If feature isn't required, or has already been declared, return + if (not f.required): + self.gen.logMsg('diag', '*** Skipping', ftype, fname, '(not required)') + return + if (f.declared): + self.gen.logMsg('diag', '*** Skipping', ftype, fname, '(already declared)') + return + # Always mark feature declared, as though actually emitted + f.declared = True + # + # Pull in dependent declaration(s) of the feature. + # For types, there may be one type in the 'required' attribute of + # the element, as well as many in imbedded and tags + # within the element. + # For commands, there may be many in tags within the element. + # For enums, no dependencies are allowed (though perhaps if you + # have a uint64 enum, it should require GLuint64). + genProc = None + if (ftype == 'type'): + genProc = self.gen.genType + if ('requires' in f.elem.attrib): + depname = f.elem.get('requires') + self.gen.logMsg('diag', '*** Generating required dependent type', + depname) + self.generateFeature(depname, 'type', self.typedict) + for subtype in f.elem.findall('.//type'): + self.gen.logMsg('diag', '*** Generating required dependent ', + subtype.text) + self.generateFeature(subtype.text, 'type', self.typedict) + for subtype in f.elem.findall('.//enum'): + self.gen.logMsg('diag', '*** Generating required dependent ', + subtype.text) + self.generateFeature(subtype.text, 'enum', self.enumdict) + # If the type is an enum group, look up the corresponding + # group in the group dictionary and generate that instead. + if (f.elem.get('category') == 'enum'): + self.gen.logMsg('diag', '*** Type', fname, 'is an enum group, so generate that instead') + group = self.lookupElementInfo(fname, self.groupdict) + if (group == None): + # Unless this is tested for, it's probably fatal to call below + genProc = None + self.logMsg('warn', '*** NO MATCHING ENUM GROUP FOUND!!!') + else: + genProc = self.gen.genGroup + f = group + elif (ftype == 'command'): + genProc = self.gen.genCmd + for type in f.elem.findall('.//type'): + depname = type.text + self.gen.logMsg('diag', '*** Generating required parameter type', + depname) + self.generateFeature(depname, 'type', self.typedict) + elif (ftype == 'enum'): + genProc = self.gen.genEnum + # Actually generate the type only if emitting declarations + if self.emitFeatures: + self.gen.logMsg('diag', '*** Emitting', ftype, 'decl for', fname) + genProc(f, fname) + else: + self.gen.logMsg('diag', '*** Skipping', ftype, fname, + '(not emitting this feature)') + # + # generateRequiredInterface - generate all interfaces required + # by an API version or extension + # interface - Element for or + def generateRequiredInterface(self, interface): + """Generate required C interface for specified API version/extension""" + # + # Loop over all features inside all tags. + # tags are ignored (handled in pass 1). + for features in interface.findall('require'): + for t in features.findall('type'): + self.generateFeature(t.get('name'), 'type', self.typedict) + for e in features.findall('enum'): + self.generateFeature(e.get('name'), 'enum', self.enumdict) + for c in features.findall('command'): + self.generateFeature(c.get('name'), 'command', self.cmddict) + # + # apiGen(genOpts) - generate interface for specified versions + # genOpts - GeneratorOptions object with parameters used + # by the Generator object. + def apiGen(self, genOpts): + """Generate interfaces for the specified API type and range of versions""" + # + self.gen.logMsg('diag', '*******************************************') + self.gen.logMsg('diag', ' Registry.apiGen file:', genOpts.filename, + 'api:', genOpts.apiname, + 'profile:', genOpts.profile) + self.gen.logMsg('diag', '*******************************************') + # + self.genOpts = genOpts + # Reset required/declared flags for all features + self.apiReset() + # + # Compile regexps used to select versions & extensions + regVersions = re.compile(self.genOpts.versions) + regEmitVersions = re.compile(self.genOpts.emitversions) + regAddExtensions = re.compile(self.genOpts.addExtensions) + regRemoveExtensions = re.compile(self.genOpts.removeExtensions) + # + # Get all matching API versions & add to list of FeatureInfo + features = [] + apiMatch = False + for key in self.apidict: + fi = self.apidict[key] + api = fi.elem.get('api') + if (api == self.genOpts.apiname): + apiMatch = True + if (regVersions.match(fi.version)): + # Matches API & version #s being generated. Mark for + # emission and add to the features[] list . + # @@ Could use 'declared' instead of 'emit'? + fi.emit = (regEmitVersions.match(fi.version) != None) + features.append(fi) + if (not fi.emit): + self.gen.logMsg('diag', '*** NOT tagging feature api =', api, + 'name =', fi.name, 'version =', fi.version, + 'for emission (does not match emitversions pattern)') + else: + self.gen.logMsg('diag', '*** NOT including feature api =', api, + 'name =', fi.name, 'version =', fi.version, + '(does not match requested versions)') + else: + self.gen.logMsg('diag', '*** NOT including feature api =', api, + 'name =', fi.name, + '(does not match requested API)') + if (not apiMatch): + self.gen.logMsg('warn', '*** No matching API versions found!') + # + # Get all matching extensions, in order by their extension number, + # and add to the list of features. + # Start with extensions tagged with 'api' pattern matching the API + # being generated. Add extensions matching the pattern specified in + # regExtensions, then remove extensions matching the pattern + # specified in regRemoveExtensions + for (extName,ei) in sorted(self.extdict.items(),key = lambda x : x[1].number): + extName = ei.name + include = False + # + # Include extension if defaultExtensions is not None and if the + # 'supported' attribute matches defaultExtensions. The regexp in + # 'supported' must exactly match defaultExtensions, so bracket + # it with ^(pat)$. + pat = '^(' + ei.elem.get('supported') + ')$' + if (self.genOpts.defaultExtensions and + re.match(pat, self.genOpts.defaultExtensions)): + self.gen.logMsg('diag', '*** Including extension', + extName, "(defaultExtensions matches the 'supported' attribute)") + include = True + # + # Include additional extensions if the extension name matches + # the regexp specified in the generator options. This allows + # forcing extensions into an interface even if they're not + # tagged appropriately in the registry. + if (regAddExtensions.match(extName) != None): + self.gen.logMsg('diag', '*** Including extension', + extName, '(matches explicitly requested extensions to add)') + include = True + # Remove extensions if the name matches the regexp specified + # in generator options. This allows forcing removal of + # extensions from an interface even if they're tagged that + # way in the registry. + if (regRemoveExtensions.match(extName) != None): + self.gen.logMsg('diag', '*** Removing extension', + extName, '(matches explicitly requested extensions to remove)') + include = False + # + # If the extension is to be included, add it to the + # extension features list. + if (include): + ei.emit = True + features.append(ei) + else: + self.gen.logMsg('diag', '*** NOT including extension', + extName, '(does not match api attribute or explicitly requested extensions)') + # + # Sort the extension features list, if a sort procedure is defined + if (self.genOpts.sortProcedure): + self.genOpts.sortProcedure(features) + # + # Pass 1: loop over requested API versions and extensions tagging + # types/commands/features as required (in an block) or no + # longer required (in an block). It is possible to remove + # a feature in one version and restore it later by requiring it in + # a later version. + # If a profile other than 'None' is being generated, it must + # match the profile attribute (if any) of the and + # tags. + self.gen.logMsg('diag', '*** PASS 1: TAG FEATURES ********************************************') + for f in features: + self.gen.logMsg('diag', '*** PASS 1: Tagging required and removed features for', + f.name) + self.requireAndRemoveFeatures(f.elem, self.genOpts.apiname, self.genOpts.profile) + # + # Pass 2: loop over specified API versions and extensions printing + # declarations for required things which haven't already been + # generated. + self.gen.logMsg('diag', '*** PASS 2: GENERATE INTERFACES FOR FEATURES ************************') + self.gen.beginFile(self.genOpts) + for f in features: + self.gen.logMsg('diag', '*** PASS 2: Generating interface for', + f.name) + emit = self.emitFeatures = f.emit + if (not emit): + self.gen.logMsg('diag', '*** PASS 2: NOT declaring feature', + f.elem.get('name'), 'because it is not tagged for emission') + # Generate the interface (or just tag its elements as having been + # emitted, if they haven't been). + self.gen.beginFeature(f.elem, emit) + self.generateRequiredInterface(f.elem) + self.gen.endFeature() + self.gen.endFile() + # + # apiReset - use between apiGen() calls to reset internal state + # + def apiReset(self): + """Reset type/enum/command dictionaries before generating another API""" + for type in self.typedict: + self.typedict[type].resetState() + for enum in self.enumdict: + self.enumdict[enum].resetState() + for cmd in self.cmddict: + self.cmddict[cmd].resetState() + for cmd in self.apidict: + self.apidict[cmd].resetState() + # + # validateGroups - check that group= attributes match actual groups + # + def validateGroups(self): + """Validate group= attributes on and tags""" + # Keep track of group names not in tags + badGroup = {} + self.gen.logMsg('diag', '*** VALIDATING GROUP ATTRIBUTES ***') + for cmd in self.reg.findall('commands/command'): + proto = cmd.find('proto') + funcname = cmd.find('proto/name').text + if ('group' in proto.attrib.keys()): + group = proto.get('group') + # self.gen.logMsg('diag', '*** Command ', funcname, ' has return group ', group) + if (group not in self.groupdict.keys()): + # self.gen.logMsg('diag', '*** Command ', funcname, ' has UNKNOWN return group ', group) + if (group not in badGroup.keys()): + badGroup[group] = 1 + else: + badGroup[group] = badGroup[group] + 1 + for param in cmd.findall('param'): + pname = param.find('name') + if (pname != None): + pname = pname.text + else: + pname = type.get('name') + if ('group' in param.attrib.keys()): + group = param.get('group') + if (group not in self.groupdict.keys()): + # self.gen.logMsg('diag', '*** Command ', funcname, ' param ', pname, ' has UNKNOWN group ', group) + if (group not in badGroup.keys()): + badGroup[group] = 1 + else: + badGroup[group] = badGroup[group] + 1 + if (len(badGroup.keys()) > 0): + self.gen.logMsg('diag', '*** SUMMARY OF UNRECOGNIZED GROUPS ***') + for key in sorted(badGroup.keys()): + self.gen.logMsg('diag', ' ', key, ' occurred ', badGroup[key], ' times') diff --git a/vk.xml b/vk.xml new file mode 100644 index 00000000..f9471b3e --- /dev/null +++ b/vk.xml @@ -0,0 +1,5037 @@ + + + +Copyright (c) 2015 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +------------------------------------------------------------------------ + +This file, vk.xml, is the Vulkan API Registry. It is a critically important +and normative part of the Vulkan Specification, including a canonical +machine-readable definition of the API, parameter and member validation +language incorporated into the Specification and reference pages, and other +material which is registered by Khronos, such as tags used by extension and +layer authors. The only authoritative version of vk.xml is the one +maintained in the master branch of the Khronos Vulkan Github project. + + + + + + + + + + + + + + + + + + + + + + + + + + + + #include "vk_platform.h" + + #include "vulkan.h" + #include <X11/Xlib.h> + #include <android/native_window.h> + #include <mir_toolkit/client_types.h> + #include <wayland-client.h> + #include <windows.h> + #include <xcb/xcb.h> + + + + + + + + + + + + + + + + #define VK_MAKE_VERSION(major, minor, patch) \ + ((major << 22) | (minor << 12) | patch) + + // Vulkan API version supported by this file +#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 1) + + + +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; + + +#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; +#else + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; +#endif + + + +#define VK_NULL_HANDLE 0 + + + typedef uint32_t VkSampleMask; + typedef uint32_t VkBool32; + typedef uint32_t VkFlags; + typedef uint64_t VkDeviceSize; + + + + + + + + + + + typedef VkFlags VkFramebufferCreateFlags; + typedef VkFlags VkQueryPoolCreateFlags; + typedef VkFlags VkRenderPassCreateFlags; + typedef VkFlags VkSamplerCreateFlags; + typedef VkFlags VkPipelineLayoutCreateFlags; + typedef VkFlags VkPipelineCacheCreateFlags; + typedef VkFlags VkPipelineDepthStencilStateCreateFlags; + typedef VkFlags VkPipelineDynamicStateCreateFlags; + typedef VkFlags VkPipelineColorBlendStateCreateFlags; + typedef VkFlags VkPipelineMultisampleStateCreateFlags; + typedef VkFlags VkPipelineRasterizationStateCreateFlags; + typedef VkFlags VkPipelineViewportStateCreateFlags; + typedef VkFlags VkPipelineTessellationStateCreateFlags; + typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; + typedef VkFlags VkPipelineVertexInputStateCreateFlags; + typedef VkFlags VkPipelineShaderStageCreateFlags; + typedef VkFlags VkDescriptorSetLayoutCreateFlags; + typedef VkFlags VkBufferViewCreateFlags; + typedef VkFlags VkInstanceCreateFlags; + typedef VkFlags VkDeviceCreateFlags; + typedef VkFlags VkDeviceQueueCreateFlags; + typedef VkFlags VkQueueFlags; + typedef VkFlags VkMemoryPropertyFlags; + typedef VkFlags VkMemoryHeapFlags; + typedef VkFlags VkAccessFlags; + typedef VkFlags VkBufferUsageFlags; + typedef VkFlags VkBufferCreateFlags; + typedef VkFlags VkShaderStageFlags; + typedef VkFlags VkImageUsageFlags; + typedef VkFlags VkImageCreateFlags; + typedef VkFlags VkImageViewCreateFlags; + typedef VkFlags VkPipelineCreateFlags; + typedef VkFlags VkColorComponentFlags; + typedef VkFlags VkFenceCreateFlags; + typedef VkFlags VkSemaphoreCreateFlags; + typedef VkFlags VkFormatFeatureFlags; + typedef VkFlags VkQueryControlFlags; + typedef VkFlags VkQueryResultFlags; + typedef VkFlags VkShaderModuleCreateFlags; + typedef VkFlags VkEventCreateFlags; + typedef VkFlags VkCommandPoolCreateFlags; + typedef VkFlags VkCommandPoolResetFlags; + typedef VkFlags VkCommandBufferResetFlags; + typedef VkFlags VkCommandBufferUsageFlags; + typedef VkFlags VkQueryPipelineStatisticFlags; + typedef VkFlags VkMemoryMapFlags; + typedef VkFlags VkImageAspectFlags; + typedef VkFlags VkSparseMemoryBindFlags; + typedef VkFlags VkSparseImageFormatFlags; + typedef VkFlags VkSubpassDescriptionFlags; + typedef VkFlags VkPipelineStageFlags; + typedef VkFlags VkSampleCountFlags; + typedef VkFlags VkAttachmentDescriptionFlags; + typedef VkFlags VkStencilFaceFlags; + typedef VkFlags VkCullModeFlags; + typedef VkFlags VkDescriptorPoolCreateFlags; + typedef VkFlags VkDescriptorPoolResetFlags; + typedef VkFlags VkDependencyFlags; + + typedef VkFlags VkCompositeAlphaFlagsKHR; + typedef VkFlags VkDisplayPlaneAlphaFlagsKHR; + typedef VkFlags VkSurfaceTransformFlagsKHR; + typedef VkFlags VkSwapchainCreateFlagsKHR; + typedef VkFlags VkDisplayModeCreateFlagsKHR; + typedef VkFlags VkDisplaySurfaceCreateFlagsKHR; + typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; + typedef VkFlags VkMirSurfaceCreateFlagsKHR; + typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; + typedef VkFlags VkWin32SurfaceCreateFlagsKHR; + typedef VkFlags VkXlibSurfaceCreateFlagsKHR; + typedef VkFlags VkXcbSurfaceCreateFlagsKHR; + + typedef VkFlags VkDebugReportFlagsEXT; + + + VK_DEFINE_HANDLE(VkInstance) + VK_DEFINE_HANDLE(VkPhysicalDevice) + VK_DEFINE_HANDLE(VkDevice) + VK_DEFINE_HANDLE(VkQueue) + VK_DEFINE_HANDLE(VkCommandBuffer) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) + + + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayModeKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) + VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + typedef void (VKAPI_PTR *PFN_vkInternalAllocationNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + typedef void (VKAPI_PTR *PFN_vkInternalFreeNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)( + void* pUserData, + void* pOriginal, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + typedef void* (VKAPI_PTR *PFN_vkAllocationFunction)( + void* pUserData, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + typedef void (VKAPI_PTR *PFN_vkFreeFunction)( + void* pUserData, + void* pMemory); + + + typedef void (VKAPI_PTR *PFN_vkVoidFunction)(void); + + + typedef VkBool32 (VKAPI_PTR *PFN_vkDebugReportCallbackEXT)( + VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT objectType, + uint64_t object, + size_t location, + int32_t messageCode, + const char* pLayerPrefix, + const char* pMessage, + void* pUserData); + + + + int32_t x + int32_t y + + + int32_t x + int32_t y + int32_t z + + + uint32_t width + uint32_t height + + + uint32_t width + uint32_t height + uint32_t depth + + + float x + float y + float width + float height + float minDepth + float maxDepth + + pname:width must: be greater than `0.0` and less than or equal to sname:VkPhysicalDeviceLimits::pname:maxViewportDimensions[0] + pname:height must: be greater than `0.0` and less than or equal to sname:VkPhysicalDeviceLimits::pname:maxViewportDimensions[1] + pname:x and pname:y must: each be between pname:viewportBoundsRange[0] and pname:viewportBoundsRange[1], inclusive + pname:x + pname:width must: be less than or equal to pname:viewportBoundsRange[1] + pname:y + pname:height must: be less than or equal to pname:viewportBoundsRange[1] + pname:minDepth must: be between `0.0` and `1.0`, inclusive + pname:maxDepth must: be between `0.0` and `1.0`, inclusive + + + + VkOffset2D offset + VkExtent2D extent + + + VkOffset3D offset + VkExtent3D extent + + + VkRect2D rect + uint32_t baseArrayLayer + uint32_t layerCount + + + VkComponentSwizzle r + VkComponentSwizzle g + VkComponentSwizzle b + VkComponentSwizzle a + + + uint32_t apiVersion + uint32_t driverVersion + uint32_t vendorID + uint32_t deviceID + VkPhysicalDeviceType deviceType + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] + uint8_t pipelineCacheUUID[VK_UUID_SIZE] + VkPhysicalDeviceLimits limits + VkPhysicalDeviceSparseProperties sparseProperties + + + char extensionName[VK_MAX_EXTENSION_NAME_SIZE] + uint32_t specVersion + + + char layerName[VK_MAX_EXTENSION_NAME_SIZE] + uint32_t specVersion + uint32_t implementationVersion + char description[VK_MAX_DESCRIPTION_SIZE] + + + VkStructureType sType + const void* pNext + const char* pApplicationName + uint32_t applicationVersion + const char* pEngineName + uint32_t engineVersion + uint32_t apiVersion + + pname:apiVersion must: be a version that the implementation supports, or supports an effective substitute for + + + + void* pUserData + PFN_vkAllocationFunction pfnAllocation + PFN_vkReallocationFunction pfnReallocation + PFN_vkFreeFunction pfnFree + PFN_vkInternalAllocationNotification pfnInternalAllocation + PFN_vkInternalFreeNotification pfnInternalFree + + pname:pfnAllocation must: be a pointer to a valid user-defined PFN_vkAllocationFunction + pname:pfnReallocation must: be a pointer to a valid user-defined PFN_vkReallocationFunction + pname:pfnFree must: be a pointer to a valid user-defined PFN_vkFreeFunction + If either of pname:pfnInternalAllocatione or pname:pfnInternalFree is not `NULL`, both must: be valid callbacks + + + + VkStructureType sType + const void* pNext + VkDeviceQueueCreateFlags flags + uint32_t queueFamilyIndex + uint32_t queueCount + const float* pQueuePriorities + + pname:queueFamilyIndex must: be less than the value of pname:pQueueFamilyPropertyCount returned by fname:vkGetPhysicalDeviceQueueFamilyProperties + pname:queueCount must: be less than or equal to the value of the pname:queueCount member of the sname:VkQueueFamilyProperties structure, as returned by fname:vkGetPhysicalDeviceQueueFamilyProperties in the pname:pQueueFamilyProperties[pname:queueFamilyIndex] + The value of any given element of pname:pQueuePriorities must: be between `0.0` and `1.0` inclusive + + + + VkStructureType sType + const void* pNext + VkDeviceCreateFlags flags + uint32_t queueCreateInfoCount + const VkDeviceQueueCreateInfo* pQueueCreateInfos + uint32_t enabledLayerCount + const char* const* ppEnabledLayerNames + uint32_t enabledExtensionCount + const char* const* ppEnabledExtensionNames + const VkPhysicalDeviceFeatures* pEnabledFeatures + + Any given element of pname:ppEnabledLayerNames must: be the name of a layer present on the system, exactly matching a string returned in the sname:VkLayerProperties structure by fname:vkEnumerateDeviceLayerProperties + Any given element of pname:ppEnabledExtensionNames must: be the name of an extension present on the system, exactly matching a string returned in the sname:VkExtensionProperties structure by fname:vkEnumerateDeviceExtensionProperties + If an extension listed in pname:ppEnabledExtensionNames is provided as part of a layer, then both the layer and extension must: be enabled to enable that extension + The pname:queueFamilyIndex member of any given element of pname:pQueueCreateInfos must: be unique within pname:pQueueCreateInfos + + + + VkStructureType sType + const void* pNext + VkInstanceCreateFlags flags + const VkApplicationInfo* pApplicationInfo + uint32_t enabledLayerCount + const char* const* ppEnabledLayerNames + uint32_t enabledExtensionCount + const char* const* ppEnabledExtensionNames + + Any given element of pname:ppEnabledLayerNames must: be the name of a layer present on the system, exactly matching a string returned in the sname:VkLayerProperties structure by fname:vkEnumerateInstanceLayerProperties + Any given element of pname:ppEnabledExtensionNames must: be the name of an extension present on the system, exactly matching a string returned in the sname:VkExtensionProperties structure by fname:vkEnumerateInstanceExtensionProperties + If an extension listed in pname:ppEnabledExtensionNames is provided as part of a layer, then both the layer and extension must: be enabled to enable that extension + + + + VkQueueFlags queueFlags + uint32_t queueCount + uint32_t timestampValidBits + VkExtent3D minImageTransferGranularity + + + uint32_t memoryTypeCount + VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES] + uint32_t memoryHeapCount + VkMemoryHeap memoryHeaps[VK_MAX_MEMORY_HEAPS] + + + VkStructureType sType + const void* pNext + VkDeviceSize allocationSize + uint32_t memoryTypeIndex + + The value of pname:allocationSize must: be less than or equal to the amount of memory available to the sname:VkMemoryHeap specified by pname:memoryTypeIndex and the calling command's sname:VkDevice + The value of pname:allocationSize must: be greater than `0` + + + + VkDeviceSize size + VkDeviceSize alignment + uint32_t memoryTypeBits + + + VkImageAspectFlags aspectMask + VkExtent3D imageGranularity + VkSparseImageFormatFlags flags + + + VkSparseImageFormatProperties formatProperties + uint32_t imageMipTailFirstLod + VkDeviceSize imageMipTailSize + VkDeviceSize imageMipTailOffset + VkDeviceSize imageMipTailStride + + + VkMemoryPropertyFlags propertyFlags + uint32_t heapIndex + + + VkDeviceSize size + VkMemoryHeapFlags flags + + + VkStructureType sType + const void* pNext + VkDeviceMemory memory + VkDeviceSize offset + VkDeviceSize size + + pname:memory must: currently be mapped + pname:offset must: be less than the size of the currently mapped range of pname:memory + If pname:size is not equal to ename:VK_WHOLE_SIZE, the sum of pname:offset and pname:size must: be less than or equal to the size of the currently mapped range of pname:memory + pname:offset and pname:size must: each be a multiple of sname:VkPhysicalDeviceLimits::pname:nonCoherentAtomSize + + + + VkFormatFeatureFlags linearTilingFeatures + VkFormatFeatureFlags optimalTilingFeatures + VkFormatFeatureFlags bufferFeatures + + + VkExtent3D maxExtent + uint32_t maxMipLevels + uint32_t maxArrayLayers + VkSampleCountFlags sampleCounts + VkDeviceSize maxResourceSize + + + VkBuffer buffer + VkDeviceSize offset + VkDeviceSize range + + If pname:range is not equal to ename:VK_WHOLE_SIZE, the sum of pname:offset and pname:range must: be less than or equal to the size of pname:buffer + + + + VkSampler sampler + VkImageView imageView + VkImageLayout imageLayout + + + VkStructureType sType + const void* pNext + VkDescriptorSet dstSet + uint32_t dstBinding + uint32_t dstArrayElement + uint32_t descriptorCount + VkDescriptorType descriptorType + const VkDescriptorImageInfo* pImageInfo + const VkDescriptorBufferInfo* pBufferInfo + const VkBufferView* pTexelBufferView + + pname:dstBinding must: be a valid binding point within pname:dstSet + pname:descriptorType must: match the type of pname:dstBinding within pname:dstSet + The sum of pname:dstArrayElement and pname:descriptorCount must: be less than or equal to the number of array elements in the descriptor set binding specified by pname:dstBinding, and all applicable consecutive bindings, as described by <<descriptorsets-updates-consecutive>> + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLER, ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, pname:pImageInfo must: be a pointer to an array of pname:descriptorCount valid sname:VkDescriptorImageInfo structures + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, pname:pTexelBufferView must: be a pointer to an array of pname:descriptorCount valid sname:VkBufferView handles + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, pname:pBufferInfo must: be a pointer to an array of pname:descriptorCount valid sname:VkDescriptorBufferInfo structures + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLER or ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and pname:dstSet was not created with a layout that included immutable samplers for pname:dstBinding with pname:descriptorType, the pname:sampler member of any given element of pname:pImageInfo must: be a valid sname:VkSampler object + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the pname:imageView and pname:imageLayout members of any given element of pname:pImageInfo must: be a valid sname:VkImageView and elink:VkImageLayout, respectively + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the pname:offset member of any given element of pname:pBufferInfo must: be a multiple of the value of sname:VkPhysicalDeviceLimits::pname:minUniformBufferOffsetAlignment + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the pname:offset member of any given element of pname:pBufferInfo must: be a multiple of the value of sname:VkPhysicalDeviceLimits::pname:minStorageBufferOffsetAlignment + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the pname:buffer member of any given element of pname:pBufferInfo must: have been created with ename:VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT set + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the pname:buffer member of any given element of pname:pBufferInfo must: have been created with ename:VK_BUFFER_USAGE_STORAGE_BUFFER_BIT set + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the pname:range member of any given element of pname:pBufferInfo must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxUniformBufferRange + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the pname:range member of any given element of pname:pBufferInfo must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxStorageBufferRange + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, the sname:VkBuffer that pname:pTexelBufferView was created from must: have been created with ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT set + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, the sname:VkBuffer that pname:pTexelBufferView was created from must: have been created with ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT set + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the pname:imageView must: have been created with identity swizzle + + + + VkStructureType sType + const void* pNext + VkDescriptorSet srcSet + uint32_t srcBinding + uint32_t srcArrayElement + VkDescriptorSet dstSet + uint32_t dstBinding + uint32_t dstArrayElement + uint32_t descriptorCount + + pname:srcBinding must: be a valid binding within pname:srcSet + The sum of pname:srcArrayElement and pname:descriptorCount must: be less than or equal to the number of array elements in the descriptor set binding specified by pname:srcBinding, and all applicable consecutive bindings, as described by <<descriptorsets-updates-consecutive>> + pname:dstBinding must: be a valid binding within pname:dstSet + The sum of pname:dstArrayElement and pname:descriptorCount must: be less than or equal to the number of array elements in the descriptor set binding specified by pname:dstBinding, and all applicable consecutive bindings, as described by <<descriptorsets-updates-consecutive>> + + + + VkStructureType sType + const void* pNext + VkBufferCreateFlags flags + VkDeviceSize size + VkBufferUsageFlags usage + VkSharingMode sharingMode + uint32_t queueFamilyIndexCount + const uint32_t* pQueueFamilyIndices + + The value of pname:size must: be greater than `0` + If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT, pname:pQueueFamilyIndices must: be a pointer to an array of pname:queueFamilyIndexCount basetype:uint32_t values + If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT, pname:queueFamilyIndexCount must: be greater than `1` + If the <<features-features-sparseBinding,sparse bindings>> feature is not enabled, pname:flags mustnot: contain ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT + If the <<features-features-sparseResidencyBuffer,sparse buffer residency>> feature is not enabled, pname:flags mustnot: contain ename:VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT + If the <<features-features-sparseResidencyAliased,sparse aliased residency>> feature is not enabled, pname:flags mustnot: contain ename:VK_BUFFER_CREATE_SPARSE_ALIASED_BIT + If pname:flags contains ename:VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must: also contain at least one of ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT or ename:VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT + + + + VkStructureType sType + const void* pNext + VkBufferViewCreateFlagsflags + VkBuffer buffer + VkFormat format + VkDeviceSize offset + VkDeviceSize range + + The value of pname:offset must: be a multiple of sname:VkPhysicalDeviceLimits::pname:minTexelBufferOffsetAlignment + The value of pname:range must: be greater than `0` + If pname:range is not equal to ename:VK_WHOLE_SIZE, the sum of pname:offset and pname:range must: be less than or equal to the size of pname:buffer + If pname:range is not equal to ename:VK_WHOLE_SIZE, the value of pname:range must: be a multiple of the element size of pname:format + The value of pname:range, divided by the size of an element of pname:format, must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxTexelBufferElements + pname:buffer must: have been created with a pname:usage value containing at least one of ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT + If pname:buffer was created with pname:usage containing ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, pname:format must: be supported for uniform texel buffers, as specified by the ename:VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT flag in sname:VkFormatProperties::pname:bufferFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + If pname:buffer was created with pname:usage containing ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, pname:format must: be supported for storage texel buffers, as specified by the ename:VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT flag in sname:VkFormatProperties::pname:bufferFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + + + + VkImageAspectFlags aspectMask + uint32_t mipLevel + uint32_t arrayLayer + + pname:mipLevel must: be less than the pname:mipLevels specified in slink:VkImageCreateInfo when the image was created + pname:arrayLayer must: be less than the pname:arrayLayers specified in slink:VkImageCreateInfo when the image was created + + + + VkImageAspectFlags aspectMask + uint32_t mipLevel + uint32_t baseArrayLayer + uint32_t layerCount + + If pname:aspectMask contains ename:VK_IMAGE_ASPECT_COLOR_BIT, it mustnot: contain either of ename:VK_IMAGE_ASPECT_DEPTH_BIT or ename:VK_IMAGE_ASPECT_STENCIL_BIT + pname:aspectMask mustnot: contain ename:VK_IMAGE_ASPECT_METADATA_BIT + pname:mipLevel must: be less than the pname:mipLevels specified in slink:VkImageCreateInfo when the image was created + latexmath:[$(baseArrayLayer + layerCount)$] must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when the image was created + + + + VkImageAspectFlags aspectMask + uint32_t baseMipLevel + uint32_t levelCount + uint32_t baseArrayLayer + uint32_t layerCount + + latexmath:[$(baseMipLevel + levelCount)$] must: be less than or equal to the pname:mipLevels specified in slink:VkImageCreateInfo when the image was created + latexmath:[$(baseArrayLayer + layerCount)$] must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when the image was created + + + + VkStructureType sType + const void* pNext + VkAccessFlags srcAccessMask + VkAccessFlags dstAccessMask + + + VkStructureType sType + const void* pNext + VkAccessFlags srcAccessMask + VkAccessFlags dstAccessMask + uint32_t srcQueueFamilyIndex + uint32_t dstQueueFamilyIndex + VkBuffer buffer + VkDeviceSize offset + VkDeviceSize size + + The value of pname:offset must: be less than the size of pname:buffer + The sum of pname:offset and pname:size must: be less than or equal to than the size of pname:buffer + If pname:buffer was created with a sharing mode of ename:VK_SHARING_MODE_CONCURRENT, pname:srcQueueFamilyIndex and pname:dstQueueFamilyIndex must: both be VK_QUEUE_FAMILY_IGNORED + If pname:buffer was created with a sharing mode of ename:VK_SHARING_MODE_EXCLUSIVE, pname:srcQueueFamilyIndex and pname:dstQueueFamilyIndex must: either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see <<devsandqueues-queueprops>>) + If pname:buffer was created with a sharing mode of ename:VK_SHARING_MODE_EXCLUSIVE, and pname:srcQueueFamilyIndex and pname:dstQueueFamilyIndex are valid queue families, at least one of them must: be the same as the family of the queue that will execute this barrier + + + + VkStructureType sType + const void* pNext + VkAccessFlags srcAccessMask + VkAccessFlags dstAccessMask + VkImageLayout oldLayout + VkImageLayout newLayout + uint32_t srcQueueFamilyIndex + uint32_t dstQueueFamilyIndex + VkImage image + VkImageSubresourceRange subresourceRange + + pname:oldLayout must: be ename:VK_IMAGE_LAYOUT_UNDEFINED, ename:VK_IMAGE_LAYOUT_PREINITIALIZED or the current layout of the image region affected by the barrier + pname:newLayout mustnot: be ename:VK_IMAGE_LAYOUT_UNDEFINED or ename:VK_IMAGE_LAYOUT_PREINITIALIZED + If pname:image was created with a sharing mode of ename:VK_SHARING_MODE_CONCURRENT, pname:srcQueueFamilyIndex and pname:dstQueueFamilyIndex must: both be VK_QUEUE_FAMILY_IGNORED + If pname:image was created with a sharing mode of ename:VK_SHARING_MODE_EXCLUSIVE, pname:srcQueueFamilyIndex and pname:dstQueueFamilyIndex must: either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see <<devsandqueues-queueprops>>) + If pname:image was created with a sharing mode of ename:VK_SHARING_MODE_EXCLUSIVE, and pname:srcQueueFamilyIndex and pname:dstQueueFamilyIndex are valid queue families, at least one of them must: be the same as the family of the queue that will execute this barrier + pname:subresourceRange must: be a valid subresource range for the image (see <<resources-image-views>>) + If pname:image has a depth/stencil format with both depth and stencil components, then pname:aspectMask member of pname:subresourceRange must: include both ename:VK_IMAGE_ASPECT_DEPTH_BIT and ename:VK_IMAGE_ASPECT_STENCIL_BIT + + + + VkStructureType sType + const void* pNext + VkImageCreateFlags flags + VkImageType imageType + VkFormat format + VkExtent3D extent + uint32_t mipLevels + uint32_t arrayLayers + VkSampleCountFlagBits samples + VkImageTiling tiling + VkImageUsageFlags usage + VkSharingMode sharingMode + uint32_t queueFamilyIndexCount + const uint32_t* pQueueFamilyIndices + VkImageLayout initialLayout + + If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT, pname:pQueueFamilyIndices must: be a pointer to an array of pname:queueFamilyIndexCount basetype:uint32_t values + If pname:sharingMode is ename:VK_SHARING_MODE_CONCURRENT, pname:queueFamilyIndexCount must: be greater than `1` + pname:format mustnot: be ename:VK_FORMAT_UNDEFINED + The values of the pname:width, pname:height and pname:depth members of pname:extent must: all be greater than `0` + The value of pname:mipLevels must: be greater than `0` + The value of pname:arrayLayers must: be greater than `0` + If pname:imageType is ename:VK_IMAGE_TYPE_1D, the value of pname:extent.width must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxImageDimension1D, or the value of sname:VkImageFormatProperties::pname:maxExtent.width (as returned by fname:vkGetPhysicalDeviceImageFormatProperties with values of pname:format, pname:type, pname:tiling, pname:usage and pname:flags equal to those in this structure) - whichever is higher + If pname:imageType is ename:VK_IMAGE_TYPE_2D and pname:flags does not contain ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, the value of pname:extent.width and pname:extent.height must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxImageDimension2D, or the value of sname:VkImageFormatProperties::pname:maxExtent.width/height (as returned by fname:vkGetPhysicalDeviceImageFormatProperties with values of pname:format, pname:type, pname:tiling, pname:usage and pname:flags equal to those in this structure) - whichever is higher + If pname:imageType is ename:VK_IMAGE_TYPE_2D and pname:flags contains ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, the value of pname:extent.width and pname:extent.height must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxImageDimensionCube, or the value of sname:VkImageFormatProperties::pname:maxExtent.width/height (as returned by fname:vkGetPhysicalDeviceImageFormatProperties with values of pname:format, pname:type, pname:tiling, pname:usage and pname:flags equal to those in this structure) - whichever is higher + If pname:imageType is ename:VK_IMAGE_TYPE_2D and pname:flags contains ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, the value of pname:extent.width and pname:extent.height must: be equal + If pname:imageType is ename:VK_IMAGE_TYPE_3D, the value of pname:extent.width, pname:extent.height and pname:extent.depth must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxImageDimension3D, or the value of sname:VkImageFormatProperties::pname:maxExtent.width/height/depth (as returned by fname:vkGetPhysicalDeviceImageFormatProperties with values of pname:format, pname:type, pname:tiling, pname:usage and pname:flags equal to those in this structure) - whichever is higher + The value of pname:mipLevels must: be less than or equal to or equal to the value of latexmath:[$\lfloor\log_2(\max(\mathit{extent.width}, \mathit{extent.height}, \mathit{extent.depth}))\rfloor + 1$] + If the values of any of pname:extent.width, pname:extent.height or pname:extent.depth are greater than the values of the equivalently named members of sname:VkPhysicalDeviceLimits::pname:maxImageDimension3D, pname:mipLevels must: be less than or equal to the value of sname:VkImageFormatProperties::pname:maxMipLevels (as returned by fname:vkGetPhysicalDeviceImageFormatProperties with values of pname:format, pname:type, pname:tiling, pname:usage and pname:flags equal to those in this structure) + If the values of any of pname:extent.width, pname:extent.height or pname:extent.depth are greater than the values of the equivalently named members of sname:VkPhysicalDeviceLimits::pname:maxImageDimension3D, (pname:extent.width * pname:extent.height * pname:extent.depth) must: be less than or equal to the value of sname:VkImageFormatProperties::pname:maxResourceSize (as returned by flink:vkGetPhysicalDeviceImageFormatProperties with values of pname:format, pname:type, pname:tiling, pname:usage and pname:flags equal to those in this structure) + The value of pname:arrayLayers must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxImageArrayLayers, or the value of sname:VkImageFormatProperties::pname:maxArrayLayers (as returned by fname:vkGetPhysicalDeviceImageFormatProperties with values of pname:format, pname:type, pname:tiling, pname:usage and pname:flags equal to those in this structure) - whichever is higher + The value of pname:samples must: be a bit value that is set in the value of sname:VkPhysicalDeviceLimits::pname:sampleCounts returned by flink:vkGetPhysicalDeviceProperties, or the value of sname:VkImageFormatProperties::pname:maxExtent.sampleCounts returned by fname:vkGetPhysicalDeviceImageFormatProperties with values of pname:format, pname:type, pname:tiling, pname:usage and pname:flags equal to those in this structure + If pname:usage includes ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT or ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, the value of pname:extent.width must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxFramebufferWidth + If pname:usage includes ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT or ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, the value of pname:extent.height must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxFramebufferHeight + If pname:usage includes ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, the value of pname:samples must: be a bit value that is set in the value of sname:VkPhysicalDeviceLimits::pname:maxFramebufferColorSamples + If pname:usage includes ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, and pname:format includes a depth aspect, the value of pname:samples must: be a bit value that is set in the value of sname:VkPhysicalDeviceLimits::pname:maxFramebufferDepthSamples + If pname:usage includes ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, and pname:format includes a stencil aspect, the value of pname:samples must: be a bit value that is set in the value of sname:VkPhysicalDeviceLimits::pname:maxFramebufferStencilSamples + If pname:usage includes ename:VK_IMAGE_USAGE_SAMPLED_BIT, and pname:format includes a color aspect, the value of pname:samples must: be a bit value that is set in the value of sname:VkPhysicalDeviceLimits::pname:maxSampledImageColorSamples + If pname:usage includes ename:VK_IMAGE_USAGE_SAMPLED_BIT, and pname:format includes a depth aspect, the value of pname:samples must: be a bit value that is set in the value of sname:VkPhysicalDeviceLimits::pname:maxSampledImageDepthSamples + If pname:usage includes ename:VK_IMAGE_USAGE_SAMPLED_BIT, and pname:format is an integer format, the value of pname:samples must: be a bit value that is set in the value of sname:VkPhysicalDeviceLimits::pname:maxSampledImageIntegerSamples + If pname:usage includes ename:VK_IMAGE_USAGE_STORAGE_BIT, the value of pname:samples must: be a bit value that is set in the value of sname:VkPhysicalDeviceLimits::pname:maxStorageImageSamples + If the <<features-features-textureCompressionETC2,ETC2 texture compression>> feature is not enabled, pname:format mustnot: be ename:VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, ename:VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, ename:VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, ename:VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, ename:VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, ename:VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, ename:VK_FORMAT_EAC_R11_UNORM_BLOCK, ename:VK_FORMAT_EAC_R11_SNORM_BLOCK, ename:VK_FORMAT_EAC_R11G11_UNORM_BLOCK, or ename:VK_FORMAT_EAC_R11G11_SNORM_BLOCK + If the <<features-features-textureCompressionASTC_LDR,ASTC LDR texture compression>> feature is not enabled, pname:format mustnot: be ename:VK_FORMAT_ASTC_4x4_UNORM_BLOCK, ename:VK_FORMAT_ASTC_4x4_SRGB_BLOCK, ename:VK_FORMAT_ASTC_5x4_UNORM_BLOCK, ename:VK_FORMAT_ASTC_5x4_SRGB_BLOCK, ename:VK_FORMAT_ASTC_5x5_UNORM_BLOCK, ename:VK_FORMAT_ASTC_5x5_SRGB_BLOCK, ename:VK_FORMAT_ASTC_6x5_UNORM_BLOCK, ename:VK_FORMAT_ASTC_6x5_SRGB_BLOCK, ename:VK_FORMAT_ASTC_6x6_UNORM_BLOCK, ename:VK_FORMAT_ASTC_6x6_SRGB_BLOCK, ename:VK_FORMAT_ASTC_8x5_UNORM_BLOCK, ename:VK_FORMAT_ASTC_8x5_SRGB_BLOCK, ename:VK_FORMAT_ASTC_8x6_UNORM_BLOCK, ename:VK_FORMAT_ASTC_8x6_SRGB_BLOCK, ename:VK_FORMAT_ASTC_8x8_UNORM_BLOCK, ename:VK_FORMAT_ASTC_8x8_SRGB_BLOCK, ename:VK_FORMAT_ASTC_10x5_UNORM_BLOCK, ename:VK_FORMAT_ASTC_10x5_SRGB_BLOCK, ename:VK_FORMAT_ASTC_10x6_UNORM_BLOCK, ename:VK_FORMAT_ASTC_10x6_SRGB_BLOCK, ename:VK_FORMAT_ASTC_10x8_UNORM_BLOCK, ename:VK_FORMAT_ASTC_10x8_SRGB_BLOCK, ename:VK_FORMAT_ASTC_10x10_UNORM_BLOCK, ename:VK_FORMAT_ASTC_10x10_SRGB_BLOCK, ename:VK_FORMAT_ASTC_12x10_UNORM_BLOCK, ename:VK_FORMAT_ASTC_12x10_SRGB_BLOCK, ename:VK_FORMAT_ASTC_12x12_UNORM_BLOCK, or ename:VK_FORMAT_ASTC_12x12_SRGB_BLOCK + If the <<features-features-textureCompressionBC,BC texture compression>> feature is not enabled, pname:format mustnot: be ename:VK_FORMAT_BC1_RGB_UNORM_BLOCK, ename:VK_FORMAT_BC1_RGB_SRGB_BLOCK, ename:VK_FORMAT_BC1_RGBA_UNORM_BLOCK, ename:VK_FORMAT_BC1_RGBA_SRGB_BLOCK, ename:VK_FORMAT_BC2_UNORM_BLOCK, ename:VK_FORMAT_BC2_SRGB_BLOCK, ename:VK_FORMAT_BC3_UNORM_BLOCK, ename:VK_FORMAT_BC3_SRGB_BLOCK, ename:VK_FORMAT_BC4_UNORM_BLOCK, ename:VK_FORMAT_BC4_SNORM_BLOCK, ename:VK_FORMAT_BC5_UNORM_BLOCK, ename:VK_FORMAT_BC5_SNORM_BLOCK, ename:VK_FORMAT_BC6H_UFLOAT_BLOCK, ename:VK_FORMAT_BC6H_SFLOAT_BLOCK, ename:VK_FORMAT_BC7_UNORM_BLOCK, or ename:VK_FORMAT_BC7_SRGB_BLOCK + If the <<features-features-shaderStorageImageMultisample,multisampled storage images>> feature is not enabled, and pname:usage contains ename:VK_IMAGE_USAGE_STORAGE_BIT, pname:samples must: be ename:VK_SAMPLE_COUNT_1_BIT + If the <<features-features-sparseBinding,sparse bindings>> feature is not enabled, pname:flags mustnot: contain ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT + If the <<features-features-sparseResidencyImage2D,sparse residency for 2D images>> feature is not enabled, and pname:imageType is VK_IMAGE_TYPE_2D, pname:flags mustnot: contain ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT + If the <<features-features-sparseResidencyImage3D,sparse residency for 3D images>> feature is not enabled, and pname:imageType is VK_IMAGE_TYPE_3D, pname:flags mustnot: contain ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT + If the <<features-features-sparseResidency2Samples,sparse residency for images with 2 samples>> feature is not enabled, pname:imageType is VK_IMAGE_TYPE_2D, and pname:samples is ename:VK_SAMPLE_COUNT_2_BIT, pname:flags mustnot: contain ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT + If the <<features-features-sparseResidency4Samples,sparse residency for images with 4 samples>> feature is not enabled, pname:imageType is VK_IMAGE_TYPE_2D, and pname:samples is ename:VK_SAMPLE_COUNT_4_BIT, pname:flags mustnot: contain ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT + If the <<features-features-sparseResidency8Samples,sparse residency for images with 8 samples>> feature is not enabled, pname:imageType is VK_IMAGE_TYPE_2D, and pname:samples is ename:VK_SAMPLE_COUNT_8_BIT, pname:flags mustnot: contain ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT + If the <<features-features-sparseResidency16Samples,sparse residency for images with 16 samples>> feature is not enabled, pname:imageType is VK_IMAGE_TYPE_2D, and pname:samples is ename:VK_SAMPLE_COUNT_16_BIT, pname:flags mustnot: contain ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT + If the value of pname:tiling is ename:VK_IMAGE_TILING_LINEAR, and the value of sname:VkFormatProperties::pname:linearTilingFeatures (as returned by fname:vkGetPhysicalDeviceFormatProperties with the same value of pname:format) does not include VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, pname:usage mustnot: contain ename:VK_IMAGE_USAGE_SAMPLED_BIT + If the value of pname:tiling is ename:VK_IMAGE_TILING_LINEAR, and the value of sname:VkFormatProperties::pname:linearTilingFeatures (as returned by fname:vkGetPhysicalDeviceFormatProperties with the same value of pname:format) does not include VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT, pname:usage mustnot: contain ename:VK_IMAGE_USAGE_STORAGE_BIT + If the value of pname:tiling is ename:VK_IMAGE_TILING_LINEAR, and the value of sname:VkFormatProperties::pname:linearTilingFeatures (as returned by fname:vkGetPhysicalDeviceFormatProperties with the same value of pname:format) does not include VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, pname:usage mustnot: contain ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT + If the value of pname:tiling is ename:VK_IMAGE_TILING_LINEAR, and the value of sname:VkFormatProperties::pname:linearTilingFeatures (as returned by fname:vkGetPhysicalDeviceFormatProperties with the same value of pname:format) does not include VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, pname:usage mustnot: contain ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT + If the value of pname:tiling is ename:VK_IMAGE_TILING_OPTIMAL, and the value of sname:VkFormatProperties::pname:optimalTilingFeatures (as returned by fname:vkGetPhysicalDeviceFormatProperties with the same value of pname:format) does not include VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, pname:usage mustnot: contain ename:VK_IMAGE_USAGE_SAMPLED_BIT + If the value of pname:tiling is ename:VK_IMAGE_TILING_OPTIMAL, and the value of sname:VkFormatProperties::pname:optimalTilingFeatures (as returned by fname:vkGetPhysicalDeviceFormatProperties with the same value of pname:format) does not include VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT, pname:usage mustnot: contain ename:VK_IMAGE_USAGE_STORAGE_BIT + If the value of pname:tiling is ename:VK_IMAGE_TILING_OPTIMAL, and the value of sname:VkFormatProperties::pname:optimalTilingFeatures (as returned by fname:vkGetPhysicalDeviceFormatProperties with the same value of pname:format) does not include VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, pname:usage mustnot: contain ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT + If the value of pname:tiling is ename:VK_IMAGE_TILING_OPTIMAL, and the value of sname:VkFormatProperties::pname:optimalTilingFeatures (as returned by fname:vkGetPhysicalDeviceFormatProperties with the same value of pname:format) does not include VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, pname:usage mustnot: contain ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT + If pname:flags contains ename:VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must: also contain at least one of ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT or ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT + + + + VkDeviceSize offset + VkDeviceSize size + VkDeviceSize rowPitch + VkDeviceSize arrayPitch + VkDeviceSize depthPitch + + + VkStructureType sType + const void* pNext + VkImageViewCreateFlags flags + VkImage image + VkImageViewType viewType + VkFormat format + VkComponentMapping components + VkImageSubresourceRange subresourceRange + + If pname:image was not created with ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT then pname:viewType mustnot: be ename:VK_IMAGE_VIEW_TYPE_CUBE or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY + If the <<features-features-imageCubeArray,image cubemap arrays>> feature is not enabled, pname:viewType mustnot: be ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY + If the <<features-features-textureCompressionETC2,ETC2 texture compression>> feature is not enabled, pname:format mustnot: be ename:VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, ename:VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, ename:VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, ename:VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, ename:VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, ename:VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, ename:VK_FORMAT_EAC_R11_UNORM_BLOCK, ename:VK_FORMAT_EAC_R11_SNORM_BLOCK, ename:VK_FORMAT_EAC_R11G11_UNORM_BLOCK, or ename:VK_FORMAT_EAC_R11G11_SNORM_BLOCK + If the <<features-features-textureCompressionASTC_LDR,ASTC LDR texture compression>> feature is not enabled, pname:format mustnot: be ename:VK_FORMAT_ASTC_4x4_UNORM_BLOCK, ename:VK_FORMAT_ASTC_4x4_SRGB_BLOCK, ename:VK_FORMAT_ASTC_5x4_UNORM_BLOCK, ename:VK_FORMAT_ASTC_5x4_SRGB_BLOCK, ename:VK_FORMAT_ASTC_5x5_UNORM_BLOCK, ename:VK_FORMAT_ASTC_5x5_SRGB_BLOCK, ename:VK_FORMAT_ASTC_6x5_UNORM_BLOCK, ename:VK_FORMAT_ASTC_6x5_SRGB_BLOCK, ename:VK_FORMAT_ASTC_6x6_UNORM_BLOCK, ename:VK_FORMAT_ASTC_6x6_SRGB_BLOCK, ename:VK_FORMAT_ASTC_8x5_UNORM_BLOCK, ename:VK_FORMAT_ASTC_8x5_SRGB_BLOCK, ename:VK_FORMAT_ASTC_8x6_UNORM_BLOCK, ename:VK_FORMAT_ASTC_8x6_SRGB_BLOCK, ename:VK_FORMAT_ASTC_8x8_UNORM_BLOCK, ename:VK_FORMAT_ASTC_8x8_SRGB_BLOCK, ename:VK_FORMAT_ASTC_10x5_UNORM_BLOCK, ename:VK_FORMAT_ASTC_10x5_SRGB_BLOCK, ename:VK_FORMAT_ASTC_10x6_UNORM_BLOCK, ename:VK_FORMAT_ASTC_10x6_SRGB_BLOCK, ename:VK_FORMAT_ASTC_10x8_UNORM_BLOCK, ename:VK_FORMAT_ASTC_10x8_SRGB_BLOCK, ename:VK_FORMAT_ASTC_10x10_UNORM_BLOCK, ename:VK_FORMAT_ASTC_10x10_SRGB_BLOCK, ename:VK_FORMAT_ASTC_12x10_UNORM_BLOCK, ename:VK_FORMAT_ASTC_12x10_SRGB_BLOCK, ename:VK_FORMAT_ASTC_12x12_UNORM_BLOCK, or ename:VK_FORMAT_ASTC_12x12_SRGB_BLOCK + If the <<features-features-textureCompressionBC,BC texture compression>> feature is not enabled, pname:format mustnot: be ename:VK_FORMAT_BC1_RGB_UNORM_BLOCK, ename:VK_FORMAT_BC1_RGB_SRGB_BLOCK, ename:VK_FORMAT_BC1_RGBA_UNORM_BLOCK, ename:VK_FORMAT_BC1_RGBA_SRGB_BLOCK, ename:VK_FORMAT_BC2_UNORM_BLOCK, ename:VK_FORMAT_BC2_SRGB_BLOCK, ename:VK_FORMAT_BC3_UNORM_BLOCK, ename:VK_FORMAT_BC3_SRGB_BLOCK, ename:VK_FORMAT_BC4_UNORM_BLOCK, ename:VK_FORMAT_BC4_SNORM_BLOCK, ename:VK_FORMAT_BC5_UNORM_BLOCK, ename:VK_FORMAT_BC5_SNORM_BLOCK, ename:VK_FORMAT_BC6H_UFLOAT_BLOCK, ename:VK_FORMAT_BC6H_SFLOAT_BLOCK, ename:VK_FORMAT_BC7_UNORM_BLOCK, or ename:VK_FORMAT_BC7_SRGB_BLOCK + If pname:image was created with ename:VK_IMAGE_TILING_LINEAR and pname:usage containing ename:VK_IMAGE_USAGE_SAMPLED_BIT, pname:format must: be supported for sampled images, as specified by the ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT flag in sname:VkFormatProperties::pname:linearTilingFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + If pname:image was created with ename:VK_IMAGE_TILING_LINEAR and pname:usage containing ename:VK_IMAGE_USAGE_STORAGE_BIT, pname:format must: be supported for storage images, as specified by the ename:VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT flag in sname:VkFormatProperties::pname:linearTilingFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + If pname:image was created with ename:VK_IMAGE_TILING_LINEAR and pname:usage containing ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, pname:format must: be supported for color attachments, as specified by the ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT flag in sname:VkFormatProperties::pname:linearTilingFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + If pname:image was created with ename:VK_IMAGE_TILING_LINEAR and pname:usage containing ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, pname:format must: be supported for depth/stencil attachments, as specified by the ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT flag in sname:VkFormatProperties::pname:linearTilingFeatures (as returned by fname:vkGetPhysicalDeviceFormatProperties + If pname:image was created with ename:VK_IMAGE_TILING_OPTIMAL and pname:usage containing ename:VK_IMAGE_USAGE_SAMPLED_BIT, pname:format must: be supported for sampled images, as specified by the ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT flag in sname:VkFormatProperties::pname:optimalTilingFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + If pname:image was created with ename:VK_IMAGE_TILING_OPTIMAL and pname:usage containing ename:VK_IMAGE_USAGE_STORAGE_BIT, pname:format must: be supported for storage images, as specified by the ename:VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT flag in sname:VkFormatProperties::pname:optimalTilingFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + If pname:image was created with ename:VK_IMAGE_TILING_OPTIMAL and pname:usage containing ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, pname:format must: be supported for color attachments, as specified by the ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT flag in sname:VkFormatProperties::pname:optimalTilingFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + If pname:image was created with ename:VK_IMAGE_TILING_OPTIMAL and pname:usage containing ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, pname:format must: be supported for depth/stencil attachments, as specified by the ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT flag in sname:VkFormatProperties::pname:optimalTilingFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + pname:subresourceRange must: be a valid subresource range for pname:image (see <<resources-image-views>>) + If pname:image was created with the ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, pname:format must: be compatible with the pname:format used to create pname:image, as defined in <<features-formats-compatibility-classes,Format Compatibility Classes>> + If pname:image was not created with the ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, pname:format must: be identical to the pname:format used to create pname:image + pname:subResourceRange and pname:viewType must: be compatible with the image, as described in the <<resources-image-views-compatibility,table below>> + + + + VkDeviceSize srcOffset + VkDeviceSize dstOffset + VkDeviceSize size + + + VkDeviceSize resourceOffset + VkDeviceSize size + VkDeviceMemory memory + VkDeviceSize memoryOffset + VkSparseMemoryBindFlagsflags + + If pname:memory is not sname:VK_NULL_HANDLE, pname:memory and pname:memoryOffset must: match the memory requirements of the resource, as described in section <<resources-association>> + If pname:memory is not sname:VK_NULL_HANDLE, pname:memory mustnot: have been created with a memory type that reports ename:VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT bit set + pname:resourceOffset must: be less than the size of the resource + The sum of pname:resourceOffset and pname:size must: be less than or equal to the size of the resource + pname:memoryOffset must: be less than the size of pname:memory + The sum of pname:memoryOffset and pname:size must: be less than or equal to the size of pname:memory + + + + VkImageSubresource subresource + VkOffset3D offset + VkExtent3D extent + VkDeviceMemory memory + VkDeviceSize memoryOffset + VkSparseMemoryBindFlagsflags + + If the <<features-features-sparseResidencyAliased,sparse aliased residency>> feature is not enabled, and if any other resources are bound to ranges of pname:memory, the range of pname:memory being bound mustnot: overlap with those bound ranges + pname:memory and pname:memoryOffset must: match the memory requirements of the calling command's pname:image, as described in section <<resources-association>> + pname:subresource must: be a valid subresource for pname:image (see <<resources-image-views>>) + pname:offset.x must: be a multiple of the block width (sname:VkSparseImageFormatProperties::pname:imageGranularity.width) of the image + pname:extent.width must: either be a multiple of the block width of the image, or else pname:extent.width + pname:offset.x must: equal the width of the image subresource + pname:offset.y must: be a multiple of the block height (sname:VkSparseImageFormatProperties::pname:imageGranularity.height) of the image + pname:extent.height must: either be a multiple of the block height of the image, or else pname:extent.height + pname:offset.y must: equal the height of the image subresource + pname:offset.z must: be a multiple of the block depth (sname:VkSparseImageFormatProperties::pname:imageGranularity.depth) of the image + pname:extent.depth must: either be a multiple of the block depth of the image, or else pname:extent.depth + pname:offset.z must: equal the depth of the image subresource + + + + VkBuffer buffer + uint32_t bindCount + const VkSparseMemoryBind* pBinds + + + VkImage image + uint32_t bindCount + const VkSparseMemoryBind* pBinds + + For any given element of pname:pBinds, if the pname:flags member of that element contains ename:VK_SPARSE_MEMORY_BIND_METADATA_BIT, the 'binding range' defined must: be within the mip tail region of the metadata aspect of pname:image + + + + VkImage image + uint32_t bindCount + const VkSparseImageMemoryBind* pBinds + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreCount + const VkSemaphore* pWaitSemaphores + uint32_t bufferBindCount + const VkSparseBufferMemoryBindInfo* pBufferBinds + uint32_t imageOpaqueBindCount + const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds + uint32_t imageBindCount + const VkSparseImageMemoryBindInfo* pImageBinds + uint32_t signalSemaphoreCount + const VkSemaphore* pSignalSemaphores + + + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffset + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffset + VkExtent3D extent + + The pname:aspectMask member of pname:srcSubresource and pname:dstSubresource must: match + The pname:layerCount member of pname:srcSubresource and pname:dstSubresource must: match + If either of the calling command's pname:srcImage or pname:dstImage parameters are of elink:VkImageType ename:VK_IMAGE_TYPE_3D, the pname:baseArrayLayer and pname:layerCount members of both pname:srcSubresource and pname:dstSubresource must: be `0` and `1`, respectively + The pname:aspectMask member of pname:srcSubresource must: specify aspects present in the calling command's pname:srcImage + The pname:aspectMask member of pname:dstSubresource must: specify aspects present in the calling command's pname:dstImage + pname:srcOffset.x and (pname:extent.width + pname:srcOffset.x) must: both be greater than or equal to `0` and less than or equal to the source image subresource width + pname:srcOffset.y and (pname:extent.height + pname:srcOffset.y) must: both be greater than or equal to `0` and less than or equal to the source image subresource height + pname:srcOffset.z and (pname:extent.depth + pname:srcOffset.z) must: both be greater than or equal to `0` and less than or equal to the source image subresource depth + pname:dstOffset.x and (pname:extent.width + pname:dstOffset.x) must: both be greater than or equal to `0` and less than or equal to the destination image subresource width + pname:dstOffset.y and (pname:extent.height + pname:dstOffset.y) must: both be greater than or equal to `0` and less than or equal to the destination image subresource height + pname:dstOffset.z and (pname:extent.depth + pname:dstOffset.z) must: both be greater than or equal to `0` and less than or equal to the destination image subresource depth + If the calling command's pname:srcImage is a compressed format image: + * all members of pname:srcOffset must: be a multiple of the block size in the relevant dimensions + * pname:extent.width must: be a multiple of the block width or (pname:extent.width + pname:srcOffset.x) must: equal the source image subresource width + * pname:extent.height must: be a multiple of the block height or (pname:extent.height + pname:srcOffset.y) must: equal the source image subresource height + * pname:extent.depth must: be a multiple of the block depth or (pname:extent.depth + pname:srcOffset.z) must: equal the source image subresource depth + If the calling command's pname:dstImage is a compressed format image: + * all members of pname:dstOffset must: be a multiple of the block size in the relevant dimensions + * pname:extent.width must: be a multiple of the block width or (pname:extent.width + pname:dstOffset.x) must: equal the destination image subresource width + * pname:extent.height must: be a multiple of the block height or (pname:extent.height + pname:dstOffset.y) must: equal the destination image subresource height + * pname:extent.depth must: be a multiple of the block depth or (pname:extent.depth + pname:dstOffset.z) must: equal the destination image subresource depth + pname:srcOffset, pname:dstOffset, and pname:extent must: respect the image transfer granularity requirements of the queue family that it will be submitted against, as described in <<execution-physical-device-enumeration,Physical Device Enumeration>> + + + + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffsets[2] + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffsets[2] + + The pname:aspectMask member of pname:srcSubresource and pname:dstSubresource must: match + The pname:layerCount member of pname:srcSubresource and pname:dstSubresource must: match + If either of the calling command's pname:srcImage or pname:dstImage parameters are of elink:VkImageType ename:VK_IMAGE_TYPE_3D, the pname:baseArrayLayer and pname:layerCount members of both pname:srcSubresource and pname:dstSubresource must: be `0` and `1`, respectively + The pname:aspectMask member of pname:srcSubresource must: specify aspects present in the calling command's pname:srcImage + The pname:aspectMask member of pname:dstSubresource must: specify aspects present in the calling command's pname:dstImage + + + + VkDeviceSize bufferOffset + uint32_t bufferRowLength + uint32_t bufferImageHeight + VkImageSubresourceLayers imageSubresource + VkOffset3D imageOffset + VkExtent3D imageExtent + + pname:bufferOffset must: be a multiple of the calling command's sname:VkImage parameter's texel size + pname:bufferOffset must: be a multiple of `4` + pname:bufferRowLength must: be `0`, or greater than or equal to the pname:width member of pname:imageExtent + pname:bufferImageHeight must: be `0`, or greater than or equal to the pname:height member of pname:imageExtent + pname:imageOffset.x and (pname:imageExtent.width + pname:imageOffset.x) must: both be greater than or equal to `0` and less than or equal to the image subresource width + pname:imageOffset.y and (imageExtent.height + pname:imageOffset.y) must: both be greater than or equal to `0` and less than or equal to the image subresource height + pname:imageOffset.z and (imageExtent.depth + pname:imageOffset.z) must: both be greater than or equal to `0` and less than or equal to the image subresource depth + If the calling command's sname:VkImage parameter is a compressed format image: + * pname:bufferRowLength, pname:bufferImageHeight and all members of pname:imageOffset must: be a multiple of the block size in the relevant dimensions + * pname:bufferOffset must: be a multiple of the block size in bytes + * pname:imageExtent.width must: be a multiple of the block width or (pname:imageExtent.width + pname:imageOffset.x) must: equal the image subresource width + * pname:imageExtent.height must: be a multiple of the block height or (pname:imageExtent.height + pname:imageOffset.y) must: equal the image subresource height + * pname:imageExtent.depth must: be a multiple of the block depth or (pname:imageExtent.depth + pname:imageOffset.z) must: equal the image subresource depth + pname:bufferOffset, pname:bufferRowLength, pname:bufferImageHeight and all members of pname:imageOffset and pname:imageExtent must: respect the image transfer granularity requirements of the queue family that it will be submitted against, as described in <<execution-physical-device-enumeration,Physical Device Enumeration>> + The pname:aspectMask member of pname:srcSubresource must: specify aspects present in the calling command's sname:VkImage parameter + The pname:aspectMask member of pname:pSubresource must: only have a single bit set + If the calling command's sname:VkImage parameter is of elink:VkImageType ename:VK_IMAGE_TYPE_3D, the pname:baseArrayLayer and pname:layerCount members of both pname:srcSubresource and pname:dstSubresource must: be `0` and `1`, respectively + + + + VkImageSubresourceLayers srcSubresource + VkOffset3D srcOffset + VkImageSubresourceLayers dstSubresource + VkOffset3D dstOffset + VkExtent3D extent + + The pname:aspectMask member of pname:srcSubresource and pname:dstSubresource must: only contain ename:VK_IMAGE_ASPECT_COLOR_BIT + The pname:layerCount member of pname:srcSubresource and pname:dstSubresource must: match + If either of the calling command's pname:srcImage or pname:dstImage parameters are of elink:VkImageType ename:VK_IMAGE_TYPE_3D, the pname:baseArrayLayer and pname:layerCount members of both pname:srcSubresource and pname:dstSubresource must: be `0` and `1`, respectively + + + + VkStructureType sType + const void* pNext + VkShaderModuleCreateFlags flags + size_t codeSize + const uint32_t* pCode + + pname:codeSize must: be greater than 0 + pname:codeSize must: be a multiple of 4 + pname:pCode must: point to valid SPIR-V code, formatted and packed as described by https://www.khronos.org/registry/spir-v/specs/1.0/SPIRV.html[the SPIR-V Specification v1.0] + pname:pCode must: adhere to the validation rules described by the <<spirvenv-module-validation, Validation Rules within a Module>> section of the <<spirvenv-capabilities,SPIR-V Environment>> appendix + pname:pCode must: declare the code:Shader capability + pname:pCode mustnot: declare any capability that is not supported by the API, as described by the <<spirvenv-module-validation, Capabilities>> section of the <<spirvenv-capabilities,SPIR-V Environment>> appendix + If pname:pCode declares any of the capabilities that are listed as not required by the implementation, the relevant feature must: be enabled, as listed in the <<spirvenv-capabilities-table,SPIR-V Environment>> appendix + + + + uint32_t binding + VkDescriptorType descriptorType + uint32_t descriptorCount + VkShaderStageFlags stageFlags + const VkSampler* pImmutableSamplers + + If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLER or ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and pname:descriptorCount is not `0` and pname:pImmutableSamplers is not `NULL`, pname:pImmutableSamplers must: be a pointer to an array of pname:descriptorCount valid sname:VkSampler handles + If pname:descriptorCount is not `0`, pname:stageFlags must: be a valid combination of elink:VkShaderStageFlagBits values + + + + VkStructureType sType + const void* pNext + VkDescriptorSetLayoutCreateFlags flags + uint32_t bindingCount + const VkDescriptorSetLayoutBinding* pBindings + + + VkDescriptorType type + uint32_t descriptorCount + + The value of pname:descriptorCount must: be greater than `0` + + + + VkStructureType sType + const void* pNext + VkDescriptorPoolCreateFlags flags + uint32_t maxSets + uint32_t poolSizeCount + const VkDescriptorPoolSize* pPoolSizes + + The value of pname:maxSets must: be greater than `0` + + + + VkStructureType sType + const void* pNext + VkDescriptorPool descriptorPool + uint32_t descriptorSetCount + const VkDescriptorSetLayout* pSetLayouts + + The value of pname:descriptorSetCount mustnot: be greater than the number of sets that are currently available for allocation in pname:descriptorPool + + + + uint32_t constantID + uint32_t offset + size_t size + + + uint32_t mapEntryCount + const VkSpecializationMapEntry* pMapEntries + size_t dataSize + const void* pData + + The pname:offset member of any given element of pname:pMapEntries must: be less than pname:dataSize + The sum of the pname:offset and pname:size members of any given element of pname:pMapEntries must: be less than or equal to pname:dataSize + + + + VkStructureType sType + const void* pNext + VkPipelineShaderStageCreateFlags flags + VkShaderStageFlagBits stage + VkShaderModule module + const char* pName + const VkSpecializationInfo* pSpecializationInfo + + If the <<features-features-geometryShader,geometry shaders>> feature is not enabled, pname:stage mustnot: be pname:VK_SHADER_STAGE_GEOMETRY_BIT + If the <<features-features-tessellationShader,tessellation shaders>> feature is not enabled, pname:stage mustnot: be pname:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT or pname:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT + pname:stage mustnot: be ename:VK_SHADER_STAGE_ALL_GRAPHICS, or ename:VK_SHADER_STAGE_ALL + pname:pName must: be the name of an code:OpEntryPoint in pname:module with an execution model that matches pname:stage + If the identified entry point includes any variable in its interface that is declared with the code:ClipDistance code:BuiltIn decoration, that variable mustnot: have an array size greater than sname:VkPhysicalDeviceLimits::pname:maxClipDistances + If the identified entry point includes any variable in its interface that is declared with the code:CullDistance code:BuiltIn decoration, that variable mustnot: have an array size greater than sname:VkPhysicalDeviceLimits::pname:maxCullDistances + If the identified entry point includes any variables in its interface that are declared with the code:ClipDistance or code:CullDistance code:BuiltIn decoration, those variables mustnot: have array sizes which sum to more than sname:VkPhysicalDeviceLimits::pname:maxCombinedClipAndCullDistances + If the identified entry point includes any variable in its interface that is declared with the code:SampleMask code:BuiltIn decoration, that variable mustnot: have an array size greater than sname:VkPhysicalDeviceLimits::pname:maxSampleMaskWords + If pname:stage is ename:VK_SHADER_STAGE_VERTEX_BIT, the identified entry point mustnot: include any input variable in its interface that is decorated with code:CullDistance + If pname:stage is ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT or ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, and the identified entry point has an code:OpExecutionMode instruction that specifies a patch size with code:OutputVertices, the patch size must: be greater than `0` and less than or equal to sname:VkPhysicalDeviceLimits::pname:maxTessellationPatchSize + If pname:stage is ename:VK_SHADER_STAGE_GEOMETRY_BIT, the identified entry point must: have an code:OpExecutionMode instruction that specifies a maximum output vertex count that is greater than `0` and less than or equal to sname:VkPhysicalDeviceLimits::pname:maxGeometryOutputVertices + If pname:stage is ename:VK_SHADER_STAGE_GEOMETRY_BIT, the identified entry point must: have an code:OpExecutionMode instruction that specifies an invocation count that is greater than `0` and less than or equal to sname:VkPhysicalDeviceLimits::pname:maxGeometryShaderInvocations + If pname:stage is ename:VK_SHADER_STAGE_GEOMETRY_BIT, and the identified entry point writes to code:Layer for any primitive, it must: write the same value to code:Layer for all vertices of a given primitive + If pname:stage is ename:VK_SHADER_STAGE_GEOMETRY_BIT, and the identified entry point writes to code:ViewportIndex for any primitive, it must: write the same value to code:ViewportIndex for all vertices of a given primitive + If pname:stage is ename:VK_SHADER_STAGE_FRAGMENT_BIT, the identified entry point mustnot: include any output variables in its interface decorated with code:CullDistance + If pname:stage is ename:VK_SHADER_STAGE_FRAGMENT_BIT, and the identified entry point writes to code:FragDepth in any execution path, it must: write to code:FragDepth in all execution paths + + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flags + VkPipelineShaderStageCreateInfo stage + VkPipelineLayout layout + VkPipeline basePipelineHandle + int32_t basePipelineIndex + + If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and pname:basePipelineIndex is not `-1`, pname:basePipelineHandle must: be sname:VK_NULL_HANDLE + If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and pname:basePipelineIndex is not `-1`, it must: be a valid index into the calling command's pname:pCreateInfos parameter + If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and pname:basePipelineHandle is not sname:VK_NULL_HANDLE, pname:basePipelineIndex must: be `-1` + If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and pname:basePipelineHandle is not sname:VK_NULL_HANDLE, pname:basePipelineHandle must: be a valid sname:VkPipeline handle + If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and pname:basePipelineHandle is not sname:VK_NULL_HANDLE, it must: be a valid handle to a compute sname:VkPipeline + The pname:stage member of pname:stage must: be ename:VK_SHADER_STAGE_COMPUTE_BIT + The shader code for the entry point identified by pname:stage and the rest of the state identified by this structure must: adhere to the pipeline linking rules described in the <<interfaces,Shader Interfaces>> chapter + pname:layout must: be <<descriptorsets-pipelinelayout-consistency,consistent>> with all shaders specified in pname:pStages + + + + uint32_t binding + uint32_t stride + VkVertexInputRate inputRate + + pname:binding must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxVertexInputBindings + pname:stride must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxVertexInputBindingStride + + + + uint32_t location + uint32_t binding + VkFormat format + uint32_t offset + + pname:binding must: be less than sname:VkPhysicalDeviceLimits::pname:maxVertexInputBindings + pname:offset must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxVertexInputAttributeOffset + pname:format must: be allowed as a vertex buffer format, as specified by the ename:VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT flag in sname:VkFormatProperties::pname:bufferFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + + + + VkStructureType sType + const void* pNext + VkPipelineVertexInputStateCreateFlags flags + uint32_t vertexBindingDescriptionCount + const VkVertexInputBindingDescription* pVertexBindingDescriptions + uint32_t vertexAttributeDescriptionCount + const VkVertexInputAttributeDescription* pVertexAttributeDescriptions + + pname:vertexBindingDescriptionCount must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxVertexInputBindings + pname:vertexAttributeDescriptionCount must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxVertexInputAttributes + For every value of pname:binding specified by any given element of pname:pVertexAttributeDescriptions, a sname:VkVertexInputBindingDescription must: exist in pname:pVertexBindingDescriptions with the same value of pname:binding + All elements of pname:pVertexBindingDescriptions must: describe distinct binding numbers + All elements of pname:pVertexAttributeDescriptions must: describe distinct attribute locations + + + + + VkStructureType sType + const void* pNext + VkPipelineInputAssemblyStateCreateFlags flags + VkPrimitiveTopology topology + VkBool32 primitiveRestartEnable + + If pname:topology is ename:VK_PRIMITIVE_TOPOLOGY_POINT_LIST, ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST, ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY, ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY or ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST, the value of pname:primitiveRestartEnable must: be ename:VK_FALSE + If the <<features-features-geometryShader,geometry shaders>> feature is not enabled, pname:topology mustnot: be any of ename:VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY, ename:VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY, ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY or ename:VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY + If the <<features-features-tessellationShader,tessellation shaders>> feature is not enabled, pname:topology mustnot: be VK_PRIMITIVE_TOPOLOGY_PATCH_LIST + + + + VkStructureType sType + const void* pNext + VkPipelineTessellationStateCreateFlags flags + uint32_t patchControlPoints + + pname:patchControlPoints must: be greater than zero and less than or equal to sname:VkPhysicalDeviceLimits::pname:maxTessellationPatchSize + + + + VkStructureType sType + const void* pNext + VkPipelineViewportStateCreateFlags flags + uint32_t viewportCount + const VkViewport* pViewports + uint32_t scissorCount + const VkRect2D* pScissors + + If the <<features-features-multiViewport,multiple viewports>> feature is not enabled, pname:viewportCount must: be `1` + If the <<features-features-multiViewport,multiple viewports>> feature is not enabled, pname:scissorCount must: be `1` + pname:viewportCount must: be between `1` and sname:VkPhysicalDeviceLimits::pname:maxViewports, inclusive + pname:scissorCount must: be between `1` and sname:VkPhysicalDeviceLimits::pname:maxViewports, inclusive + The values of pname:scissorCount and pname:viewportCount must: be identical + + + + VkStructureType sType + const void* pNext + VkPipelineRasterizationStateCreateFlags flags + VkBool32 depthClampEnable + VkBool32 rasterizerDiscardEnable + VkPolygonMode polygonMode + VkCullModeFlags cullMode + VkFrontFace frontFace + VkBool32 depthBiasEnable + float depthBiasConstantFactor + float depthBiasClamp + float depthBiasSlopeFactor + float lineWidth + + If the <<features-features-depthClamp,depth clamping>> feature is not enabled, the value of pname:depthClampEnable must: be ename:VK_FALSE + If the <<features-features-fillModeNonSolid,non-solid fill modes>> feature is not enabled, the value of pname:fillMode must: be ename:VK_POLYGON_MODE_FILL + + + + VkStructureType sType + const void* pNext + VkPipelineMultisampleStateCreateFlags flags + VkSampleCountFlagBits rasterizationSamples + VkBool32 sampleShadingEnable + float minSampleShading + const VkSampleMask* pSampleMask + VkBool32 alphaToCoverageEnable + VkBool32 alphaToOneEnable + + If the <<features-features-sampleRateShading,sample rate shading>> feature is not enabled, pname:sampleShadingEnable must: be ename:VK_FALSE + If the <<features-features-alphaToOne,alpha to one>> feature is not enabled, pname:alphaToOneEnable must: be ename:VK_FALSE + + + + VkBool32 blendEnable + VkBlendFactor srcColorBlendFactor + VkBlendFactor dstColorBlendFactor + VkBlendOp colorBlendOp + VkBlendFactor srcAlphaBlendFactor + VkBlendFactor dstAlphaBlendFactor + VkBlendOp alphaBlendOp + VkColorComponentFlags colorWriteMask + + If the <<features-features-dualSrcBlend,dual source blending>> feature is not enabled, pname:srcColorBlendFactor mustnot: be pname:VK_BLEND_SRC1_COLOR, pname:VK_BLEND_ONE_MINUS_SRC1_COLOR, pname:VK_BLEND_SRC1_ALPHA, or pname:VK_BLEND_ONE_MINUS_SRC1_ALPHA + If the <<features-features-dualSrcBlend,dual source blending>> feature is not enabled, pname:dstColorBlendFactor mustnot: be pname:VK_BLEND_SRC1_COLOR, pname:VK_BLEND_ONE_MINUS_SRC1_COLOR, pname:VK_BLEND_SRC1_ALPHA, or pname:VK_BLEND_ONE_MINUS_SRC1_ALPHA + If the <<features-features-dualSrcBlend,dual source blending>> feature is not enabled, pname:srcAlphaBlendFactor mustnot: be pname:VK_BLEND_SRC1_COLOR, pname:VK_BLEND_ONE_MINUS_SRC1_COLOR, pname:VK_BLEND_SRC1_ALPHA, or pname:VK_BLEND_ONE_MINUS_SRC1_ALPHA + If the <<features-features-dualSrcBlend,dual source blending>> feature is not enabled, pname:dstAlphaBlendFactor mustnot: be pname:VK_BLEND_SRC1_COLOR, pname:VK_BLEND_ONE_MINUS_SRC1_COLOR, pname:VK_BLEND_SRC1_ALPHA, or pname:VK_BLEND_ONE_MINUS_SRC1_ALPHA + + + + VkStructureType sType + const void* pNext + VkPipelineColorBlendStateCreateFlags flags + VkBool32 logicOpEnable + VkLogicOp logicOp + uint32_t attachmentCount + const VkPipelineColorBlendAttachmentState* pAttachments + float blendConstants[4] + + If the <<features-features-independentBlend,independent blending>> feature is not enabled, all elements of pname:pAttachments must: be identical + If the <<features-features-logicOp,logic operations>> feature is not enabled, pname:logicOpEnable must: be ename:VK_FALSE + If pname:logicOpEnable is ename:VK_TRUE, pname:logicOp must: be a valid elink:VkLogicOp value + + + + VkStructureType sType + const void* pNext + VkPipelineDynamicStateCreateFlags flags + uint32_t dynamicStateCount + const VkDynamicState* pDynamicStates + + + VkStencilOp failOp + VkStencilOp passOp + VkStencilOp depthFailOp + VkCompareOp compareOp + uint32_t compareMask + uint32_t writeMask + uint32_t reference + + + VkStructureType sType + const void* pNext + VkPipelineDepthStencilStateCreateFlags flags + VkBool32 depthTestEnable + VkBool32 depthWriteEnable + VkCompareOp depthCompareOp + VkBool32 depthBoundsTestEnable + VkBool32 stencilTestEnable + VkStencilOpState front + VkStencilOpState back + float minDepthBounds + float maxDepthBounds + + If the <<features-features-depthBounds,depth bounds testing>> feature is not enabled, the value of pname:depthBoundsTestEnable must: be ename:VK_FALSE + + + + VkStructureType sType + const void* pNext + VkPipelineCreateFlags flags + uint32_t stageCount + const VkPipelineShaderStageCreateInfo* pStages + const VkPipelineVertexInputStateCreateInfo* pVertexInputState + const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState + const VkPipelineTessellationStateCreateInfo* pTessellationState + const VkPipelineViewportStateCreateInfo* pViewportState + const VkPipelineRasterizationStateCreateInfo* pRasterizationState + const VkPipelineMultisampleStateCreateInfo* pMultisampleState + const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState + const VkPipelineColorBlendStateCreateInfo* pColorBlendState + const VkPipelineDynamicStateCreateInfo* pDynamicState + VkPipelineLayout layout + VkRenderPass renderPass + uint32_t subpass + VkPipeline basePipelineHandle + int32_t basePipelineIndex + + If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and pname:basePipelineIndex is not `-1`, pname:basePipelineHandle must: be sname:VK_NULL_HANDLE + If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and pname:basePipelineIndex is not `-1`, it must: be a valid index into the calling command's pname:pCreateInfos parameter + If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and pname:basePipelineHandle is not sname:VK_NULL_HANDLE, pname:basePipelineIndex must: be `-1` + If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and pname:basePipelineHandle is not sname:VK_NULL_HANDLE, pname:basePipelineHandle must: be a valid sname:VkPipeline handle + If pname:flags contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and pname:basePipelineHandle is not sname:VK_NULL_HANDLE, it must: be a valid handle to a graphics sname:VkPipeline + pname:stageCount must: be greater than or equal to `1` + The pname:stage member of each element of pname:pStages must: be unique + The pname:stage member of one element of pname:pStages must: be ename:VK_SHADER_STAGE_VERTEX_BIT + The pname:stage member of any given element of pname:pStages mustnot: be ename:VK_SHADER_STAGE_COMPUTE_BIT + If pname:pStages includes a tessellation control shader stage, it must: include a tessellation evaluation shader stage + If pname:pStages includes a tessellation evaluation shader stage, it must: include a tessellation control shader stage + If pname:pStages includes a tessellation control shader stage and a tessellation evaluation shader stage, pname:pTessellationState mustnot: be `NULL` + If pname:pStages includes both a tessellation control shader stage and a tessellation evaluation shader stage, the shader code of at least one must: contain an code:OpExecutionMode instruction that specifies the type of subdivision in the pipeline + If pname:pStages includes both a tessellation control shader stage and a tessellation evaluation shader stage, and the shader code of both contain an code:OpExecutionMode instruction that specifies the type of subdivision in the pipeline, they must: both specify the same subdivision mode + If pname:pStages includes both a tessellation control shader stage and a tessellation evaluation shader stage, the shader code of at least one must: contain an code:OpExecutionMode instruction that specifies the output patch size in the pipeline + If pname:pStages includes both a tessellation control shader stage and a tessellation evaluation shader stage, and the shader code of both contain an code:OpExecutionMode instruction that specifies the out patch size in the pipeline, they must: both specify the same patch size + If pname:pStages includes tessellation shader stages, the pname:topology member of pname:pInputAssembly must: be ename:VK_PRIMITIVE_TOPOLOGY_PATCH_LIST + If pname:pStages includes a geometry shader stage, and doesn't include any tessellation shader stages, its shader code must: contain an code:OpExecutionMode instruction that specifies an input primitive type that is <<shaders-geometry-execution, compatible>> with the primitive topology specified in pname:pInputAssembly + If pname:pStages includes a geometry shader stage, and also includes tessellation shader stages, its shader code must: contain an code:OpExecutionMode instruction that specifies an input primitive type that is <<shaders-geometry-execution, compatible>> with the primitive topology that is output by the tessellation stages + If pname:pStages includes a fragment shader stage and a geometry shader stage, and the fragment shader code reads from an input variable that is decorated with code:PrimitiveID, then the geometry shader code must: write to a matching output variable, decorated with code:PrimitiveID, in all execution paths + If pname:pStages includes a fragment shader stage, its shader code mustnot: read from any input attachment that is defined as ename:VK_ATTACHMENT_UNUSED in pname:subpass + The shader code for the entry points identified by pname:pStages, and the rest of the state identified by this structure must: adhere to the pipeline linking rules described in the <<interfaces,Shader Interfaces>> chapter + If pname:subpass uses a depth/stencil attachment in pname:renderpass that has a layout of ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL in the sname:VkAttachmentReference defined by pname:subpass, and pname:pDepthStencilState is not `NULL`, the pname:depthWriteEnable member of pname:pDepthStencilState must: be ename:VK_FALSE + If pname:subpass uses a depth/stencil attachment in pname:renderpass that has a layout of ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL in the sname:VkAttachmentReference defined by pname:subpass, and pname:pDepthStencilState is not `NULL`, the value of the pname:failOp, pname:passOp and pname:depthFailOp members of each of the pname:front and pname:back members of pname:pDepthStencilState must: be ename:VK_STENCIL_OP_KEEP + If pname:pColorBlendState is not `NULL`, the value of the pname:blendEnable member of each element of the pname:pAttachment member of pname:pColorBlendState must: be ename:VK_FALSE if the pname:format of the attachment referred to in pname:subpass of pname:renderPass does not support color blend operations, as specified by the ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT flag in sname:VkFormatProperties::pname:linearTilingFeatures or sname:VkFormatProperties::pname:optimalTilingFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + If pname:pColorBlendState is not `NULL`, The pname:attachmentCount member of pname:pColorBlendState must: be equal to the value of pname:colorAttachmentCount used to create pname:subpass + If no element of the pname:pDynamicStates member of pname:pDynamicState is ename:VK_DYNAMIC_STATE_VIEWPORT, the pname:pViewports member of pname:pViewportState must: be a pointer to an array of pname:pViewportState->viewportCount sname:VkViewport structures + If no element of the pname:pDynamicStates member of pname:pDynamicState is ename:VK_DYNAMIC_STATE_SCISSOR, the pname:pScissors member of pname:pViewportState must: be a pointer to an array of pname:pViewportState->scissorCount sname:VkRect2D structures + If the wide lines feature is not enabled, and no element of the pname:pDynamicStates member of pname:pDynamicState is ename:VK_DYNAMIC_STATE_LINE_WIDTH, the pname:lineWidth member of pname:pRasterizationState must: be `1.0` + If the pname:rasterizerDiscardEnable member of pname:pRasterizationState is ename:VK_FALSE, pname:pViewportState must: be a pointer to a valid sname:VkPipelineViewportStateCreateInfo structure + If the pname:rasterizerDiscardEnable member of pname:pRasterizationState is ename:VK_FALSE, pname:pMultisampleState must: be a pointer to a valid sname:VkPipelineMultisampleStateCreateInfo structure + If the pname:rasterizerDiscardEnable member of pname:pRasterizationState is ename:VK_FALSE, and pname:subpass uses a depth/stencil attachment, pname:pDepthStencilState must: be a pointer to a valid sname:VkPipelineDepthStencilStateCreateInfo structure + If the pname:rasterizerDiscardEnable member of pname:pRasterizationState is ename:VK_FALSE, and pname:subpass uses color attachments, pname:pColorBlendState must: be a pointer to a valid sname:VkPipelineColorBlendStateCreateInfo structure + If the depth bias clamping feature is not enabled, no element of the pname:pDynamicStates member of pname:pDynamicState is ename:VK_DYNAMIC_STATE_DEPTH_BIAS, and the pname:depthBiasEnable member of pname:pDepthStencil is ename:VK_TRUE, the pname:depthBiasClamp member of pname:pDepthStencil must: be `0.0` + If no element of the pname:pDynamicStates member of pname:pDynamicState is ename:VK_DYNAMIC_STATE_DEPTH_BOUNDS, and the pname:depthBoundsTestEnable member of pname:pDepthStencil is ename:VK_TRUE, the value of the pname:minDepthBounds and pname:maxDepthBounds members of pname:pDepthStencil must: be between `0.0` and `1.0`, inclusive + pname:layout must: be <<descriptorsets-pipelinelayout-consistency,consistent>> with all shaders specified in pname:pStages + If pname:subpass uses color and/or depth/stencil attachments, then the pname:rasterizationSamples member of pname:pMultisampleState must: be the same as the sample count for those subpass attachments + If pname:subpass does not use any color and/or depth/stencil attachments, then the pname:rasterizationSamples member of pname:pMultisampleState must: follow the rules for a <<renderpass-noattachments, zero-attachment subpass>> + pname:subpass must: be a valid subpass within pname:renderpass + + + + VkStructureType sType + const void* pNext + VkPipelineCacheCreateFlags flags + size_t initialDataSize + const void* pInitialData + + If pname:initialDataSize is not `0`, it must: be equal to the size of pname:pInitialData, as returned by fname:vkGetPipelineCacheData when pname:pInitialData was originally retrieved + If pname:initialDataSize is not `0`, pname:pInitialData must: have been retrieved from a previous call to fname:vkGetPipelineCacheData + + + + VkShaderStageFlags stageFlags + uint32_t offset + uint32_t size + + The sum of pname:offset and pname:size must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxPushConstantsSize + The value of pname:size must: be greater than `0` + The value of pname:size must: be a multiple of `4` + + + + VkStructureType sType + const void* pNext + VkPipelineLayoutCreateFlags flags + uint32_t setLayoutCount + const VkDescriptorSetLayout* pSetLayouts + uint32_t pushConstantRangeCount + const VkPushConstantRange* pPushConstantRanges + + pname:setLayoutCount must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxBoundDescriptorSets + The total number of descriptors of the type ename:VK_DESCRIPTOR_TYPE_SAMPLER and ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given shader stage across all elements of pname:pSetLayouts must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorSamplers + The total number of descriptors of the type ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pname:pSetLayouts must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorUniformBuffers + The total number of descriptors of the type ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pname:pSetLayouts must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorStorageBuffers + The total number of descriptors of the type ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any given shader stage across all elements of pname:pSetLayouts must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorSampledImages + The total number of descriptors of the type ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any given shader stage across all elements of pname:pSetLayouts must: be less than or equal to the value of sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorStorageImages + + + + VkStructureType sType + const void* pNext + VkSamplerCreateFlags flags + VkFilter magFilter + VkFilter minFilter + VkSamplerMipmapMode mipmapMode + VkSamplerAddressMode addressModeU + VkSamplerAddressMode addressModeV + VkSamplerAddressMode addressModeW + float mipLodBias + VkBool32 anisotropyEnable + float maxAnisotropy + VkBool32 compareEnable + VkCompareOp compareOp + float minLod + float maxLod + VkBorderColor borderColor + VkBool32 unnormalizedCoordinates + + The absolute value of pname:mipLodBias must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxSamplerLodBias + If the <<features-features-samplerAnisotropy,anisotropic sampling>> feature is not enabled, pname:anisotropyEnable must: be ename:VK_FALSE + If pname:anisotropyEnable is ename:VK_TRUE, the value of pname:maxAnisotropy must: be between `1.0` and sname:VkPhysicalDeviceLimits::pname:maxSamplerAnisotropy, inclusive + If pname:unnormalizedCoordinates is ename:VK_TRUE, pname:minFilter and pname:magFilter must: be equal + If pname:unnormalizedCoordinates is ename:VK_TRUE, pname:mipmapMode must: be ename:VK_SAMPLER_MIPMAP_MODE_NEAREST + If pname:unnormalizedCoordinates is ename:VK_TRUE, pname:minLod and pname:maxLod must: be zero + If pname:unnormalizedCoordinates is ename:VK_TRUE, pname:addressModeU and pname:addressModeV must: each be either ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE or ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER + If pname:unnormalizedCoordinates is ename:VK_TRUE, pname:anisotropyEnable must: be ename:VK_FALSE + If pname:unnormalizedCoordinates is ename:VK_TRUE, pname:compareEnable must: be ename:VK_FALSE + If any of pname:addressModeU, pname:addressModeV or pname:addressModeW are ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, pname:borderColor must: be a valid elink:VkBorderColor value + If pname:compareEnable is ename:VK_TRUE, pname:compareOp must: be a valid elink:VkCompareOp value + + + + VkStructureType sType + const void* pNext + VkCommandPoolCreateFlags flags + uint32_t queueFamilyIndex + + pname:queueFamilyIndex must: be the index of a queue family available in the calling command's pname:device parameter + + + + VkStructureType sType + const void* pNext + VkCommandPool commandPool + VkCommandBufferLevel level + uint32_t commandBufferCount + + + VkStructureType sType + const void* pNext + VkRenderPass renderPass + uint32_t subpass + VkFramebuffer framebuffer + VkBool32 occlusionQueryEnable + VkQueryControlFlags queryFlags + VkQueryPipelineStatisticFlags pipelineStatistics + + If the <<features-features-inheritedQueries,inherited queries>> feature is not enabled, pname:occlusionQueryEnable must: be ename:VK_FALSE + If the <<features-features-inheritedQueries,inherited queries>> feature is enabled, pname:queryFlags must: be a valid combination of elink:VkQueryControlFlagBits values + If the <<features-features-pipelineStatisticsQuery,pipeline statistics queries>> feature is not enabled, pname:pipelineStatistics must: be code:0 + + + + VkStructureType sType + const void* pNext + VkCommandBufferUsageFlags flags + const VkCommandBufferInheritanceInfo* pInheritanceInfo + + If pname:flags contains ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the pname:renderPass member of pname:pInheritanceInfo must: be a valid sname:VkRenderPass + If pname:flags contains ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the pname:subpass member of pname:pInheritanceInfo must: be a valid subpass index within the pname:renderPass member of pname:pInheritanceInfo + If pname:flags contains ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the pname:framebuffer member of pname:pInheritanceInfo must: be either sname:VK_NULL_HANDLE, or a valid sname:VkFramebuffer that is compatible with the pname:renderPass member of pname:pInheritanceInfo + + + + VkStructureType sType + const void* pNext + VkRenderPass renderPass + VkFramebuffer framebuffer + VkRect2D renderArea + uint32_t clearValueCount + const VkClearValue* pClearValues + + The value of pname:clearValueCount must: be greater than or equal to the number of attachments in pname:renderPass that specify a pname:loadOp of ename:VK_ATTACHMENT_LOAD_OP_CLEAR + + + + float float32[4] + int32_t int32[4] + uint32_t uint32[4] + + + float depth + uint32_t stencil + + + VkClearColorValue color + VkClearDepthStencilValue depthStencil + + + VkImageAspectFlags aspectMask + uint32_t colorAttachment + VkClearValue clearValue + + If pname:aspectMask includes ename:VK_IMAGE_ASPECT_COLOR_BIT, it mustnot: include ename:VK_IMAGE_ASPECT_DEPTH_BIT or ename:VK_IMAGE_ASPECT_STENCIL_BIT + pname:aspectMask mustnot: include ename:VK_IMAGE_ASPECT_METADATA_BIT + + + + VkAttachmentDescriptionFlags flags + VkFormat format + VkSampleCountFlagBits samples + VkAttachmentLoadOp loadOp + VkAttachmentStoreOp storeOp + VkAttachmentLoadOp stencilLoadOp + VkAttachmentStoreOp stencilStoreOp + VkImageLayout initialLayout + VkImageLayout finalLayout + + + uint32_t attachment + VkImageLayout layout + + + VkSubpassDescriptionFlags flags + VkPipelineBindPoint pipelineBindPoint + uint32_t inputAttachmentCount + const VkAttachmentReference* pInputAttachments + uint32_t colorAttachmentCount + const VkAttachmentReference* pColorAttachments + const VkAttachmentReference* pResolveAttachments + const VkAttachmentReference* pDepthStencilAttachment + uint32_t preserveAttachmentCount + const uint32_t* pPreserveAttachments + + pname:pipelineBindPoint must: be ename:VK_PIPELINE_BIND_POINT_GRAPHICS + The value of pname:colorCount must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxColorAttachments + If the first use of an attachment in this render pass is as an input attachment, and the attachment is not also used as a color or depth/stencil attachment in the same subpass, then pname:loadOp mustnot: be ename:VK_ATTACHMENT_LOAD_OP_CLEAR + If pname:pResolveAttachments is not `NULL`, for each resolve attachment that does not have the value ename:VK_ATTACHMENT_UNUSED, the corresponding color attachment mustnot: have the value ename:VK_ATTACHMENT_UNUSED + If pname:pResolveAttachments is not `NULL`, the sample count of each element of pname:pColorAttachments must: be anything other than ename:VK_SAMPLE_COUNT_1_BIT + Any given element of pname:pResolveAttachments must: have a sample count of ename:VK_SAMPLE_COUNT_1_BIT + Any given element of pname:pResolveAttachments must: have the same elink:VkFormat as its corresponding color attachment + All attachments in pname:pColorAttachments and pname:pDepthStencilAttachment that are not ename:VK_ATTACHMENT_UNUSED must: have the same sample count + If any input attachments are ename:VK_ATTACHMENT_UNUSED, then any pipelines bound during the subpass mustnot: accesss those input attachments from the fragment shader + The pname:attachment member of any element of pname:pPreserveAttachments mustnot: be ename:VK_ATTACHMENT_UNUSED + Any given element of pname:pPreserveAttachments mustnot: also be an element of any other member of the subpass description + If any attachment is used as both an input attachment and a color or depth/stencil attachment, then each use must use the same pname:layout + + + + uint32_t srcSubpass + uint32_t dstSubpass + VkPipelineStageFlags srcStageMask + VkPipelineStageFlags dstStageMask + VkAccessFlags srcAccessMask + VkAccessFlags dstAccessMask + VkDependencyFlags dependencyFlags + + If the <<features-features-geometryShader,geometry shaders>> feature is not enabled, pname:srcStageMask mustnot: contain pname:VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT + If the <<features-features-geometryShader,geometry shaders>> feature is not enabled, pname:dstStageMask mustnot: contain pname:VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT + If the <<features-features-tessellationShader,tessellation shaders>> feature is not enabled, pname:srcStageMask mustnot: contain pname:VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or pname:VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT + If the <<features-features-tessellationShader,tessellation shaders>> feature is not enabled, pname:dstStageMask mustnot: contain pname:VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or pname:VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT + The value of pname:srcSubpass must: be less than or equal to pname:dstSubpass, unless one of them is ename:VK_SUBPASS_EXTERNAL, to avoid cyclic dependencies and ensure a valid execution order + The values of pname:srcSubpass and pname:dstSubpass mustnot: both be equal to ename:VK_SUBPASS_EXTERNAL + + + + VkStructureType sType + const void* pNext + VkRenderPassCreateFlags flags + uint32_t attachmentCount + const VkAttachmentDescription* pAttachments + uint32_t subpassCount + const VkSubpassDescription* pSubpasses + uint32_t dependencyCount + const VkSubpassDependency* pDependencies + + If any two subpasses operate on attachments with overlapping ranges of the same sname:VkDeviceMemory object, and at least one subpass writes to that area of sname:VkDeviceMemory, a subpass dependency must: be included (either directly or via some intermediate subpasses) between them + If the pname:attachment member of any element of pname:pInputAttachments, pname:pColorAttachments, pname:pResolveAttachments or pname:pDepthStencilAttachment, or the attachment indexed by any element of pname:pPreserveAttachments in any given element of pname:pSubpasses is bound to a range of a sname:VkDeviceMemory object that overlaps with any other attachment in any subpass (including the same subpass), the sname:VkAttachmentReference structures describing them must: include ename:VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT in pname:flags + If the pname:attachment member of any element of pname:pInputAttachments, pname:pColorAttachments, pname:pResolveAttachments or pname:pDepthStencilAttachment, or the value of any element of pname:pPreserveAttachments in any given element of pname:pSubpasses is not ename:VK_ATTACHMENT_UNUSED, it must: be less than the value of pname:attachmentCount + The value of any element of the pname:pPreserveAttachments member in any given element of pname:pSubpasses mustnot: be ename:VK_ATTACHMENT_UNUSED + + + + VkStructureType sType + const void* pNext + VkEventCreateFlags flags + + + VkStructureType sType + const void* pNext + VkFenceCreateFlags flags + + + VkBool32 robustBufferAccess + VkBool32 fullDrawIndexUint32 + VkBool32 imageCubeArray + VkBool32 independentBlend + VkBool32 geometryShader + VkBool32 tessellationShader + VkBool32 sampleRateShading + VkBool32 dualSrcBlend + VkBool32 logicOp + VkBool32 multiDrawIndirect + VkBool32 drawIndirectFirstInstance + VkBool32 depthClamp + VkBool32 depthBiasClamp + VkBool32 fillModeNonSolid + VkBool32 depthBounds + VkBool32 wideLines + VkBool32 largePoints + VkBool32 alphaToOne + VkBool32 multiViewport + VkBool32 samplerAnisotropy + VkBool32 textureCompressionETC2 + VkBool32 textureCompressionASTC_LDR + VkBool32 textureCompressionBC + VkBool32 occlusionQueryPrecise + VkBool32 pipelineStatisticsQuery + VkBool32 vertexPipelineStoresAndAtomics + VkBool32 fragmentStoresAndAtomics + VkBool32 shaderTessellationAndGeometryPointSize + VkBool32 shaderImageGatherExtended + VkBool32 shaderStorageImageExtendedFormats + VkBool32 shaderStorageImageMultisample + VkBool32 shaderStorageImageReadWithoutFormat + VkBool32 shaderStorageImageWriteWithoutFormat + VkBool32 shaderUniformBufferArrayDynamicIndexing + VkBool32 shaderSampledImageArrayDynamicIndexing + VkBool32 shaderStorageBufferArrayDynamicIndexing + VkBool32 shaderStorageImageArrayDynamicIndexing + VkBool32 shaderClipDistance + VkBool32 shaderCullDistance + VkBool32 shaderFloat64 + VkBool32 shaderInt64 + VkBool32 shaderInt16 + VkBool32 shaderResourceResidency + VkBool32 shaderResourceMinLod + VkBool32 sparseBinding + VkBool32 sparseResidencyBuffer + VkBool32 sparseResidencyImage2D + VkBool32 sparseResidencyImage3D + VkBool32 sparseResidency2Samples + VkBool32 sparseResidency4Samples + VkBool32 sparseResidency8Samples + VkBool32 sparseResidency16Samples + VkBool32 sparseResidencyAliased + VkBool32 variableMultisampleRate + VkBool32 inheritedQueries + + If the value of any member of this structure is ename:VK_FALSE, as returned by flink:vkGetPhysicalDeviceFeatures, then it must: be ename:VK_FALSE when passed as part of the sname:VkDeviceCreateInfo struct when creating a device + + + + VkBool32 residencyStandard2DBlockShape + VkBool32 residencyStandard2DMultisampleBlockShape + VkBool32 residencyStandard3DBlockShape + VkBool32 residencyAlignedMipSize + VkBool32 residencyNonResidentStrict + + + + uint32_t maxImageDimension1D + uint32_t maxImageDimension2D + uint32_t maxImageDimension3D + uint32_t maxImageDimensionCube + uint32_t maxImageArrayLayers + uint32_t maxTexelBufferElements + uint32_t maxUniformBufferRange + uint32_t maxStorageBufferRange + uint32_t maxPushConstantsSize + + uint32_t maxMemoryAllocationCount + uint32_t maxSamplerAllocationCount + VkDeviceSize bufferImageGranularity + VkDeviceSize sparseAddressSpaceSize + + uint32_t maxBoundDescriptorSets + uint32_t maxPerStageDescriptorSamplers + uint32_t maxPerStageDescriptorUniformBuffers + uint32_t maxPerStageDescriptorStorageBuffers + uint32_t maxPerStageDescriptorSampledImages + uint32_t maxPerStageDescriptorStorageImages + uint32_t maxPerStageDescriptorInputAttachments + uint32_t maxPerStageResources + uint32_t maxDescriptorSetSamplers + uint32_t maxDescriptorSetUniformBuffers + uint32_t maxDescriptorSetUniformBuffersDynamic + uint32_t maxDescriptorSetStorageBuffers + uint32_t maxDescriptorSetStorageBuffersDynamic + uint32_t maxDescriptorSetSampledImages + uint32_t maxDescriptorSetStorageImages + uint32_t maxDescriptorSetInputAttachments + + uint32_t maxVertexInputAttributes + uint32_t maxVertexInputBindings + uint32_t maxVertexInputAttributeOffset + uint32_t maxVertexInputBindingStride + uint32_t maxVertexOutputComponents + + uint32_t maxTessellationGenerationLevel + uint32_t maxTessellationPatchSize + uint32_t maxTessellationControlPerVertexInputComponents + uint32_t maxTessellationControlPerVertexOutputComponents + uint32_t maxTessellationControlPerPatchOutputComponents + uint32_t maxTessellationControlTotalOutputComponents + + uint32_t maxTessellationEvaluationInputComponents + uint32_t maxTessellationEvaluationOutputComponents + + uint32_t maxGeometryShaderInvocations + uint32_t maxGeometryInputComponents + uint32_t maxGeometryOutputComponents + uint32_t maxGeometryOutputVertices + uint32_t maxGeometryTotalOutputComponents + + uint32_t maxFragmentInputComponents + uint32_t maxFragmentOutputAttachments + uint32_t maxFragmentDualSrcAttachments + uint32_t maxFragmentCombinedOutputResources + + uint32_t maxComputeSharedMemorySize + uint32_t maxComputeWorkGroupCount[3] + uint32_t maxComputeWorkGroupInvocations + uint32_t maxComputeWorkGroupSize[3] + + uint32_t subPixelPrecisionBits + uint32_t subTexelPrecisionBits + uint32_t mipmapPrecisionBits + + uint32_t maxDrawIndexedIndexValue + uint32_t maxDrawIndirectCount + + float maxSamplerLodBias + float maxSamplerAnisotropy + + uint32_t maxViewports + uint32_t maxViewportDimensions[2] + float viewportBoundsRange[2] + uint32_t viewportSubPixelBits + + size_t minMemoryMapAlignment + VkDeviceSize minTexelBufferOffsetAlignment + VkDeviceSize minUniformBufferOffsetAlignment + VkDeviceSize minStorageBufferOffsetAlignment + + int32_t minTexelOffset + uint32_t maxTexelOffset + int32_t minTexelGatherOffset + uint32_t maxTexelGatherOffset + float minInterpolationOffset + float maxInterpolationOffset + uint32_t subPixelInterpolationOffsetBits + + uint32_t maxFramebufferWidth + uint32_t maxFramebufferHeight + uint32_t maxFramebufferLayers + VkSampleCountFlags framebufferColorSampleCounts + VkSampleCountFlags framebufferDepthSampleCounts + VkSampleCountFlags framebufferStencilSampleCounts + VkSampleCountFlags framebufferNoAttachmentsSampleCounts + uint32_t maxColorAttachments + + VkSampleCountFlags sampledImageColorSampleCounts + VkSampleCountFlags sampledImageIntegerSampleCounts + VkSampleCountFlags sampledImageDepthSampleCounts + VkSampleCountFlags sampledImageStencilSampleCounts + VkSampleCountFlags storageImageSampleCounts + uint32_t maxSampleMaskWords + + VkBool32 timestampComputeAndGraphics + float timestampPeriod + + uint32_t maxClipDistances + uint32_t maxCullDistances + uint32_t maxCombinedClipAndCullDistances + + uint32_t discreteQueuePriorities + + float pointSizeRange[2] + float lineWidthRange[2] + float pointSizeGranularity + float lineWidthGranularity + VkBool32 strictLines + VkBool32 standardSampleLocations + VkDeviceSize optimalBufferCopyOffsetAlignment + VkDeviceSize optimalBufferCopyRowPitchAlignment + VkDeviceSize nonCoherentAtomSize + + + VkStructureType sType + const void* pNext + VkSemaphoreCreateFlags flags + + + VkStructureType sType + const void* pNext + VkQueryPoolCreateFlags flags + VkQueryType queryType + uint32_t queryCount + VkQueryPipelineStatisticFlags pipelineStatistics + + If the <<features-features-pipelineStatisticsQuery,pipeline statistics queries>> feature is not enabled, pname:queryType mustnot: be ename:VK_QUERY_TYPE_PIPELINE_STATISTICS + If pname:queryType is ename:VK_QUERY_TYPE_PIPELINE_STATISTICS, pname:pipelineStatistics must: be a valid combination of elink:VkQueryPipelineStatisticFlagBits values + + + + VkStructureType sType + const void* pNext + VkFramebufferCreateFlags flags + VkRenderPass renderPass + uint32_t attachmentCount + const VkImageView* pAttachments + uint32_t width + uint32_t height + uint32_t layers + + The value of pname:attachmentCount must: be equal to the attachment count specified in pname:renderPass + Any given element of pname:pAttachments that is used as a color attachment or resolve attachment by pname:renderPass must: have been created with a pname:usage value including ename:VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT + Any given element of pname:pAttachments that is used as a depth/stencil attachment by pname:renderPass must: have been created with a pname:usage value including ename:VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT + Any given element of pname:pAttachments that is used as an input attachment by pname:renderPass must: have been created with a pname:usage value including ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT + Any given element of pname:pAttachments must: have been created with an elink:VkFormat value that matches the elink:VkFormat specified by the corresponding sname:VkAttachmentDescription in pname:renderPass + Any given element of pname:pAttachments must: have been created with a pname:samples value that matches the pname:samples value specified by the corresponding sname:VkAttachmentDescription in pname:renderPass + Any given element of pname:pAttachments must: have dimensions at least as large as the corresponding framebuffer dimension + Any given element of pname:pAttachments must: only specify a single mip-level + Any given element of pname:pAttachments must: have been created with identity swizzle + The value of pname:width must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxFramebufferWidth + The value of pname:height must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxFramebufferHeight + The value of pname:layers must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxFramebufferLayers + + + + uint32_t vertexCount + uint32_t instanceCount + uint32_t firstVertex + uint32_t firstInstance + + For a given vertex buffer binding, any attribute data fetched must: be entirely contained within the corresponding vertex buffer binding, as described in <<fxvertex-input>> + If the <<features-features-drawIndirectFirstInstance,drawIndirectFirstInstance>> feature is not enabled, pname:firstInstance must: be code:0 + + + + uint32_t indexCount + uint32_t instanceCount + uint32_t firstIndex + int32_t vertexOffset + uint32_t firstInstance + + For a given vertex buffer binding, any attribute data fetched must: be entirely contained within the corresponding vertex buffer binding, as described in <<fxvertex-input>> + The total value of (pname:indexSize * (pname:firstIndex + pname:indexCount) + pname:offset) must: be less than or equal to the size of the currently bound index buffer, with indexSize being based on the type specified by pname:indexType, where the index buffer, pname:indexType, and pname:offset are specified via fname:vkCmdBindIndexBuffer + If the <<features-features-drawIndirectFirstInstance,drawIndirectFirstInstance>> feature is not enabled, pname:firstInstance must: be code:0 + + + + uint32_t x + uint32_t y + uint32_t z + + pname:x must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupCount[0] + pname:y must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupCount[1] + pname:z must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupCount[2] + + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreCount + const VkSemaphore* pWaitSemaphores + const VkPipelineStageFlags* pWaitDstStageMask + uint32_t commandBufferCount + const VkCommandBuffer* pCommandBuffers + uint32_t signalSemaphoreCount + const VkSemaphore* pSignalSemaphores + + Any given element of pname:pSignalSemaphores must: currently be unsignalled + Any given element of pname:pCommandBuffers must: either have been recorded with the VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, or not currently be executing on the device + Any given element of pname:pCommandBuffers must: be in the executable state + If any given element of pname:pCommandBuffers contains commands that execute secondary command buffers, those secondary command buffers must: have been recorded with the ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, or not currently be executing on the device + If any given element of pname:pCommandBuffers was created with ename:VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, it mustnot: have been previously submitted without re-recording that command buffer + Any given element of pname:pCommandBuffers mustnot: contain commands that execute a secondary command buffer, if that secondary command buffer has been recorded in another primary command buffer after it was recorded into this sname:VkCommandBuffer + Any given element of pname:pCommandBuffers must: have been created on a sname:VkCommandPool that was created for the same queue family that the calling command's pname:queue belongs to + Any given element of pname:pCommandBuffers mustnot: have been created with ename:VK_COMMAND_BUFFER_LEVEL_SECONDARY + Any given element of sname:VkSemaphore in pname:pWaitSemaphores must: refer to a prior signal of that sname:VkSemaphore that won't be consumed by any other wait on that semaphore + If the <<features-features-geometryShader,geometry shaders>> feature is not enabled, any given element of pname:pWaitDstStageMask mustnot: contain pname:VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT + If the <<features-features-tessellationShader,tessellation shaders>> feature is not enabled, any given element of pname:pWaitDstStageMask mustnot: contain pname:VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or pname:VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT + + + + + VkDisplayKHR display + const char* displayName + VkExtent2D physicalDimensions + VkExtent2D physicalResolution + VkSurfaceTransformFlagsKHR supportedTransforms + VkBool32 planeReorderPossible + VkBool32 persistentContent + + + VkDisplayKHR currentDisplay + uint32_t currentStackIndex + + + VkExtent2D visibleRegion + uint32_t refreshRate + + + VkDisplayModeKHR displayMode + VkDisplayModeParametersKHR parameters + + + VkStructureType sType + const void* pNext + VkDisplayModeCreateFlagsKHR flags + VkDisplayModeParametersKHR parameters + + The pname:width and pname:height members of the pname:visibleRegion member of pname:parameters must be greater than `0` + The pname:refreshRate member of pname:parameters must be greater than `0` + + + + VkDisplayPlaneAlphaFlagsKHR supportedAlpha + VkOffset2D minSrcPosition + VkOffset2D maxSrcPosition + VkExtent2D minSrcExtent + VkExtent2D maxSrcExtent + VkOffset2D minDstPosition + VkOffset2D maxDstPosition + VkExtent2D minDstExtent + VkExtent2D maxDstExtent + + + VkStructureType sType + const void* pNext + VkDisplaySurfaceCreateFlagsKHR flags + VkDisplayModeKHR displayMode + uint32_t planeIndex + uint32_t planeStackIndex + VkSurfaceTransformFlagBitsKHR transform + float globalAlpha + VkDisplayPlaneAlphaFlagBitsKHR alphaMode + VkExtent2D imageExtent + + pname:planeIndex must: be less than the number of display planes supported by the device as determined by calling fname:vkGetPhysicalDeviceDisplayPlanePropertiesKHR + If the pname:planeReorderPossible member of the sname:VkDisplayPropertiesKHR structure returned by fname:vkGetPhysicalDeviceDisplayPropertiesKHR for the display corresponding to pname:displayMode is ename:VK_TRUE then pname:planeStackIndex must: be less than the number of display planes supported by the device as determined by calling fname:vkGetPhysicalDeviceDisplayPlanePropertiesKHR; otherwise pname:planeStackIndex must: equal the pname:currentStackIndex member of sname:VkDisplayPlanePropertiesKHR returned by fname:vkGetPhysicalDeviceDisplayPlanePropertiesKHR for the display plane corresponding to pname:displayMode + If pname:alphaMode is ename:VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR then pname:globalAlpha must: be between `0` and `1`, inclusive + pname:alphaMode must: be `0` or one of the bits present in the pname:supportedAlpha member of sname:VkDisplayPlaneCapabilitiesKHR returned by fname:vkGetDisplayPlaneCapabilitiesKHR for the display plane corresponding to pname:displayMode + The pname:width and pname:height members of pname:imageExtent must be greater than `0` + + + + VkStructureType sType + const void* pNext + VkRect2D srcRect + VkRect2D dstRect + VkBool32 persistent + + pname:srcRect must: specify a rectangular region that is a subset of the image being presented + pname:dstRect must: specify a rectangular region that is a subset of the pname:visibleRegion parameter of the display mode the swapchain being presented uses + If the pname:persistentContent member of the sname:VkDisplayPropertiesKHR structure returned by fname:vkGetPhysicalDeviceDisplayPropertiesKHR for the display the present operation targets then pname:persistent must: be ename:VK_FALSE + + + + uint32_t minImageCount + uint32_t maxImageCount + VkExtent2D currentExtent + VkExtent2D minImageExtent + VkExtent2D maxImageExtent + uint32_t maxImageArrayLayers + VkSurfaceTransformFlagsKHR supportedTransforms + VkSurfaceTransformFlagBitsKHR currentTransform + VkCompositeAlphaFlagsKHR supportedCompositeAlpha + VkImageUsageFlags supportedUsageFlags + + + VkStructureType sType + const void* pNext + VkAndroidSurfaceCreateFlagsKHR flags + ANativeWindow* window + + pname:window mustnot: be in a connected state + + + + VkStructureType sType + const void* pNext + VkMirSurfaceCreateFlagsKHR flags + MirConnection* connection + MirSurface* mirSurface + + + VkStructureType sType + const void* pNext + VkWaylandSurfaceCreateFlagsKHR flags + struct wl_display* display + struct wl_surface* surface + + + VkStructureType sType + const void* pNext + VkWin32SurfaceCreateFlagsKHR flags + HINSTANCE hinstance + HWND hwnd + + + VkStructureType sType + const void* pNext + VkXlibSurfaceCreateFlagsKHR flags + Display* dpy + Window window + + + VkStructureType sType + const void* pNext + VkXcbSurfaceCreateFlagsKHR flags + xcb_connection_t* connection + xcb_window_t window + + + VkFormat format + VkColorSpaceKHR colorSpace + + + VkStructureType sType + const void* pNext + VkSwapchainCreateFlagsKHR flags + VkSurfaceKHR surface + uint32_t minImageCount + VkFormat imageFormat + VkColorSpaceKHR imageColorSpace + VkExtent2D imageExtent + uint32_t imageArrayLayers + VkImageUsageFlags imageUsage + VkSharingMode imageSharingMode + uint32_t queueFamilyIndexCount + const uint32_t* pQueueFamilyIndices + VkSurfaceTransformFlagBitsKHR preTransform + VkCompositeAlphaFlagBitsKHR compositeAlpha + VkPresentModeKHR presentMode + VkBool32 clipped + VkSwapchainKHR oldSwapchain + + pname:surface must: be a surface that is supported by the device as determined using fname:vkGetPhysicalDeviceSurfaceSupportKHR + pname:minImageCount must: be greater than or equal to the value returned in the pname:minImageCount member of the sname:VkSurfaceCapabilitiesKHR structure returned by fname:vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface + pname:minImageCount must: be less than or equal to the value returned in the pname:maxImageCount member of the sname:VkSurfaceCapabilitiesKHR structure returned by fname:vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface if the returned value of pname:maxImageCount is not zero + pname:imageFormat and pname:imageColorspace must: match the pname:format and pname:colorSpace members, respectively, of one of the sname:VkSurfaceFormatKHR structures returned by fname:vkGetPhysicalDeviceSurfaceFormatsKHR for the surface + pname:imageExtent must: be between pname:minImageExtent and pname:maxImageExtent, inclusive, where pname:minImageExtent and pname:maxImageExtent are members of the sname:VkSurfaceCapabilitiesKHR structure returned by fname:vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface + pname:imageArrayLayers must: be greater than `0` and less than or equal to the pname:maxImageArrayLayers member of the sname:VkSurfaceCapabilitiesKHR structure returned by fname:vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface + pname:imageUsage must: be a subset of the supported usage flags present in the pname:supportedUsageFlags member of the sname:VkSurfaceCapabilitiesKHR structure returned by fname:vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface + If pname:imageSharingMode is ename:VK_SHARING_MODE_CONCURRENT, pname:pQueueFamilyIndices must: be a pointer to an array of pname:queueFamilyIndexCount basetype:uint32_t values + If pname:imageSharingMode is ename:VK_SHARING_MODE_CONCURRENT, pname:queueFamilyIndexCount must: be greater than `1` + pname:preTransform must: be one of the bits present in the pname:supportedTransforms member of the sname:VkSurfaceCapabilitiesKHR structure returned by fname:vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface + pname:compositeAlpha must: be one of the bits present in the pname:supportedCompositeAlpha member of the sname:VkSurfaceCapabilitiesKHR structure returned by fname:vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface + pname:presentMode must: be one of the ename:VkPresentModeKHR values returned by fname:vkGetPhysicalDeviceSurfacePresentModesKHR for the surface + + + + VkStructureType sType + const void* pNext + uint32_t waitSemaphoreCount + const VkSemaphore* pWaitSemaphores + uint32_t swapchainCount + const VkSwapchainKHR* pSwapchains + const uint32_t* pImageIndices + VkResult* pResults + + Any given element of pname:pImageIndices must: be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pname:pSwapchains array that is owned by the application + Any given element of sname:VkSemaphore in pname:pWaitSemaphores must: refer to a prior signal of that sname:VkSemaphore that won't be consumed by any other wait on that semaphore + + + + VkStructureType sType + const void* pNext + VkDebugReportFlagsEXT flags + PFN_vkDebugReportCallbackEXT pfnCallback + void* pUserData + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VkResult vkCreateInstance + const VkInstanceCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkInstance* pInstance + + + void vkDestroyInstance + VkInstance instance + const VkAllocationCallbacks* pAllocator + + All child objects created using pname:instance must: have been destroyed prior to destroying pname:instance + If sname:VkAllocationCallbacks were provided when pname:instance was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:instance was created, pname:pAllocator must: be `NULL` + + + + VkResult vkEnumeratePhysicalDevices + VkInstance instance + uint32_t* pPhysicalDeviceCount + VkPhysicalDevice* pPhysicalDevices + + + PFN_vkVoidFunction vkGetDeviceProcAddr + VkDevice device + const char* pName + + pname:pName must: be the name of a supported command that has a first parameter of type sname:VkDevice, sname:VkQueue or sname:VkCommandBuffer, either in the core API or an enabled extension + + + + PFN_vkVoidFunction vkGetInstanceProcAddr + VkInstance instance + const char* pName + + If pname:instance is `NULL`, pname:pName must: be one of: fname:vkEnumerateInstanceExtensionProperties, fname:vkEnumerateInstanceLayerProperties or fname:vkCreateInstance + If pname:instance is not `NULL`, pname:pName must: be the name of a core command or a command from an enabled extension, other than: fname:vkEnumerateInstanceExtensionProperties, fname:vkEnumerateInstanceLayerProperties or fname:vkCreateInstance + + + + void vkGetPhysicalDeviceProperties + VkPhysicalDevice physicalDevice + VkPhysicalDeviceProperties* pProperties + + + void vkGetPhysicalDeviceQueueFamilyProperties + VkPhysicalDevice physicalDevice + uint32_t* pQueueFamilyPropertyCount + VkQueueFamilyProperties* pQueueFamilyProperties + + + void vkGetPhysicalDeviceMemoryProperties + VkPhysicalDevice physicalDevice + VkPhysicalDeviceMemoryProperties* pMemoryProperties + + + void vkGetPhysicalDeviceFeatures + VkPhysicalDevice physicalDevice + VkPhysicalDeviceFeatures* pFeatures + + + void vkGetPhysicalDeviceFormatProperties + VkPhysicalDevice physicalDevice + VkFormat format + VkFormatProperties* pFormatProperties + + + VkResult vkGetPhysicalDeviceImageFormatProperties + VkPhysicalDevice physicalDevice + VkFormat format + VkImageType type + VkImageTiling tiling + VkImageUsageFlags usage + VkImageCreateFlags flags + VkImageFormatProperties* pImageFormatProperties + + + VkResult vkCreateDevice + VkPhysicalDevice physicalDevice + const VkDeviceCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDevice* pDevice + + + void vkDestroyDevice + VkDevice device + const VkAllocationCallbacks* pAllocator + + All child objects created on pname:device must: have been destroyed prior to destroying pname:device + If sname:VkAllocationCallbacks were provided when pname:device was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:device was created, pname:pAllocator must: be `NULL` + + + + VkResult vkEnumerateInstanceLayerProperties + uint32_t* pPropertyCount + VkLayerProperties* pProperties + + + VkResult vkEnumerateInstanceExtensionProperties + const char* pLayerName + uint32_t* pPropertyCount + VkExtensionProperties* pProperties + + If pname:pLayerName is not `NULL`, it must: be the name of a layer available on the system + + + + VkResult vkEnumerateDeviceLayerProperties + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkLayerProperties* pProperties + + + VkResult vkEnumerateDeviceExtensionProperties + VkPhysicalDevice physicalDevice + const char* pLayerName + uint32_t* pPropertyCount + VkExtensionProperties* pProperties + + If pname:pLayerName is not `NULL`, it must: be the name of a layer available on the system + + + + void vkGetDeviceQueue + VkDevice device + uint32_t queueFamilyIndex + uint32_t queueIndex + VkQueue* pQueue + + pname:queueFamilyIndex must: be one of the queue family indexes specified when pname:device was created, via the sname:VkDeviceQueueCreateInfo structure + pname:queueIndex must: be less than the number of queues created for the specified queue family index when pname:device was created, via the pname:queueCount member of the sname:VkDeviceQueueCreateInfo structure + + + + VkResult vkQueueSubmit + VkQueue queue + uint32_t submitCount + const VkSubmitInfo* pSubmits + VkFence fence + + pname:fence must: be unsignalled + pname:fence mustnot: be associated with any other queue command that has not yet completed execution on that queue + + + + VkResult vkQueueWaitIdle + VkQueue queue + + + VkResult vkDeviceWaitIdle + VkDevice device + + all sname:VkQueue objects created from pname:device + + + + VkResult vkAllocateMemory + VkDevice device + const VkMemoryAllocateInfo* pAllocateInfo + const VkAllocationCallbacks* pAllocator + VkDeviceMemory* pMemory + + The number of currently valid memory objects, allocated from pname:device, must: be less than sname:VkPhysicalDeviceLimits::pname:maxMemoryAllocationCount + + + + void vkFreeMemory + VkDevice device + VkDeviceMemory memory + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:memory (via images or buffers) must: have completed execution + + + + VkResult vkMapMemory + VkDevice device + VkDeviceMemory memory + VkDeviceSize offset + VkDeviceSize size + VkMemoryMapFlags flags + void** ppData + + pname:memory mustnot: currently be mapped + pname:offset must: be less than the size of pname:memory + If pname:size is not equal to ename:VK_WHOLE_SIZE, the sum of pname:offset and pname:size must: be less than or equal to the pname:size of the pname:memory + pname:memory must: have been created with a memory type that reports ename:VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT + + + + void vkUnmapMemory + VkDevice device + VkDeviceMemory memory + + pname:memory must: currently be mapped + + + + VkResult vkFlushMappedMemoryRanges + VkDevice device + uint32_t memoryRangeCount + const VkMappedMemoryRange* pMemoryRanges + + The memory ranges specified by pname:pMemoryRanges must: all currently be mapped + + + + VkResult vkInvalidateMappedMemoryRanges + VkDevice device + uint32_t memoryRangeCount + const VkMappedMemoryRange* pMemoryRanges + + The memory ranges specified by pname:pMemoryRanges must: all currently be mapped + + + + void vkGetDeviceMemoryCommitment + VkDevice device + VkDeviceMemory memory + VkDeviceSize* pCommittedMemoryInBytes + + pname:memory must: have been created with a memory type that reports ename:VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT + + + + void vkGetBufferMemoryRequirements + VkDevice device + VkBuffer buffer + VkMemoryRequirements* pMemoryRequirements + + + VkResult vkBindBufferMemory + VkDevice device + VkBuffer buffer + VkDeviceMemory memory + VkDeviceSize memoryOffset + + pname:buffer mustnot: already be backed by a memory object + pname:buffer mustnot: have been created with any sparse memory binding flags + pname:memoryOffset must: be less than the size of pname:memory + If pname:buffer was created with the ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, pname:memoryOffset must: be a multiple of the value of sname:VkPhysicalDeviceLimits::pname:minTexelBufferOffsetAlignment + If pname:buffer was created with the ename:VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, pname:memoryOffset must: be a multiple of the value of sname:VkPhysicalDeviceLimits::pname:minUniformBufferOffsetAlignment + If pname:buffer was created with the ename:VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, pname:memoryOffset must: be a multiple of the value of sname:VkPhysicalDeviceLimits::pname:minStorageBufferOffsetAlignment + pname:memory must: have been allocated using one of the memory types allowed in the pname:memoryTypeBits member of the sname:VkMemoryRequirements structure returned from a call to fname:vkGetBufferMemoryRequirements with pname:buffer + The sum of pname:memoryOffset and the size of pname:buffer must: be less than or equal to the size of pname:memory + pname:memoryOffset must: be an integer multiple of the pname:alignment member of the sname:VkMemoryRequirements structure returned from a call to fname:vkGetBufferMemoryRequirements with pname:buffer + + + + void vkGetImageMemoryRequirements + VkDevice device + VkImage image + VkMemoryRequirements* pMemoryRequirements + + + VkResult vkBindImageMemory + VkDevice device + VkImage image + VkDeviceMemory memory + VkDeviceSize memoryOffset + + pname:image mustnot: already be backed by a memory object + pname:image mustnot: have been created with any sparse memory binding flags + pname:memoryOffset must: be less than the size of pname:memory + pname:memory must: have been allocated using one of the memory types allowed in the pname:memoryTypeBits member of the sname:VkMemoryRequirements structure returned from a call to fname:vkGetImageMemoryRequirements with pname:image + pname:memoryOffset must: be an integer multiple of the pname:alignment member of the sname:VkMemoryRequirements structure returned from a call to fname:vkGetImageMemoryRequirements with pname:image + pname:memory must: have storage from pname:memoryOffset onwards equal to or greater than the pname:size member of the sname:VkMemoryRequirements structure returned from a call to fname:vkGetImageMemoryRequirements with pname:image + + + + void vkGetImageSparseMemoryRequirements + VkDevice device + VkImage image + uint32_t* pSparseMemoryRequirementCount + VkSparseImageMemoryRequirements* pSparseMemoryRequirements + + pname:image must: have been created with the ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT flag + + + + void vkGetPhysicalDeviceSparseImageFormatProperties + VkPhysicalDevice physicalDevice + VkFormat format + VkImageType type + VkSampleCountFlagBits samples + VkImageUsageFlags usage + VkImageTiling tiling + uint32_t* pPropertyCount + VkSparseImageFormatProperties* pProperties + + If pname:format is an integer format, samples must: be one of the bit flag values specified in the value of sname:VkPhysicalDeviceLimits::pname:sampledImageIntegerSampleCounts + If pname:format is a non-integer color format, samples must: be one of the bit flag values specified in the value of sname:VkPhysicalDeviceLimits::pname:sampledImageColorSampleCounts + If pname:format is a depth format, samples must: be one of the bit flag values specified in the value of sname:VkPhysicalDeviceLimits::pname:sampledImageDepthSampleCounts + If pname:format is a stencil format, samples must: be one of the bit flag values specified in the value of sname:VkPhysicalDeviceLimits::pname:sampledImageStencilSampleCounts + If pname:usage includes ename:VK_IMAGE_USAGE_STORAGE_BIT, samples must: be one of the bit flag values specified in the value of sname:VkPhysicalDeviceLimits::pname:storageImageSampleCounts + + + + VkResult vkQueueBindSparse + VkQueue queue + uint32_t bindInfoCount + const VkBindSparseInfo* pBindInfo + VkFence fence + + pname:fence must: be unsignalled + pname:fence mustnot: be associated with any other queue command that has not yet completed execution on that queue + + + + VkResult vkCreateFence + VkDevice device + const VkFenceCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkFence* pFence + + + void vkDestroyFence + VkDevice device + VkFence fence + const VkAllocationCallbacks* pAllocator + + pname:fence mustnot: be associated with any queue command that has not yet completed execution on that queue + If sname:VkAllocationCallbacks were provided when pname:fence was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:fence was created, pname:pAllocator must: be `NULL` + + + + VkResult vkResetFences + VkDevice device + uint32_t fenceCount + const VkFence* pFences + + Any given element of pname:pFences mustnot: currently be associated with any queue command that has not yet completed execution on that queue + + + + VkResult vkGetFenceStatus + VkDevice device + VkFence fence + + + VkResult vkWaitForFences + VkDevice device + uint32_t fenceCount + const VkFence* pFences + VkBool32 waitAll + uint64_t timeout + + + VkResult vkCreateSemaphore + VkDevice device + const VkSemaphoreCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSemaphore* pSemaphore + + + void vkDestroySemaphore + VkDevice device + VkSemaphore semaphore + const VkAllocationCallbacks* pAllocator + + pname:semaphore mustnot: be associated with any queue command that has not yet completed execution on that queue + If sname:VkAllocationCallbacks were provided when pname:semaphore was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:semaphore was created, pname:pAllocator must: be `NULL` + + + + VkResult vkCreateEvent + VkDevice device + const VkEventCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkEvent* pEvent + + + void vkDestroyEvent + VkDevice device + VkEvent event + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:event must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:event was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:event was created, pname:pAllocator must: be `NULL` + + + + VkResult vkGetEventStatus + VkDevice device + VkEvent event + + + VkResult vkSetEvent + VkDevice device + VkEvent event + + + VkResult vkResetEvent + VkDevice device + VkEvent event + + + VkResult vkCreateQueryPool + VkDevice device + const VkQueryPoolCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkQueryPool* pQueryPool + + + void vkDestroyQueryPool + VkDevice device + VkQueryPool queryPool + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:queryPool must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:queryPool was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:queryPool was created, pname:pAllocator must: be `NULL` + + + + VkResult vkGetQueryPoolResults + VkDevice device + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + size_t dataSize + void* pData + VkDeviceSize stride + VkQueryResultFlags flags + + pname:firstQuery must: be less than the number of queries in pname:queryPool + If ename:VK_QUERY_RESULT_64_BIT is not set in pname:flags then pname:pData and pname:stride must be multiples of `4` + If ename:VK_QUERY_RESULT_64_BIT is set in pname:flags then pname:pData and pname:stride must be multiples of `8` + The sum of pname:firstQuery and pname:queryCount must: be less than or equal to the number of queries in pname:queryPool + pname:dataSize must: be large enough to contain the result of each query, as described <<queries-operation-memorylayout,here>> + If the pname:queryType used to create pname:queryPool was ename:VK_QUERY_TYPE_TIMESTAMP, pname:flags mustnot: contain ename:VK_QUERY_RESULT_PARTIAL_BIT + + + + VkResult vkCreateBuffer + VkDevice device + const VkBufferCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkBuffer* pBuffer + + If the pname:flags member of pname:pCreateInfo includes ename:VK_BUFFER_CREATE_SPARSE_BINDING_BIT or ename:VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, creating this sname:VkBuffer mustnot: cause the total required sparse memory for all currently valid sparse resources on the device to exceed sname:VkPhysicalDeviceLimits::pname:sparseAddressSpaceSize + + + + void vkDestroyBuffer + VkDevice device + VkBuffer buffer + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:buffer, either directly or via a sname:VkBufferView, must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:buffer was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:buffer was created, pname:pAllocator must: be `NULL` + + + + VkResult vkCreateBufferView + VkDevice device + const VkBufferViewCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkBufferView* pView + + + void vkDestroyBufferView + VkDevice device + VkBufferView bufferView + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:bufferView must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:bufferView was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:bufferView was created, pname:pAllocator must: be `NULL` + + + + VkResult vkCreateImage + VkDevice device + const VkImageCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkImage* pImage + + If the pname:flags member of pname:pCreateInfo includes ename:VK_IMAGE_CREATE_SPARSE_BINDING_BIT or ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, creating this sname:VkImage mustnot: cause the total required sparse memory for all currently valid sparse resources on the device to exceed sname:VkPhysicalDeviceLimits::pname:sparseAddressSpaceSize + + + + void vkDestroyImage + VkDevice device + VkImage image + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:image, either directly or via a sname:VkImageView, must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:image was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:image was created, pname:pAllocator must: be `NULL` + + + + void vkGetImageSubresourceLayout + VkDevice device + VkImage image + const VkImageSubresource* pSubresource + VkSubresourceLayout* pLayout + + pname:image must: have been created with pname:tiling equal to ename:VK_IMAGE_TILING_LINEAR + The pname:aspectMask member of pname:pSubresource must: only have a single bit set + + + + VkResult vkCreateImageView + VkDevice device + const VkImageViewCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkImageView* pView + + + void vkDestroyImageView + VkDevice device + VkImageView imageView + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:imageView must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:imageView was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:imageView was created, pname:pAllocator must: be `NULL` + + + + VkResult vkCreateShaderModule + VkDevice device + const VkShaderModuleCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkShaderModule* pShaderModule + + + void vkDestroyShaderModule + VkDevice device + VkShaderModule shaderModule + const VkAllocationCallbacks* pAllocator + + If sname:VkAllocationCallbacks were provided when pname:shaderModule was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:shaderModule was created, pname:pAllocator must: be `NULL` + + + + VkResult vkCreatePipelineCache + VkDevice device + const VkPipelineCacheCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkPipelineCache* pPipelineCache + + + void vkDestroyPipelineCache + VkDevice device + VkPipelineCache pipelineCache + const VkAllocationCallbacks* pAllocator + + If sname:VkAllocationCallbacks were provided when pname:pipelineCache was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:pipelineCache was created, pname:pAllocator must: be `NULL` + + + + VkResult vkGetPipelineCacheData + VkDevice device + VkPipelineCache pipelineCache + size_t* pDataSize + void* pData + + + VkResult vkMergePipelineCaches + VkDevice device + VkPipelineCache dstCache + uint32_t srcCacheCount + const VkPipelineCache* pSrcCaches + + pname:dstCache mustnot: appear in the list of source caches + + + + VkResult vkCreateGraphicsPipelines + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkGraphicsPipelineCreateInfo* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + If the value of the pname:flags member of any given element of pname:pCreateInfos contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and the pname:basePipelineIndex member of that same element is not `-1`, the value of pname:basePipelineIndex must: be less than the index into pname:pCreateInfos that corresponds to that element + + + + VkResult vkCreateComputePipelines + VkDevice device + VkPipelineCache pipelineCache + uint32_t createInfoCount + const VkComputePipelineCreateInfo* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkPipeline* pPipelines + + If the value of the pname:flags member of any given element of pname:pCreateInfos contains the ename:VK_PIPELINE_CREATE_DERIVATIVE_BIT flag, and the pname:basePipelineIndex member of that same element is not `-1`, the value of pname:basePipelineIndex must: be less than the index into pname:pCreateInfos that corresponds to that element + + + + void vkDestroyPipeline + VkDevice device + VkPipeline pipeline + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:pipeline must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:pipeline was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:pipeline was created, pname:pAllocator must: be `NULL` + + + + VkResult vkCreatePipelineLayout + VkDevice device + const VkPipelineLayoutCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkPipelineLayout* pPipelineLayout + + + void vkDestroyPipelineLayout + VkDevice device + VkPipelineLayout pipelineLayout + const VkAllocationCallbacks* pAllocator + + If sname:VkAllocationCallbacks were provided when pname:pipelineLayout was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:pipelineLayout was created, pname:pAllocator must: be `NULL` + + + + VkResult vkCreateSampler + VkDevice device + const VkSamplerCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSampler* pSampler + + + void vkDestroySampler + VkDevice device + VkSampler sampler + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:sampler must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:sampler was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:sampler was created, pname:pAllocator must: be `NULL` + + + + VkResult vkCreateDescriptorSetLayout + VkDevice device + const VkDescriptorSetLayoutCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDescriptorSetLayout* pSetLayout + + + void vkDestroyDescriptorSetLayout + VkDevice device + VkDescriptorSetLayout descriptorSetLayout + const VkAllocationCallbacks* pAllocator + + If sname:VkAllocationCallbacks were provided when pname:descriptorSetLayout was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:descriptorSetLayout was created, pname:pAllocator must: be `NULL` + + + + VkResult vkCreateDescriptorPool + VkDevice device + const VkDescriptorPoolCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDescriptorPool* pDescriptorPool + + + void vkDestroyDescriptorPool + VkDevice device + VkDescriptorPool descriptorPool + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:descriptorPool (via any allocated descriptor sets) must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:descriptorPool was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:descriptorPool was created, pname:pAllocator must: be `NULL` + + + + VkResult vkResetDescriptorPool + VkDevice device + VkDescriptorPool descriptorPool + VkDescriptorPoolResetFlags flags + + any sname:VkDescriptorSet objects allocated from pname:descriptorPool + + + All uses of pname:descriptorPool (via any allocated descriptor sets) must: have completed execution + + + + VkResult vkAllocateDescriptorSets + VkDevice device + const VkDescriptorSetAllocateInfo* pAllocateInfo + VkDescriptorSet* pDescriptorSets + + + VkResult vkFreeDescriptorSets + VkDevice device + VkDescriptorPool descriptorPool + uint32_t descriptorSetCount + const VkDescriptorSet* pDescriptorSets + + All submitted commands that refer to any element of pname:pDesciptorSets must: have completed execution + pname:pDescriptorSets must: be a pointer to an array of pname:descriptorSetCount sname:VkDescriptorSet handles, each element of which must: either be a valid handle or sname:VK_NULL_HANDLE + pname:descriptorPool must: have been created with the ename:VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT flag + + + + void vkUpdateDescriptorSets + VkDevice device + uint32_t descriptorWriteCount + const VkWriteDescriptorSet* pDescriptorWrites + uint32_t descriptorCopyCount + const VkCopyDescriptorSet* pDescriptorCopies + + + VkResult vkCreateFramebuffer + VkDevice device + const VkFramebufferCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkFramebuffer* pFramebuffer + + + void vkDestroyFramebuffer + VkDevice device + VkFramebuffer framebuffer + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:framebuffer must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:framebuffer was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:framebuffer was created, pname:pAllocator must: be `NULL` + + + + VkResult vkCreateRenderPass + VkDevice device + const VkRenderPassCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkRenderPass* pRenderPass + + + void vkDestroyRenderPass + VkDevice device + VkRenderPass renderPass + const VkAllocationCallbacks* pAllocator + + All submitted commands that refer to pname:renderPass must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:renderPass was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:renderPass was created, pname:pAllocator must: be `NULL` + + + + void vkGetRenderAreaGranularity + VkDevice device + VkRenderPass renderPass + VkExtent2D* pGranularity + + + VkResult vkCreateCommandPool + VkDevice device + const VkCommandPoolCreateInfo* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkCommandPool* pCommandPool + + + void vkDestroyCommandPool + VkDevice device + VkCommandPool commandPool + const VkAllocationCallbacks* pAllocator + + All sname:VkCommandBuffer objects allocated from pname:commandPool mustnot: be pending execution + If sname:VkAllocationCallbacks were provided when pname:commandPool was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:commandPool was created, pname:pAllocator must: be `NULL` + + + + VkResult vkResetCommandPool + VkDevice device + VkCommandPool commandPool + VkCommandPoolResetFlags flags + + All sname:VkCommandBuffer objects allocated from pname:commandPool mustnot: currently be pending execution + + + + VkResult vkAllocateCommandBuffers + VkDevice device + const VkCommandBufferAllocateInfo* pAllocateInfo + VkCommandBuffer* pCommandBuffers + + + void vkFreeCommandBuffers + VkDevice device + VkCommandPool commandPool + uint32_t commandBufferCount + const VkCommandBuffer* pCommandBuffers + + All elements of pname:pCommandBuffers mustnot: be pending execution + pname:pCommandBuffers must: be a pointer to an array of pname:commandBufferCount sname:VkCommandBuffer handles, each element of which must: either be a valid handle or sname:VK_NULL_HANDLE + + + + VkResult vkBeginCommandBuffer + VkCommandBuffer commandBuffer + const VkCommandBufferBeginInfo* pBeginInfo + + pname:commandBuffer mustnot: be in the recording state + If pname:commandBuffer was allocated from a sname:VkCommandPool which did not have the ename:VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT flag set, pname:commandBuffer must: be in the initial state. + If pname:commandBuffer is a secondary command buffer, the pname:pInheritanceInfo member of pname:pBeginInfo must: be a valid sname:VkCommandBufferInheritanceInfo structure + If pname:commandBuffer is a secondary command buffer and either the pname:occlusionQueryEnable member of the pname:pInheritanceInfo member of pname:pBeginInfo is ename:VK_FALSE, or the precise occlusion queries feature is not enabled, the pname:queryFlags member of the pname:pInheritanceInfo member pname:pBeginInfo mustnot: contain ename:VK_QUERY_CONTROL_PRECISE_BIT + + + + + VkResult vkEndCommandBuffer + VkCommandBuffer commandBuffer + + pname:commandBuffer must: be in the recording state + fname:vkEndCommandBuffer mustnot: be called inside a render pass instance + All queries made <<queries-operation-active,active>> during the recording of pname:commandBuffer must: have been made inactive + + + + VkResult vkResetCommandBuffer + VkCommandBuffer commandBuffer + VkCommandBufferResetFlags flags + + pname:commandBuffer mustnot: currently be pending execution + pname:commandBuffer must: have been allocated from a pool that was created with the ename:VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT + + + + void vkCmdBindPipeline + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipeline pipeline + + If the value of pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_COMPUTE, the sname:VkCommandPool that pname:commandBuffer was allocated from must: support compute operations + If the value of pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_GRAPHICS, the sname:VkCommandPool that pname:commandBuffer was allocated from must: support graphics operations + If the value of pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_COMPUTE, pname:pipeline must: be a compute pipeline + If the value of pname:pipelineBindPoint is ename:VK_PIPELINE_BIND_POINT_GRAPHICS, pname:pipeline must: be a graphics pipeline + If the <<features-features-variableMultisampleRate,variable multisample rate>> feature is not supported, pname:pipeline is a graphics pipeline, the current subpass has no attachments, and this is not the first call to this function with a graphics pipeline after transitioning to the current subpass, then the sample count specified by this pipeline must: match that set in the previous pipeline + + + + void vkCmdSetViewport + VkCommandBuffer commandBuffer + uint32_t firstViewport + uint32_t viewportCount + const VkViewport* pViewports + + pname:firstViewport must: be less than sname:VkPhysicalDeviceLimits::pname:maxViewports + The sum of pname:firstViewport and pname:viewportCount must: be between `1` and sname:VkPhysicalDeviceLimits::pname:maxViewports, inclusive + + + + void vkCmdSetScissor + VkCommandBuffer commandBuffer + uint32_t firstScissor + uint32_t scissorCount + const VkRect2D* pScissors + + pname:firstScissor must: be less than sname:VkPhysicalDeviceLimits::pname:maxViewports + The sum of pname:firstScissor and pname:scissorCount must: be between `1` and sname:VkPhysicalDeviceLimits::pname:maxViewports, inclusive + The pname:x and pname:y members of pname:offset must: be greater than or equal to `0` + Evaluation of (pname:offset.x + pname:extent.width) mustnot: cause a signed integer addition overflow + Evaluation of (pname:offset.y + pname:extent.height) mustnot: cause a signed integer addition overflow + + + + void vkCmdSetLineWidth + VkCommandBuffer commandBuffer + float lineWidth + + If the <<features-features-wideLines,wide lines>> feature is not enabled, the value of pname:lineWidth must: be `1.0` + + + + void vkCmdSetDepthBias + VkCommandBuffer commandBuffer + float depthBiasConstantFactor + float depthBiasClamp + float depthBiasSlopeFactor + + If the <<features-features-depthBiasClamp,depth bias clamping>> feature is not enabled, the value of pname:depthBiasClamp must: be code:0.0 + + + + void vkCmdSetBlendConstants + VkCommandBuffer commandBuffer + const float blendConstants[4] + + + void vkCmdSetDepthBounds + VkCommandBuffer commandBuffer + float minDepthBounds + float maxDepthBounds + + The value of pname:minDepthBounds must: be between `0.0` and `1.0`, inclusive + The value of pname:maxDepthBounds must: be between `0.0` and `1.0`, inclusive + + + + void vkCmdSetStencilCompareMask + VkCommandBuffer commandBuffer + VkStencilFaceFlags faceMask + uint32_t compareMask + + + void vkCmdSetStencilWriteMask + VkCommandBuffer commandBuffer + VkStencilFaceFlags faceMask + uint32_t writeMask + + + void vkCmdSetStencilReference + VkCommandBuffer commandBuffer + VkStencilFaceFlags faceMask + uint32_t reference + + + void vkCmdBindDescriptorSets + VkCommandBuffer commandBuffer + VkPipelineBindPoint pipelineBindPoint + VkPipelineLayout layout + uint32_t firstSet + uint32_t descriptorSetCount + const VkDescriptorSet* pDescriptorSets + uint32_t dynamicOffsetCount + const uint32_t* pDynamicOffsets + + Any given element of pname:pDescriptorSets must: have been created with a sname:VkDescriptorSetLayout that matches the sname:VkDescriptorSetLayout at set _n_ in pname:layout, where _n_ is the sum of the index into pname:pDescriptorSets and pname:firstSet + pname:dynamicOffsetCount must: be equal to the total number of dynamic descriptors in pname:pDescriptorSets + pname:pipelineBindPoint must: be supported by the pname:commandBuffer's parent sname:VkCommandPool's queue family + Any given element of pname:pDynamicOffsets must: satisfy the required alignment for the corresponding descriptor binding's descriptor type + + + + void vkCmdBindIndexBuffer + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + VkIndexType indexType + + The value of pname:offset must: be less than the size of pname:buffer + The sum of pname:offset, and the address of the range of sname:VkDeviceMemory object that's backing pname:buffer, must: be a multiple of the type indicated by pname:indexType + pname:buffer must: have been created with the ename:VK_BUFFER_USAGE_INDEX_BUFFER_BIT flag + + + + void vkCmdBindVertexBuffers + VkCommandBuffer commandBuffer + uint32_t firstBinding + uint32_t bindingCount + const VkBuffer* pBuffers + const VkDeviceSize* pOffsets + + pname:firstBinding must: be less than sname:VkPhysicalDeviceLimits::pname:maxVertexInputBindings + The sum of pname:firstBinding and pname:bindingCount must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxVertexInputBindings + All elements of pname:pOffsets must: be less than the size of the corresponding element in pname:pBuffers + All elements of pname:pBuffers must: have been created with the ename:VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag + + + + void vkCmdDraw + VkCommandBuffer commandBuffer + uint32_t vertexCount + uint32_t instanceCount + uint32_t firstVertex + uint32_t firstInstance + + For each set _n_ that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must: have been bound to _n_ at ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for set _n_, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + For each push constant that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must: have been set for ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for push constants, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + Descriptors in each bound descriptor set, specified via fname:vkCmdBindDescriptorSets, must: be valid if they are statically used by the currently bound sname:VkPipeline object, specified via fname:vkCmdBindPipeline + All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must: have valid buffers bound + For a given vertex buffer binding, any attribute data fetched must: be entirely contained within the corresponding vertex buffer binding, as described in <<fxvertex-input>> + A valid graphics pipeline must: be bound to the current command buffer with ename:VK_PIPELINE_BIND_POINT_GRAPHICS + If the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must: have been set on the current command buffer + Every input attachment used by the current subpass must: be bound to the pipeline via a descriptor set + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used to sample from any sname:VkImage with a sname:VkImageView of the type ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, ename:VK_IMAGE_VIEW_TYPE_1D_ARRAY, ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions with "ImplicitLod", "Dref" or "Proj" in their name, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions that includes a lod bias or any offset values, in any shader stage + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + + + + void vkCmdDrawIndexed + VkCommandBuffer commandBuffer + uint32_t indexCount + uint32_t instanceCount + uint32_t firstIndex + int32_t vertexOffset + uint32_t firstInstance + + For each set _n_ that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must: have been bound to _n_ at ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for set _n_, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + For each push constant that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must: have been set for ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for push constants, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + Descriptors in each bound descriptor set, specified via fname:vkCmdBindDescriptorSets, must: be valid if they are statically used by the currently bound sname:VkPipeline object, specified via fname:vkCmdBindPipeline + All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must: have valid buffers bound + For a given vertex buffer binding, any attribute data fetched must: be entirely contained within the corresponding vertex buffer binding, as described in <<fxvertex-input>> + A valid graphics pipeline must: be bound to the current command buffer with ename:VK_PIPELINE_BIND_POINT_GRAPHICS + If the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must: have been set on the current command buffer + The total value of (pname:indexSize * (pname:firstIndex + pname:indexCount) + pname:offset) must: be less than or equal to the size of the currently bound index buffer, with indexSize being based on the type specified by pname:indexType, where the index buffer, pname:indexType, and pname:offset are specified via fname:vkCmdBindIndexBuffer + Every input attachment used by the current subpass must: be bound to the pipeline via a descriptor set + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used to sample from any sname:VkImage with a sname:VkImageView of the type ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, ename:VK_IMAGE_VIEW_TYPE_1D_ARRAY, ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions with "ImplicitLod", "Dref" or "Proj" in their name, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions that includes a lod bias or any offset values, in any shader stage + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + + + + void vkCmdDrawIndirect + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + uint32_t drawCount + uint32_t stride + + The value of pname:offset must: be a multiple of `4` + If the <<features-features-multiDrawIndirect,multi-draw indirect>> feature is not enabled, the value of pname:drawCount must: be `0` or `1` + If the <<features-features-drawIndirectFirstInstance,drawIndirectFirstInstance>> feature is not enabled, all the pname:firstInstance members of the sname:VkDrawIndirectCommand structures accessed by this command must: be code:0 + For each set _n_ that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must: have been bound to _n_ at ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for set _n_, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + For each push constant that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must: have been set for ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for push constants, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + Descriptors in each bound descriptor set, specified via fname:vkCmdBindDescriptorSets, must: be valid if they are statically used by the currently bound sname:VkPipeline object, specified via fname:vkCmdBindPipeline + All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must: have valid buffers bound + A valid graphics pipeline must: be bound to the current command buffer with ename:VK_PIPELINE_BIND_POINT_GRAPHICS + If the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must: have been set on the current command buffer + If pname:drawCount is greater than `0`, the total value of (pname:stride * (pname:drawCount - 1) + pname:offset + sizeof(sname:VkDrawIndirectCommand)) must: be less than or equal to the size of pname:buffer + pname:drawCount must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxDrawIndirectCount + Every input attachment used by the current subpass must: be bound to the pipeline via a descriptor set + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used to sample from any sname:VkImage with a sname:VkImageView of the type ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, ename:VK_IMAGE_VIEW_TYPE_1D_ARRAY, ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions with "ImplicitLod", "Dref" or "Proj" in their name, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions that includes a lod bias or any offset values, in any shader stage + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + + + + void vkCmdDrawIndexedIndirect + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + uint32_t drawCount + uint32_t stride + + The value of pname:offset must: be a multiple of `4` + If the <<features-features-multiDrawIndirect,multi-draw indirect>> feature is not enabled, the value of pname:drawCount must: be `0` or `1` + If the <<features-features-drawIndirectFirstInstance,drawIndirectFirstInstance>> feature is not enabled, all the pname:firstInstance members of the sname:VkDrawIndexedIndirectCommand structures accessed by this command must: be code:0 + For each set _n_ that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must: have been bound to _n_ at ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for set _n_, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + For each push constant that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must: have been set for ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for push constants, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + Descriptors in each bound descriptor set, specified via fname:vkCmdBindDescriptorSets, must: be valid if they are statically used by the currently bound sname:VkPipeline object, specified via fname:vkCmdBindPipeline + All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must: have valid buffers bound + A valid graphics pipeline must: be bound to the current command buffer with ename:VK_PIPELINE_BIND_POINT_GRAPHICS + If the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must: have been set on the current command buffer + If pname:drawCount is greater than `0`, the total value of (pname:stride * (pname:drawCount - 1) + pname:offset + sizeof(sname:VkDrawIndexedIndirectCommand)) must: be less than or equal to the size of pname:buffer + pname:drawCount must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxDrawIndirectCount + Every input attachment used by the current subpass must: be bound to the pipeline via a descriptor set + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used to sample from any sname:VkImage with a sname:VkImageView of the type ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, ename:VK_IMAGE_VIEW_TYPE_1D_ARRAY, ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions with "ImplicitLod", "Dref" or "Proj" in their name, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions that includes a lod bias or any offset values, in any shader stage + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + + + + void vkCmdDispatch + VkCommandBuffer commandBuffer + uint32_t x + uint32_t y + uint32_t z + + pname:x must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupCount[0] + pname:y must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupCount[1] + pname:z must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupCount[2] + For each set _n_ that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must: have been bound to _n_ at ename:VK_PIPELINE_BIND_POINT_COMPUTE, with a sname:VkPipelineLayout that is compatible for set _n_, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + Descriptors in each bound descriptor set, specified via fname:vkCmdBindDescriptorSets, must: be valid if they are statically used by the currently bound sname:VkPipeline object, specified via fname:vkCmdBindPipeline + A valid compute pipeline must: be bound to the current command buffer with ename:VK_PIPELINE_BIND_POINT_COMPUTE + For each push constant that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must: have been set for ename:VK_PIPELINE_BIND_POINT_COMPUTE, with a sname:VkPipelineLayout that is compatible for push constants with the one used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it mustnot: be used to sample from any sname:VkImage with a sname:VkImageView of the type ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, ename:VK_IMAGE_VIEW_TYPE_1D_ARRAY, ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions with "ImplicitLod", "Dref" or "Proj" in their name, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions that includes a lod bias or any offset values, in any shader stage + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + + + + void vkCmdDispatchIndirect + VkCommandBuffer commandBuffer + VkBuffer buffer + VkDeviceSize offset + + For each set _n_ that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE, a descriptor set must: have been bound to _n_ at ename:VK_PIPELINE_BIND_POINT_COMPUTE, with a sname:VkPipelineLayout that is compatible for set _n_, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + Descriptors in each bound descriptor set, specified via fname:vkCmdBindDescriptorSets, must: be valid if they are statically used by the currently bound sname:VkPipeline object, specified via fname:vkCmdBindPipeline + A valid compute pipeline must: be bound to the current command buffer with ename:VK_PIPELINE_BIND_POINT_COMPUTE + pname:buffer must: have been created with the ename:VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set + The value of pname:offset must: be a multiple of `4` + The sum of pname:offset and the size of sname:VkDispatchIndirectCommand must: be less than or equal to the size of pname:buffer + For each push constant that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE, a push constant value must: have been set for ename:VK_PIPELINE_BIND_POINT_COMPUTE, with a sname:VkPipelineLayout that is compatible for push constants with the one used to create the current sname:VkPipeline, as described in <<descriptorsets-compatibility>> + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it mustnot: be used to sample from any sname:VkImage with a sname:VkImageView of the type ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, ename:VK_IMAGE_VIEW_TYPE_1D_ARRAY, ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions with "ImplicitLod", "Dref" or "Proj" in their name, in any shader stage + If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE uses unnormalized coordinates, it mustnot: be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions that includes a lod bias or any offset values, in any shader stage + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE accesses a uniform buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + If the <<features-features-robustBufferAccess,robust buffer access>> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_COMPUTE accesses a storage buffer, it mustnot: access values outside of the range of that buffer specified in the currently bound descriptor set + + + + void vkCmdCopyBuffer + VkCommandBuffer commandBuffer + VkBuffer srcBuffer + VkBuffer dstBuffer + uint32_t regionCount + const VkBufferCopy* pRegions + + The sum of the pname:srcOffset and pname:copySize members of a given element of pname:pRegions must: be less than or equal to the size of pname:srcBuffer + The sum of the pname:dstOffset and pname:copySize members of a given element of pname:pRegions must: be less than or equal to the size of pname:dstBuffer + The union of the source regions, and the union of the destination regions, specified by the elements of pname:pRegions, mustnot: overlap in memory + pname:srcBuffer must: have been created with pname:VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag + pname:dstBuffer must: have been created with pname:VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag + + + + void vkCmdCopyImage + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageCopy* pRegions + + The source region specified by a given element of pname:pRegions must: be a region that is contained within pname:srcImage + The destination region specified by a given element of pname:pRegions must: be a region that is contained within pname:dstImage + The union of all source regions, and the union of all destination regions, specified by the elements of pname:pRegions, mustnot: overlap in memory + pname:srcImage must: have been created with pname:VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag + pname:srcImageLayout must: specify the layout of the subresources of pname:srcImage specified in pname:pRegions at the time this command is executed on a sname:VkDevice + pname:srcImageLayout must: be either of VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL + pname:dstImage must: have been created with pname:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag + pname:dstImageLayout must: specify the layout of the subresources of pname:dstImage specified in pname:pRegions at the time this command is executed on a sname:VkDevice + pname:dstImageLayout must: be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL + The elink:VkFormat of each of pname:srcImage and pname:dstImage must: be compatible, as defined <<copies-images-format-compatibility, below>> + The sample count of pname:srcImage and pname:dstImage must: match + + + + void vkCmdBlitImage + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageBlit* pRegions + VkFilter filter + + The source region specified by a given element of pname:pRegions must: be a region that is contained within pname:srcImage + The destination region specified by a given element of pname:pRegions must: be a region that is contained within pname:dstImage + The union of all source regions, and the union of all destination regions, specified by the elements of pname:pRegions, mustnot: overlap in memory + pname:srcImage must: use a format that supports ename:VK_FORMAT_FEATURE_BLIT_SRC_BIT, which is indicated by sname:VkFormatProperties::pname:linearTilingFeatures (for linear tiled images) or sname:VkFormatProperties::pname:optimalTilingFeatures (for optimally tiled images) - as returned by fname:vkGetPhysicalDeviceFormatProperties + pname:srcImage must: have been created with pname:VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag + pname:srcImageLayout must: specify the layout of the subresources of pname:srcImage specified in pname:pRegions at the time this command is executed on a sname:VkDevice + pname:srcImageLayout must: be either of VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL + pname:dstImage must: use a format that supports ename:VK_FORMAT_FEATURE_BLIT_DST_BIT, which is indicated by sname:VkFormatProperties::pname:linearTilingFeatures (for linear tiled images) or sname:VkFormatProperties::pname:optimalTilingFeatures (for optimally tiled images) - as returned by fname:vkGetPhysicalDeviceFormatProperties + pname:dstImage must: have been created with pname:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag + pname:dstImageLayout must: specify the layout of the subresources of pname:dstImage specified in pname:pRegions at the time this command is executed on a sname:VkDevice + pname:dstImageLayout must: be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL + The sample count of pname:srcImage and pname:dstImage must: both be equal to ename:VK_SAMPLE_COUNT_1_BIT + If either of pname:srcImage or pname:dstImage was created with a signed integer elink:VkFormat, the other must: also have been created with a signed integer elink:VkFormat + If either of pname:srcImage or pname:dstImage was created with an unsigned integer elink:VkFormat, the other must: also have been created with an unsigned integer elink:VkFormat + If either of pname:srcImage or pname:dstImage was created with a depth/stencil format, the other must: have exactly the same format + If pname:srcImage was created with a depth/stencil format, pname:filter must: be ename:VK_FILTER_NEAREST + + + + void vkCmdCopyBufferToImage + VkCommandBuffer commandBuffer + VkBuffer srcBuffer + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkBufferImageCopy* pRegions + + The buffer region specified by a given element of pname:pRegions must: be a region that is contained within pname:srcBuffer + The image region specified by a given element of pname:pRegions must: be a region that is contained within pname:dstImage + The union of all source regions, and the union of all destination regions, specified by the elements of pname:pRegions, mustnot: overlap in memory + pname:srcBuffer must: have been created with pname:VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag + pname:dstImage must: have been created with pname:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag + pname:dstImage must: have a sample count equal to ename:VK_SAMPLE_COUNT_1_BIT + pname:dstImageLayout must: specify the layout of the subresources of pname:dstImage specified in pname:pRegions at the time this command is executed on a sname:VkDevice + pname:dstImageLayout must: be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL + + + + void vkCmdCopyImageToBuffer + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkBuffer dstBuffer + uint32_t regionCount + const VkBufferImageCopy* pRegions + + The image region specified by a given element of pname:pRegions must: be a region that is contained within pname:srcImage + The buffer region specified by a given element of pname:pRegions must: be a region that is contained within pname:dstBuffer + The union of all source regions, and the union of all destination regions, specified by the elements of pname:pRegions, mustnot: overlap in memory + pname:srcImage must: have been created with pname:VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag + pname:srcImage must: have a sample count equal to ename:VK_SAMPLE_COUNT_1_BIT + pname:srcImageLayout must: specify the layout of the subresources of pname:srcImage specified in pname:pRegions at the time this command is executed on a sname:VkDevice + pname:srcImageLayout must: be either of VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL + pname:dstBuffer must: have been created with pname:VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag + + + + void vkCmdUpdateBuffer + VkCommandBuffer commandBuffer + VkBuffer dstBuffer + VkDeviceSize dstOffset + VkDeviceSize dataSize + const uint32_t* pData + + The sum of pname:dstOffset and pname:dataSize must: be less than or equal to the size of pname:dstBuffer + pname:dstBuffer must: have been created with pname:VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag + The value of pname:dstOffset must: be a multiple of `4` + The value of pname:dataSize must: be greater than `0` + The value of pname:dataSize must: be less than `65536` + The value of pname:dataSize must: be a multiple of `4` + + + + void vkCmdFillBuffer + VkCommandBuffer commandBuffer + VkBuffer dstBuffer + VkDeviceSize dstOffset + VkDeviceSize size + uint32_t data + + If pname:size is not equal to ename:VK_WHOLE_SIZE, the sum of pname:dstOffset and pname:size must: be less than or equal to the size of pname:dstBuffer + pname:dstBuffer must: have been created with pname:VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag + pname:dstOffset must: be a multiple of `4` + If pname:size is not equal to ename:VK_WHOLE_SIZE, pname:size must: be a multiple of `4` + + + + void vkCmdClearColorImage + VkCommandBuffer commandBuffer + VkImage image + VkImageLayout imageLayout + const VkClearColorValue* pColor + uint32_t rangeCount + const VkImageSubresourceRange* pRanges + + pname:image must: have been created with pname:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag + pname:imageLayout must: specify the layout of the subresource ranges of pname:image specified in pname:pRanges at the time this command is executed on a sname:VkDevice + pname:imageLayout must: be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL + The image range of any given element of pname:pRanges must: be a subresource range that is contained within pname:image + + + + void vkCmdClearDepthStencilImage + VkCommandBuffer commandBuffer + VkImage image + VkImageLayout imageLayout + const VkClearDepthStencilValue* pDepthStencil + uint32_t rangeCount + const VkImageSubresourceRange* pRanges + + pname:image must: have been created with pname:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag + pname:imageLayout must: specify the layout of the subresource ranges of pname:image specified in pname:pRanges at the time this command is executed on a sname:VkDevice + pname:imageLayout must: be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL + The image range of any given element of pname:pRanges must: be a subresource range that is contained within pname:image + + + + void vkCmdClearAttachments + VkCommandBuffer commandBuffer + uint32_t attachmentCount + const VkClearAttachment* pAttachments + uint32_t rectCount + const VkClearRect* pRects + + If the pname:aspectMask member of any given element of pname:pAttachments contains ename:VK_IMAGE_ASPECT_COLOR_BIT, the pname:colorAttachment member of those elements must: refer to a valid color attachment in the current subpass + The rectangular region specified by a given element of pname:pRects must: be contained within the render area of the current render pass instance + The layers specified by a given element of pname:pRects must: be contained within every attachment that pname:pAttachments refers to + + + + void vkCmdResolveImage + VkCommandBuffer commandBuffer + VkImage srcImage + VkImageLayout srcImageLayout + VkImage dstImage + VkImageLayout dstImageLayout + uint32_t regionCount + const VkImageResolve* pRegions + + The source region specified by a given element of pname:pRegions must: be a region that is contained within pname:srcImage + The destination region specified by a given element of pname:pRegions must: be a region that is contained within pname:dstImage + The union of all source regions, and the union of all destination regions, specified by the elements of pname:pRegions, mustnot: overlap in memory + pname:srcImage must: have a sample count equal to any valid sample count value other than ename:VK_SAMPLE_COUNT_1_BIT + pname:dstImage must: have a sample count equal to ename:VK_SAMPLE_COUNT_1_BIT + pname:srcImageLayout must: specify the layout of the subresources of pname:srcImage specified in pname:pRegions at the time this command is executed on a sname:VkDevice + pname:srcImageLayout must: be either of VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL + pname:dstImageLayout must: specify the layout of the subresources of pname:dstImage specified in pname:pRegions at the time this command is executed on a sname:VkDevice + pname:dstImageLayout must: be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL + If pname:dstImage was created with pname:tiling equal to ename:VK_IMAGE_TILING_LINEAR, pname:dstImage must: have been created with a pname:format that supports being a color attachment, as specified by the ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT flag in sname:VkFormatProperties::pname:linearTilingFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + If pname:dstImage was created with pname:tiling equal to ename:VK_IMAGE_TILING_OPTIMAL, pname:dstImage must: have been created with a pname:format that supports being a color attachment, as specified by the ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT flag in sname:VkFormatProperties::pname:optimalTilingFeatures returned by fname:vkGetPhysicalDeviceFormatProperties + + + + + void vkCmdSetEvent + VkCommandBuffer commandBuffer + VkEvent event + VkPipelineStageFlags stageMask + + If the <<features-features-geometryShader,geometry shaders>> feature is not enabled, pname:stageMask mustnot: contain pname:VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT + If the <<features-features-tessellationShader,tessellation shaders>> feature is not enabled, pname:stageMask mustnot: contain pname:VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or pname:VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT + + + + void vkCmdResetEvent + VkCommandBuffer commandBuffer + VkEvent event + VkPipelineStageFlags stageMask + + If the <<features-features-geometryShader,geometry shaders>> feature is not enabled, pname:stageMask mustnot: contain pname:VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT + If the <<features-features-tessellationShader,tessellation shaders>> feature is not enabled, pname:stageMask mustnot: contain pname:VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or pname:VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT + + + + void vkCmdWaitEvents + VkCommandBuffer commandBuffer + uint32_t eventCount + const VkEvent* pEvents + VkPipelineStageFlags srcStageMask + VkPipelineStageFlags dstStageMask + uint32_t memoryBarrierCount + const VkMemoryBarrier* pMemoryBarriers + uint32_t bufferMemoryBarrierCount + const VkBufferMemoryBarrier* pBufferMemoryBarriers + uint32_t imageMemoryBarrierCount + const VkImageMemoryBarrier* pImageMemoryBarriers + + pname:srcStageMask must: be the bitwise OR of the pname:stageMask parameter used in previous calls to fname:vkCmdSetEvent with any of the members of pname:pEvents + If fname:vkSetEvent was used to signal any of the events in pname:pEvents, pname:srcStageMask must: include the ename:VK_PIPELINE_STAGE_HOST_BIT flag + If the <<features-features-geometryShader,geometry shaders>> feature is not enabled, pname:srcStageMask mustnot: contain pname:VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT + If the <<features-features-geometryShader,geometry shaders>> feature is not enabled, pname:dstStageMask mustnot: contain pname:VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT + If the <<features-features-tessellationShader,tessellation shaders>> feature is not enabled, pname:srcStageMask mustnot: contain pname:VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or pname:VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT + If the <<features-features-tessellationShader,tessellation shaders>> feature is not enabled, pname:dstStageMask mustnot: contain pname:VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or pname:VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT + If pname:pEvents includes one or more events that will be signaled by fname:vkSetEvent after pname:commandBuffer has been submitted to a queue, then fname:vkCmdWaitEvents mustnot: be called inside a render pass instance + + + + void vkCmdPipelineBarrier + VkCommandBuffer commandBuffer + VkPipelineStageFlags srcStageMask + VkPipelineStageFlags dstStageMask + VkDependencyFlags dependencyFlags + uint32_t memoryBarrierCount + const VkMemoryBarrier* pMemoryBarriers + uint32_t bufferMemoryBarrierCount + const VkBufferMemoryBarrier* pBufferMemoryBarriers + uint32_t imageMemoryBarrierCount + const VkImageMemoryBarrier* pImageMemoryBarriers + + If the <<features-features-geometryShader,geometry shaders>> feature is not enabled, pname:srcStageMask mustnot: contain pname:VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT + If the <<features-features-geometryShader,geometry shaders>> feature is not enabled, pname:dstStageMask mustnot: contain pname:VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT + If the <<features-features-tessellationShader,tessellation shaders>> feature is not enabled, pname:srcStageMask mustnot: contain pname:VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or pname:VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT + If the <<features-features-tessellationShader,tessellation shaders>> feature is not enabled, pname:dstStageMask mustnot: contain pname:VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT or pname:VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT + If fname:vkCmdPipelineBarrier is called within a render pass instance, the render pass must: declare at least one self-dependency from the current subpass to itself - see <<synchronization-pipeline-barriers-subpass-self-dependencies,Subpass Self-dependency>> + + + + void vkCmdBeginQuery + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t query + VkQueryControlFlags flags + + The query identified by pname:queryPool and pname:query must: currently not be <<queries-operation-active,active>> + The query identified by pname:queryPool and pname:query must: be unavailable + If the <<features-features-occlusionQueryPrecise,precise occlusion queries>> feature is not enabled, or the pname:queryType used to create pname:queryPool was not ename:VK_QUERY_TYPE_OCCLUSION, pname:flags mustnot: contain ename:VK_QUERY_CONTROL_PRECISE_BIT + pname:queryPool must: have been created with a pname:queryType that differs from that of any other queries that have been made <<queries-operation-active,active>>, and are currently still active within pname:commandBuffer + pname:query must: be less than the number of queries in pname:queryPool + If the pname:queryType used to create pname:queryPool was ename:VK_QUERY_TYPE_OCCLUSION, the sname:VkCommandPool that pname:commandBuffer was created from must: support graphics operations + If the pname:queryType used to create pname:queryPool was ename:VK_QUERY_TYPE_PIPELINE_STATISTICS and any of the pname:pipelineStatistics indicate graphics operations, the sname:VkCommandPool that pname:commandBuffer was created from must: support graphics operations + If the pname:queryType used to create pname:queryPool was ename:VK_QUERY_TYPE_PIPELINE_STATISTICS and any of the pname:pipelineStatistics indicate compute operations, the sname:VkCommandPool that pname:commandBuffer was created from must: support compute operations + + + + void vkCmdEndQuery + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t query + + The query identified by pname:queryPool and pname:query must: currently be <<queries-operation-active,active>> + pname:query must: be less than the number of queries in pname:queryPool + + + + void vkCmdResetQueryPool + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + + pname:firstQuery must: be less than the number of queries in pname:queryPool + The sum of pname:firstQuery and pname:queryCount must: be less than or equal to the number of queries in pname:queryPool + + + + void vkCmdWriteTimestamp + VkCommandBuffer commandBuffer + VkPipelineStageFlagBits pipelineStage + VkQueryPool queryPool + uint32_t query + + The query identified by pname:queryPool and pname:query must: be _unavailable_ + The command pool's queue family must: support a non-zero value of pname:timestampValidBits + + + + void vkCmdCopyQueryPoolResults + VkCommandBuffer commandBuffer + VkQueryPool queryPool + uint32_t firstQuery + uint32_t queryCount + VkBuffer dstBuffer + VkDeviceSize dstOffset + VkDeviceSize stride + VkQueryResultFlags flags + + pname:firstQuery must: be less than the number of queries in pname:queryPool + The sum of pname:firstQuery and pname:queryCount must: be less than or equal to the number of queries in pname:queryPool + If ename:VK_QUERY_RESULT_64_BIT is not set in pname:flags then pname:dstOffset and pname:stride must be multiples of `4` + If ename:VK_QUERY_RESULT_64_BIT is set in pname:flags then pname:dstOffset and pname:stride must be multiples of `8` + pname:dstBuffer must: have enough storage, from pname:dstOffset, to contain the result of each query, as described <<queries-operation-memorylayout,here>> + If the pname:queryType used to create pname:queryPool was ename:VK_QUERY_TYPE_TIMESTAMP, pname:flags mustnot: contain ename:VK_QUERY_RESULT_PARTIAL_BIT + + + + void vkCmdPushConstants + VkCommandBuffer commandBuffer + VkPipelineLayout layout + VkShaderStageFlags stageFlags + uint32_t offset + uint32_t size + const void* pValues + + pname:stageFlags must: match exactly the shader stages used in pname:layout for the range specified by pname:offset and pname:size + pname:offset must: be a multiple of `4` + pname:size must: be a multiple of `4` + + + + void vkCmdBeginRenderPass + VkCommandBuffer commandBuffer + const VkRenderPassBeginInfo* pRenderPassBegin + VkSubpassContents contents + + + void vkCmdNextSubpass + VkCommandBuffer commandBuffer + VkSubpassContents contents + + The current render pass instance mustnot: be in the last subpass, that is - since the call to fname:vkCmdBeginRenderPass, fname:vkCmdNextSubpass must: have been called a number of times at least two less than the number of subpasses in the render pass + + + + void vkCmdEndRenderPass + VkCommandBuffer commandBuffer + + The render pass instance that is being ended must: be in the last subpass, that is - since the call to fname:vkCmdBeginRenderPass, fname:vkCmdNextSubpass must: have been called a number of times equal to one less than the number of subpasses in the render pass + + + + void vkCmdExecuteCommands + VkCommandBuffer commandBuffer + uint32_t commandBufferCount + const VkCommandBuffer* pCommandBuffers + + pname:commandBuffer must: have been created with a pname:level value of VK_COMMAND_BUFFER_LEVEL_PRIMARY + Any given element of pname:pCommandBuffers must: have been created with a pname:level value of VK_COMMAND_BUFFER_LEVEL_SECONDARY + Any given element of pname:pCommandBuffers mustnot: be already pending execution in pname:commandBuffer, or appear twice in pname:pCommandBuffers, unless it was created with the ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT flag + Any given element of pname:pCommandBuffers mustnot: be already pending execution in any other sname:VkCommandBuffer, unless it was created with the ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT flag + Any given element of pname:pCommandBuffers must: be in the executable state + If fname:vkCmdExecuteCommands is being called within a render pass instance, that render pass instance must: have been begun with the pname:contents parameter of fname:vkCmdBeginRenderPass set to ename:VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS + If fname:vkCmdExecuteCommands is being called within a render pass instance, any given element of pname:pCommandBuffers must: have been recorded with the ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT + If fname:vkCmdExecuteCommands is being called within a render pass instance, any given element of pname:pCommandBuffers must: have been recorded with the pname:subpass member of the pname:inheritanceInfo structure set to the index of the subpass which the given command buffer will be executed in + If fname:vkCmdExecuteCommands is being called within a render pass instance, any given element of pname:pCommandBuffers must: have been recorded with a render pass that is compatible with the current render pass - see <<renderpass-compatibility>> + If fname:vkCmdExecuteCommands is being called within a render pass instance, and any given element of pname:pCommandBuffers was recorded with the pname:framebuffer member of the sname:VkCommandBufferInheritanceInfo structure not equal to sname:VK_NULL_HANDLE, that sname:VkFramebuffer must: be compatible with the sname:VkFramebuffer used in the current render pass instance + If the <<features-features-inheritedQueries,inherited queries>> feature is not enabled, pname:commandBuffer mustnot: have any queries <<queries-operation-active,active>> + If pname:commandBuffer has a ename:VK_QUERY_TYPE_OCCLUSION query <<queries-operation-active,active>>, then each element of pname:pCommandBuffers must: have been recorded with sname:VkCommandBufferBeginInfo::pname:occlusionQueryEnable set to ename:VK_TRUE + If pname:commandBuffer has a ename:VK_QUERY_TYPE_OCCLUSION query <<queries-operation-active,active>>, then each element of pname:pCommandBuffers must: have been recorded with sname:VkCommandBufferBeginInfo::pname:queryFlags having all bits set that are set for the query + If pname:commandBuffer has a ename:VK_QUERY_TYPE_PIPELINE_STATISTICS query <<queries-operation-active,active>>, then each element of pname:pCommandBuffers must: have been recorded with sname:VkCommandBufferBeginInfo::pname:pipelineStatistics having all bits set that are set in the sname:VkQueryPool the query uses + Any given element of pname:pCommandBuffers mustnot: begin any query types that are <<queries-operation-active,active>> in pname:commandBuffer + + + + VkResult vkCreateAndroidSurfaceKHR + VkInstance instance + const VkAndroidSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkGetPhysicalDeviceDisplayPropertiesKHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkDisplayPropertiesKHR* pProperties + + + VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR + VkPhysicalDevice physicalDevice + uint32_t* pPropertyCount + VkDisplayPlanePropertiesKHR* pProperties + + + VkResult vkGetDisplayPlaneSupportedDisplaysKHR + VkPhysicalDevice physicalDevice + uint32_t planeIndex + uint32_t* pDisplayCount + VkDisplayKHR* pDisplays + + pname:planeIndex must: be less than the number of display planes supported by the device as determined by calling fname:vkGetPhysicalDeviceDisplayPlanePropertiesKHR + + + + VkResult vkGetDisplayModePropertiesKHR + VkPhysicalDevice physicalDevice + VkDisplayKHR display + uint32_t* pPropertyCount + VkDisplayModePropertiesKHR* pProperties + + + VkResult vkCreateDisplayModeKHR + VkPhysicalDevice physicalDevice + VkDisplayKHR display + const VkDisplayModeCreateInfoKHR*pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDisplayModeKHR* pMode + + + VkResult vkGetDisplayPlaneCapabilitiesKHR + VkPhysicalDevice physicalDevice + VkDisplayModeKHR mode + uint32_t planeIndex + VkDisplayPlaneCapabilitiesKHR* pCapabilities + + + VkResult vkCreateDisplayPlaneSurfaceKHR + VkInstance instance + const VkDisplaySurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkResult vkCreateSharedSwapchainsKHR + VkDevice device + uint32_t swapchainCount + const VkSwapchainCreateInfoKHR* pCreateInfos + const VkAllocationCallbacks* pAllocator + VkSwapchainKHR* pSwapchains + + + VkResult vkCreateMirSurfaceKHR + VkInstance instance + const VkMirSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + MirConnection* connection + + pname:queueFamilyIndex must: be less than the value of pname:pQueueFamilyPropertyCount returned by fname:vkGetPhysicalDeviceQueueFamilyProperties for the given pname:physicalDevice + + + + void vkDestroySurfaceKHR + VkInstance instance + VkSurfaceKHR surface + const VkAllocationCallbacks* pAllocator + + All sname:VkSwapchainKHR objects created for pname:surface must: have been destroyed prior to destroying pname:surface + If sname:VkAllocationCallbacks were provided when pname:surface was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:surface was created, pname:pAllocator must: be `NULL` + + + + VkResult vkGetPhysicalDeviceSurfaceSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + VkSurfaceKHR surface + VkBool32* pSupported + + pname:queueFamilyIndex must: be less than the value of pname:pQueueFamilyPropertyCount returned by fname:vkGetPhysicalDeviceQueueFamilyProperties for the given pname:physicalDevice + + + + VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + VkSurfaceCapabilitiesKHR* pSurfaceCapabilities + + + VkResult vkGetPhysicalDeviceSurfaceFormatsKHR + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + uint32_t* pSurfaceFormatCount + VkSurfaceFormatKHR* pSurfaceFormats + + + VkResult vkGetPhysicalDeviceSurfacePresentModesKHR + VkPhysicalDevice physicalDevice + VkSurfaceKHR surface + uint32_t* pPresentModeCount + VkPresentModeKHR* pPresentModes + + + VkResult vkCreateSwapchainKHR + VkDevice device + const VkSwapchainCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSwapchainKHR* pSwapchain + + + void vkDestroySwapchainKHR + VkDevice device + VkSwapchainKHR swapchain + const VkAllocationCallbacks* pAllocator + + All uses of presentable images acquired from pname:swapchain and owned by the application must: have completed execution + If sname:VkAllocationCallbacks were provided when pname:swapchain was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:swapchain was created, pname:pAllocator must: be `NULL` + + + + VkResult vkGetSwapchainImagesKHR + VkDevice device + VkSwapchainKHR swapchain + uint32_t* pSwapchainImageCount + VkImage* pSwapchainImages + + + VkResult vkAcquireNextImageKHR + VkDevice device + VkSwapchainKHR swapchain + uint64_t timeout + VkSemaphore semaphore + VkFence fence + uint32_t* pImageIndex + + If pname:semaphore is not sname:VK_NULL_HANDLE it must: be unsignalled + If pname:fence is not sname:VK_NULL_HANDLE it must: be unsignalled and mustnot: be associated with any other queue command that has not yet completed execution on that queue + + + + VkResult vkQueuePresentKHR + VkQueue queue + const VkPresentInfoKHR* pPresentInfo + + Any given element of pname:pSwapchains member of pname:pPresentInfo must: be a swapchain that is created for a surface for which presentation is supported from pname:queue as determined using a call to fname:vkGetPhysicalDeviceSurfaceSupportKHR + + + + VkResult vkCreateWaylandSurfaceKHR + VkInstance instance + const VkWaylandSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + struct wl_display* display + + pname:queueFamilyIndex must: be less than the value of pname:pQueueFamilyPropertyCount returned by fname:vkGetPhysicalDeviceQueueFamilyProperties for the given pname:physicalDevice + + + + VkResult vkCreateWin32SurfaceKHR + VkInstance instance + const VkWin32SurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + + pname:queueFamilyIndex must: be less than the value of pname:pQueueFamilyPropertyCount returned by fname:vkGetPhysicalDeviceQueueFamilyProperties for the given pname:physicalDevice + + + + VkResult vkCreateXlibSurfaceKHR + VkInstance instance + const VkXlibSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + Display* dpy + VisualID visualID + + pname:queueFamilyIndex must: be less than the value of pname:pQueueFamilyPropertyCount returned by fname:vkGetPhysicalDeviceQueueFamilyProperties for the given pname:physicalDevice + + + + VkResult vkCreateXcbSurfaceKHR + VkInstance instance + const VkXcbSurfaceCreateInfoKHR* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkSurfaceKHR* pSurface + + + VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR + VkPhysicalDevice physicalDevice + uint32_t queueFamilyIndex + xcb_connection_t* connection + xcb_visualid_t visual_id + + pname:queueFamilyIndex must: be less than the value of pname:pQueueFamilyPropertyCount returned by fname:vkGetPhysicalDeviceQueueFamilyProperties for the given pname:physicalDevice + + + + VkResult vkCreateDebugReportCallbackEXT + VkInstance instance + const VkDebugReportCallbackCreateInfoEXT* pCreateInfo + const VkAllocationCallbacks* pAllocator + VkDebugReportCallbackEXT* pCallback + + + void vkDestroyDebugReportCallbackEXT + VkInstance instance + VkDebugReportCallbackEXT callback + const VkAllocationCallbacks* pAllocator + + If sname:VkAllocationCallbacks were provided when pname:instance was created, a compatible set of callbacks must: be provided here + If no sname:VkAllocationCallbacks were provided when pname:instance was created, pname:pAllocator must: be `NULL` + + + + void vkDebugReportMessageEXT + VkInstance instance + VkDebugReportFlagsEXT flags + VkDebugReportObjectTypeEXT objectType + uint64_t object + size_t location + int32_t messageCode + const char* pLayerPrefix + const char* pMessage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3