aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2018-05-31 13:59:59 -0600
committerMark Lobodzinski <mark@lunarg.com>2018-06-20 08:18:12 -0600
commit9ddf9283dc294e150a51a117ee1c39427dd1b706 (patch)
treee1ed2bab61090b510b933b928193c3cb2b9e5a2e /scripts
parent596035508376d0c462fe16f662392bef96ef8876 (diff)
downloadvulkan-validation-layers-9ddf9283dc294e150a51a117ee1c39427dd1b706.tar.gz
layers: Add CreateInstance/Device pNext validation
These were skipped due to some heinous loader features. They're now guarded against and validation can go free and easy.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/parameter_validation_generator.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/parameter_validation_generator.py b/scripts/parameter_validation_generator.py
index f24392054..9855b0335 100644
--- a/scripts/parameter_validation_generator.py
+++ b/scripts/parameter_validation_generator.py
@@ -715,6 +715,8 @@ class ParameterValidationOutputGenerator(OutputGenerator):
value = value.replace('D3_D12', 'D3D12')
value = value.replace('Device_IDProp', 'Device_ID_Prop')
value = value.replace('LODGather', 'LOD_Gather')
+ value = value.replace('Features2', 'FEATURES_2')
+ value = value.replace('e16_Bit', 'E_16BIT')
# Change to uppercase
value = value.upper()
# Add STRUCTURE_TYPE_
@@ -722,6 +724,8 @@ class ParameterValidationOutputGenerator(OutputGenerator):
#
# Get the cached VkStructureType value for the specified struct typename, or generate a VkStructureType
# value assuming the struct is defined by a different feature
+ # TODO: The structTypes list gets built incrementally -- half the time, the sType you're looking for is not yet in the list.
+ # The list needs to be built up-front, probably by accessing the XML directly, or by rewriting the generator.
def getStructType(self, typename):
value = None
if typename in self.structTypes:
@@ -1165,9 +1169,7 @@ class ParameterValidationOutputGenerator(OutputGenerator):
enum_value_list = 'All%sEnums' % value.type
usedLines.append('skip |= validate_ranged_enum_array(local_data->report_data, "{}", {ppp}"{}"{pps}, {ppp}"{}"{pps}, "{}", {}, {pf}{}, {pf}{}, {}, {});\n'.format(funcName, lenDisplayName, valueDisplayName, value.type, enum_value_list, lenParam.name, value.name, cvReq, req, pf=valuePrefix, **postProcSpec))
elif value.name == 'pNext':
- # We need to ignore VkDeviceCreateInfo and VkInstanceCreateInfo, as the loader manipulates them in a way that is not documented in vk.xml
- if not structTypeName in ['VkDeviceCreateInfo', 'VkInstanceCreateInfo']:
- usedLines += self.makeStructNextCheck(valuePrefix, value, funcName, valueDisplayName, postProcSpec, structTypeName)
+ usedLines += self.makeStructNextCheck(valuePrefix, value, funcName, valueDisplayName, postProcSpec, structTypeName)
else:
usedLines += self.makePointerCheck(valuePrefix, value, lenParam, req, cvReq, cpReq, funcName, lenDisplayName, valueDisplayName, postProcSpec, structTypeName)
# If this is a pointer to a struct (input), see if it contains members that need to be checked