aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-01-29 14:24:42 -0700
committerIan Elliott <ianelliott@google.com>2016-02-05 14:52:41 -0700
commitead80dd72e9dafb9aed6c2e1e4435ba5944ba668 (patch)
treecd0b84eed42eb9e0d44ee2e0cff60b4a34cdc4f4
parent624090bf925c57df1de0da157b17c769b82c2a36 (diff)
downloadusermoji-ead80dd72e9dafb9aed6c2e1e4435ba5944ba668.tar.xz
layers: MR217 Fix unique_objects android build
Need to guard vkCreateXcbSurfaceKHR in appropriate ifdef
-rwxr-xr-xvk-layer-generate.py13
1 files 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):