Revert "safestruct: Remove safe_VkDescriptorDataEXT"

This reverts commit 1135918c96.
This commit is contained in:
ziga-lunarg 2024-04-20 20:01:23 +02:00 committed by Spencer Fricke
parent 6e6a4e05bf
commit d0ffc68fe7
4 changed files with 519 additions and 9 deletions

View file

@ -80,6 +80,9 @@ class SafeStructOutputGenerator(BaseGenerator):
# vku::safe::AccelerationStructureGeometryKHR needs to know if we're doing a host or device build
'VkAccelerationStructureGeometryKHR' :
', const bool is_host, const VkAccelerationStructureBuildRangeInfoKHR *build_range_info',
# vku::safe::DescriptorDataEXT needs to know what field of union is intialized
'VkDescriptorDataEXT' :
', const VkDescriptorType type',
}
# Determine if a structure needs a safe_struct helper function
@ -87,8 +90,6 @@ class SafeStructOutputGenerator(BaseGenerator):
def needSafeStruct(self, struct: Struct) -> bool:
if struct.name in self.no_autogen:
return False
if struct.name in self.union_of_pointers:
return False
if 'VkBase' in struct.name:
return False # Ingore structs like VkBaseOutStructure
if struct.sType is not None:
@ -191,6 +192,9 @@ class SafeStructOutputGenerator(BaseGenerator):
else:
out.append(f'{member.cDeclaration}{initialize};\n')
if (struct.name == 'VkDescriptorDataEXT'):
out.append('char type_at_end[sizeof(VkDescriptorDataEXT)+sizeof(VkDescriptorGetInfoEXT::type)];')
constructParam = self.custom_construct_params.get(struct.name, '')
out.append(f'''
{safe_name}(const {struct.name}* in_struct{constructParam}, PNextCopyState* copy_state = {{}}{copy_pnext});