From ead80dd72e9dafb9aed6c2e1e4435ba5944ba668 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Fri, 29 Jan 2016 14:24:42 -0700 Subject: layers: MR217 Fix unique_objects android build Need to guard vkCreateXcbSurfaceKHR in appropriate ifdef --- vk-layer-generate.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/vk-layer-generate.py b/vk-layer-generate.py index 756aaf7e..a9145dc8 100755 --- a/vk-layer-generate.py +++ b/vk-layer-generate.py @@ -1553,6 +1553,8 @@ class UniqueObjectsSubcommand(Subcommand): 'CreateDevice', 'CreateComputePipelines', 'CreateGraphicsPipelines'] + # TODO : This is hacky, need to make this a more general-purpose solution for all layers + ifdef_dict = {'CreateXcbSurfaceKHR': 'VK_USE_PLATFORM_XCB_KHR'} # Give special treatment to create functions that return multiple new objects # This dict stores array name and size of array custom_create_dict = {'pDescriptorSets' : 'pAllocateInfo->descriptorSetCount'} @@ -1641,13 +1643,20 @@ class UniqueObjectsSubcommand(Subcommand): else: table_type = "device" pre_call_txt += '%s\n' % (self.lineinfo.get()) - funcs.append('%s%s\n' + open_ifdef = '' + close_ifdef = '' + if proto.name in ifdef_dict: + open_ifdef = '#ifdef %s\n' % (ifdef_dict[proto.name]) + close_ifdef = '#endif\n' + funcs.append('%s' + '%s%s\n' '{\n' '%s' ' %sget_dispatch_table(unique_objects_%s_table_map, %s)->%s;\n' '%s' '%s' - '}' % (qual, decl, pre_call_txt, ret_val, table_type, dispatch_param, call_sig, post_call_txt, ret_stmt)) + '}\n' + '%s' % (open_ifdef, qual, decl, pre_call_txt, ret_val, table_type, dispatch_param, call_sig, post_call_txt, ret_stmt, close_ifdef)) return "\n\n".join(funcs) def generate_body(self): -- cgit v1.2.3