aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2017-03-01 16:22:23 -0700
committerMark Young <marky@lunarg.com>2017-03-01 16:22:23 -0700
commitda6f6ddb6eab3b88e2cdd3ada9a18795858a38fc (patch)
treead1f75de2df86ba1c4501752c74ecb314ac35adf /scripts
parent11cf4ae8a7d98c74d79eab9cb6c21ef62ed0f447 (diff)
downloadusermoji-da6f6ddb6eab3b88e2cdd3ada9a18795858a38fc.tar.xz
scripts: Update loader automation
Merge a few if's together to make the code easier to follow. Change-Id: I2453c8217da81befb4f44af19241c13c4aaef8af
Diffstat (limited to 'scripts')
-rw-r--r--scripts/loader_extension_generator.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/scripts/loader_extension_generator.py b/scripts/loader_extension_generator.py
index 1d2d984c..1aafd843 100644
--- a/scripts/loader_extension_generator.py
+++ b/scripts/loader_extension_generator.py
@@ -1095,9 +1095,8 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
if has_surface == 1:
funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(surface);\n'
funcs += ' uint8_t icd_index = phys_dev_term->icd_index;\n'
- funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n'
- funcs += ' if (NULL != (void *)icd_surface->real_icd_surfaces[icd_index]) {\n'
- funcs += ' ' + return_prefix + 'icd_term->dispatch.'
+ funcs += ' if (NULL != icd_surface->real_icd_surfaces && NULL != (void *)icd_surface->real_icd_surfaces[icd_index]) {\n'
+ funcs += ' ' + return_prefix + 'icd_term->dispatch.'
funcs += base_name
funcs += '('
count = 0
@@ -1115,8 +1114,7 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
count += 1
funcs += ');\n'
if not has_return_type:
- funcs += ' return;\n'
- funcs += ' }\n'
+ funcs += ' return;\n'
funcs += ' }\n'
funcs += return_prefix
@@ -1142,9 +1140,8 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
funcs += ' struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index);\n'
funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.%s) {\n' % base_name
funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)%s;\n' % (surface_var_name)
- funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n'
- funcs += ' if ((VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) {\n'
- funcs += ' %sicd_term->dispatch.%s(' % (return_prefix, base_name)
+ funcs += ' if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) {\n'
+ funcs += ' %sicd_term->dispatch.%s(' % (return_prefix, base_name)
count = 0
for param in ext_cmd.params:
if count != 0:
@@ -1159,9 +1156,8 @@ class LoaderExtensionOutputGenerator(OutputGenerator):
funcs += ');\n'
if not has_return_type:
funcs += ' return;\n'
- funcs += ' }\n'
funcs += ' }\n'
- funcs += ' %sicd_term->dispatch.%s(' % (return_prefix, base_name)
+ funcs += ' %sicd_term->dispatch.%s(' % (return_prefix, base_name)
count = 0
for param in ext_cmd.params:
if count != 0: