aboutsummaryrefslogtreecommitdiff
path: root/scripts/unique_objects_generator.py
diff options
context:
space:
mode:
authorDustin Graves <dustin@lunarg.com>2017-03-28 14:18:54 -0600
committerMark Lobodzinski <mark@lunarg.com>2017-03-29 10:59:14 -0600
commitee3ba1acdc5f2555cf0483e37d2a07c693484642 (patch)
tree4c6442d2cc14a8626dd977fb2c95133ffdb939a7 /scripts/unique_objects_generator.py
parent0f856a0003d08aa9753eba13e1ea5fc84c249007 (diff)
downloadusermoji-ee3ba1acdc5f2555cf0483e37d2a07c693484642.tar.xz
layers: Fix extension func/core struct codegen
Fix code generation for extension functions receiving struct parameter types defined by core Vulkan. Extensions are processed as separate features by the code generator, and the type info required for structure generation was not being shared across features. The code generator has been modified to share type info across features so that the validation code generated for extension functions includes validation for core structures: - Prevent unique objects and parameter validation code generators from clearing struct type info data structures at the start of feature processing. - Remove unused data structures from unique objects code generator. - Adds handle unwrapping and parameter validation for elements in the vkCmdPushDescriptorSetKHR pDescriptorWrites parameter. - Adds handle unwrapping and parameter validation for elements in the vkCreateSharedSwapCHainsKHR pCreateInfos parameter. - Adds VkAllocationCallback parameter validation to the WSI and descriptor update template extensions functions. Change-Id: I016aa6550681dbf7d6bda834272374ce63ed1940
Diffstat (limited to 'scripts/unique_objects_generator.py')
-rw-r--r--scripts/unique_objects_generator.py18
1 files changed, 1 insertions, 17 deletions
diff --git a/scripts/unique_objects_generator.py b/scripts/unique_objects_generator.py
index a6dae647..1773c3b7 100644
--- a/scripts/unique_objects_generator.py
+++ b/scripts/unique_objects_generator.py
@@ -136,6 +136,7 @@ class UniqueObjectsOutputGenerator(OutputGenerator):
'vkCreateComputePipelines',
'vkCreateGraphicsPipelines',
'vkCreateSwapchainKHR',
+ 'vkCreateSharedSwapchainsKHR',
'vkGetSwapchainImagesKHR',
'vkEnumerateInstanceLayerProperties',
'vkEnumerateDeviceLayerProperties',
@@ -162,16 +163,9 @@ class UniqueObjectsOutputGenerator(OutputGenerator):
self.headerVersion = None
# Internal state - accumulators for different inner block text
self.sections = dict([(section, []) for section in self.ALL_SECTIONS])
- self.structNames = [] # List of Vulkan struct typenames
- self.structTypes = dict() # Map of Vulkan struct typename to required VkStructureType
- self.handleTypes = set() # Set of handle type names
- self.commands = [] # List of CommandData records for all Vulkan commands
self.structMembers = [] # List of StructMemberData records for all Vulkan structs
- self.flags = set() # Map of flags typenames
# Named tuples to store struct and command data
- self.StructType = namedtuple('StructType', ['name', 'value'])
self.CommandParam = namedtuple('CommandParam', ['type', 'name', 'ispointer', 'isconst', 'iscount', 'len', 'extstructs', 'cdecl', 'islocal', 'iscreate', 'isdestroy'])
- self.CommandData = namedtuple('CommandData', ['name', 'return_type', 'params', 'cdecl'])
self.StructMemberData = namedtuple('StructMemberData', ['name', 'members'])
#
def incIndent(self, indent):
@@ -236,14 +230,7 @@ class UniqueObjectsOutputGenerator(OutputGenerator):
OutputGenerator.beginFeature(self, interface, emit)
self.headerVersion = None
self.sections = dict([(section, []) for section in self.ALL_SECTIONS])
- self.structNames = []
- self.structTypes = dict()
- self.handleTypes = set()
- self.commands = []
- self.structMembers = []
self.cmdMembers = []
- self.flags = set()
- self.StructMemberData = namedtuple('StructMemberData', ['name', 'members'])
self.CmdMemberData = namedtuple('CmdMemberData', ['name', 'members'])
if self.featureName != 'VK_VERSION_1_0':
white_list_entry = []
@@ -284,7 +271,6 @@ class UniqueObjectsOutputGenerator(OutputGenerator):
# Otherwise, emit the tag text.
category = typeElem.get('category')
if (category == 'struct' or category == 'union'):
- self.structNames.append(name)
self.genStruct(typeinfo, name)
#
# Append a definition to the specified section
@@ -383,8 +369,6 @@ class UniqueObjectsOutputGenerator(OutputGenerator):
value = result.group(0)
else:
value = self.genVkStructureType(typeName)
- # Store the required type value
- self.structTypes[typeName] = self.StructType(name=name, value=value)
# Store pointer/array/string info
membersInfo.append(self.CommandParam(type=type,
name=name,