From 99a84ff51900bed5b20063080e3d5415659eb1b1 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Mon, 6 Mar 2017 08:59:14 -0700 Subject: [PATCH] scripts: Allow safe_structs to handle KHR extensions Deep copies are needed for some of the new extensions. Change-Id: I7e77fe30a87129aa720225ae16eb87cdba8e626e --- scripts/helper_file_generator.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/helper_file_generator.py b/scripts/helper_file_generator.py index 97fde4b..2e7c7b2 100644 --- a/scripts/helper_file_generator.py +++ b/scripts/helper_file_generator.py @@ -525,9 +525,18 @@ class HelperFileOutputGenerator(OutputGenerator): # safe_struct source -- create bodies of safe struct helper functions def GenerateSafeStructSource(self): safe_struct_body = [] + wsi_structs = ['VkXlibSurfaceCreateInfoKHR', + 'VkXcbSurfaceCreateInfoKHR', + 'VkWaylandSurfaceCreateInfoKHR', + 'VkMirSurfaceCreateInfoKHR', + 'VkAndroidSurfaceCreateInfoKHR', + 'VkWin32SurfaceCreateInfoKHR' + ] for item in self.structMembers: if self.NeedSafeStruct(item) == False: continue + if item.name in wsi_structs: + continue if item.ifdef_protect != None: safe_struct_body.append("#ifdef %s\n" % item.ifdef_protect) ss_name = "safe_%s" % item.name @@ -583,7 +592,7 @@ class HelperFileOutputGenerator(OutputGenerator): m_type = 'safe_%s' % member.type if member.ispointer and 'safe_' not in m_type and self.TypeContainsObjectHandle(member.type, False) == False: # Ptr types w/o a safe_struct, for non-null case need to allocate new ptr and copy data in - if 'KHR' in ss_name or m_type in ['void', 'char']: + if m_type in ['void', 'char']: # For these exceptions just copy initial value over for now init_list += '\n %s(in_struct->%s),' % (member.name, member.name) init_func_txt += ' %s = in_struct->%s;\n' % (member.name, member.name) -- 2.7.4